Topic: Oracle Certified Professional Exams (OCP & OCA) >> How to use Locator Variables
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Title: How to use Locator Variables |
| Jerry T |
Posted: Jan 14, 2008 08:28:34 AM |
Total Post: 3
Joined: Jan, 2008
|
All ,
Can anyone give an example to use locator variables to identify exception
Thanks ,
Jerry
|
|
|
Vinod |
| Posted: Jan 14, 2008 08:35:34 AM | |
|
Total Post: 54
Joined: Oct, 2007
|
Jerry ,
I have listed a simple example of locator variables for exception handling ,hope it's clear now !!
CREATE OR REPLACE PROCEDURE example AS
stmt_no NUMBER;
name VARCHAR2(100);
BEGIN
stmt_no := 1; -- designates 1st SELECT statement
SELECT table_name INTO name FROM user_tables WHERE table_name LIKE 'VIN%';
stmt_no := 2; -- designates 2nd SELECT statement
SELECT table_name INTO name FROM user_tables WHERE table_name LIKE 'OD%';
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE('Table name not found in query ' || stmt_no);
END;
/
CALL example();
-Vinod
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gopu Gopi | 334 |
| Gitesh Trivedi | 322 |
| Vinoth Kumar | 264 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|