Skip to content

Return empty table instead of cryptic upper bound of for loop error  #14

Description

@kobruleht

If there are no rows in result, empy table with key columns should returned intead of raising "upper bound of for loop" exception. Add those lines

        execute ('create temp table ' || in_table || ' on commit drop as ' || in_query);
-- Start of added lines
GET DIAGNOSTICS Arv = ROW_COUNT;
            if Arv  = 0 then
Execute 'create temp table ' || quote_ident(out_table) || ' on commit drop as select * from '||in_table ;
return;
            end if;
-- End of added lines
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions