Live ORACLE

if you are Oracle Developer ,than this Blog most likely will make you happy.

About my Blog

This Blog particularized for Oracle Developers ... you will see interesting Codes for SQL , PL/SQL as well as new ideas for Developer Suite and Client Tools that will help you in your professional life ... and I hope I reach for your satisfaction.

About Me

I'm Hany Freedom , 25 years old , I live in EL-Minia City in Egypt , I'm Moderator at ArabOUG.org the best Arabic Forum for ORACLE on the Net. if you interested to know more about me .... just Click Here.

Managing Multiple Errors With a Single Exception Handler

DECLARE
emp_column VARCHAR2(30) := 'last_name';
table_name VARCHAR2(30) := 'emp';
temp_var VARCHAR2(30);
BEGIN
temp_var := emp_column;
SELECT column_name
INTO temp_var
FROM user_tab_cols
WHERE table_name = 'EMPLOYEES'
AND column_name = Upper(emp_column);
-- processing here
temp_var := table_name;
SELECT object_name
INTO temp_var
FROM user_objects
WHERE object_name = Upper(table_name)
AND object_type = 'TABLE';
-- processing here
EXCEPTION
WHEN no_data_found THEN -- catches all 'no data found' errors

dbms_output.Put_line('No Data found for SELECT on '
||temp_var);
END;
/

OUTPUT:-

No Data found for SELECT on emp

PL/SQL procedure successfully completed.

Share/Save/Bookmark

0 comments:

Post a Comment



Newer Posts Older Posts Home Page
 
http://www.dpriver.com/images/sqlpp-banner-2.png

Thanks for reading my Blog ... you Visitor Number :-