Return Cursor problem [message #36355] |
Mon, 19 November 2001 13:39 |
Poonamb
Messages: 16 Registered: October 2001
|
Junior Member |
|
|
I have a procedure (MySQLStatement IN varchar2,
MyReturnCursor OUT returncursor);
NOTE : I have defined the return cursor as ref cursor and it works.
In my procedure, I need to manipulate the input string which is nothing but a select statement. I create a local variable MyNewSQLStatement in which I put this new massaged sqlstatement and then, do the following :
OPEN MyReturnCursor FOR MyNewSqlStatement;
IT FAILS !!
If I say
OPEN MyReturnCursor FOR
SELECT * FROM MYTABLE WHERE ID = 1243; -- works
But If I say
MyNewSQLStatement = 'SELECT * FROM MYTABLE WHERE ID = 1243;';
OPEN MyReturnCursor FOR MyNewSqlStatement; -- does not work. I tried && also.
Please help!!
Thanks in advance.
----------------------------------------------------------------------
|
|
|
Re: Return Cursor problem [message #36358 is a reply to message #36355] |
Tue, 20 November 2001 04:26 |
Suresh Vemulapalli
Messages: 624 Registered: August 2000
|
Senior Member |
|
|
what error you are getting?. remove semicolon in your sql statement.
try this:
MyNewSQLStatement = 'SELECT * FROM MYTABLE WHERE ID = 1243';
OPEN MyReturnCursor FOR MyNewSqlStatement;
----------------------------------------------------------------------
|
|
|