Skip to Main Content

Oracle Database Discussions

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!

how to handle no_data_found exception in dynamic sql

user13065317Jun 29 2010 — edited Jul 14 2010
Hi,
I have to use a dynamic sql to get value of a column into a variable. But suppose the value of column is null then it gives no data found exception. How can i handle no data found exception in dynamic sql.

for instance
declare variable1 number;
execute immedate ' select column_name from table_name where condition ' into variable1;
dbms_output.put_line(to_char(variable1));

Thanks,
Yogesh
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 11 2010
Added on Jun 29 2010
2 comments
2,374 views