Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

catch excpetion in execute immediate

597998Mar 19 2010 — edited Mar 19 2010
i would like to run some select statement and if identiefier not exist i would like to write error but exception is never executed even if identifier does not exist. This is my code:

begin
execute immediate 'select '||objekt_2.kolona||' from '||objekt_1.ime_tabele;
DBMS_OUTPUT.PUT_LINE('test :select '||objekt_2.kolona||' from '||objekt_1.ime_tabele);

EXCEPTION
WHEN OTHERS THEN

DBMS_OUTPUT.PUT_LINE('error');

flag := 1;
end;
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 16 2010
Added on Mar 19 2010
5 comments
16,844 views