1

I'm using Enterprise Postgres 9.5 with Oracle Compatibility. I have a problem with the EXECUTE IMMEDIATE command.

Say I have a table with few columns and one of them can accept NULLs. If I do

EXECUTE IMMEDIATE 'select null_col from '||table_name||' where col1=10' into x;

It sends the value to x, if null_col returns any.

When I given the condition col1=19, where 19 is not present in the table, then I get the error like this.

  query returned no rows

and my execution stops. So how can I handle that. Oracle doesn't given any error for such statements, whereas EDB does. Please help. I didn't find any EDB tags, so please tag if you think this is inappropriate question here. Thanks for understanding.

user1720827
  • 137
  • 1
  • 3
  • 15

0 Answers0