SQL Script Exit Condition [message #378415] |
Tue, 30 December 2008 05:47 |
newtooracle123
Messages: 24 Registered: May 2007
|
Junior Member |
|
|
Hello,
In the below mention code snippet, I intend to return email id for a user back to the calling KSH file.
SET LINESIZE 500
SET FEEDBACK OFF
SET SERVEROUTPUT ON SIZE 1000000
SET TRIMSPOOL on
SET HEAD ON
SET PAGESIZE 0
SET TERMOUT ON
SET VERIFY OFF
VARIABLE return_val VARCHAR2(100);
BEGIN
SELECT email_id
INTO :return_val
FROM table_name
WHERE name= '&1' ;
EXCEPTION
WHEN OTHERS
THEN
:return_val := 'ERR';
END;
/
EXIT :return_val;
I am getting below mentioned error in doing so.
Usage: { EXIT | QUIT } [ SUCCESS | FAILURE | WARNING | n |
<variable> | :<bindvariable> ] [ COMMIT | ROLLBACK ]
Can anyone please guide me on whats wrong with the above implementation? Is it not possible to send a VARCHAR2 back to calling KSH?
|
|
|
|
|
|
|
|