|
|
Re: Stored Procedure [message #369789 is a reply to message #369787] |
Wed, 11 October 2000 22:36 |
Aditya Deshpande
Messages: 3 Registered: October 2000
|
Junior Member |
|
|
Create or Replace procedure test
(new_code IN VARCHAR2,
TBL_NAME IN VARCHAR2,
MSG_DESC OUT VARCHAR2)
IS
BEGIN DECLARE
queryStr Varchar2(2000);
TYPE TempRefCursor IS REF CURSOR;
c1 TempRefCursor;
BEGIN
queryStr := 'SELECT MESSAGE INTO MSG_DESC '
|| 'FROM :Tbl '
|| 'WHERE CODE=NEW_CODE' ;
OPEN c1 FOR queryStr USING TABLE_NAME;
FETCH c1 INTO MSG_DESC;
END;
END;
|
|
|
Re: Stored Procedure- A little Mistake [message #369790 is a reply to message #369787] |
Wed, 11 October 2000 22:40 |
Aditya Deshpande
Messages: 3 Registered: October 2000
|
Junior Member |
|
|
Sorry made a little mistake. Comes when you are trying to give a quick answer and rely too much on copy and paste :o)
Create or Replace procedure test
(new_code IN VARCHAR2,
TBL_NAME IN VARCHAR2,
MSG_DESC OUT VARCHAR2)
IS
BEGIN DECLARE
queryStr Varchar2(2000);
TYPE TempRefCursor IS REF CURSOR;
c1 TempRefCursor;
BEGIN
queryStr := 'SELECT MESSAGE'
|| 'FROM :Tbl '
|| 'WHERE CODE= :code';
OPEN c1 FOR queryStr USING TABLE_NAME,new_code;
FETCH c1 INTO MSG_DESC;
END;
END;
|
|
|