Re: how to use cursor variable with dynamic SQL in PL/SQL

From: Robert Yeh <robert.yeh_at_qwest.com>
Date: Sat, 21 Jul 2001 21:47:47 GMT
Message-ID: <9f67jt$bkg$1_at_bob.news.rcn.net>


I found my problem.

The reason that
OPEN my_cursor_variable FOR sql_command does work is because I am using 8.0.5.
I tested it in 8.1.6 and it works fine.

Thanks
Bob

Robert Yeh wrote in message <9f5v9l$5b7$1_at_bob.news.rcn.net>...
>I was surprised that I did not find a way to do this in the document. I try
>to pass a cursor variable back to a calling program. Normally it is easy.
 I
>define a variable with ref cursor type. Then I open the cursor with a
 select
>statement like this:
>
>OPEN my_cursor_variable FOR select * from emp;
>return my_cursor_variable;
>
>Now my SQL statement is dynamically constructed. I compose the sql
>statement and put the sql statement in a variable sql_command.
>
>OPEN my_cursor_variable FOR sql_command.
>This gave me an error saying it is expecting for a select.
>
>I did not see a way in DBMS_SQL package which I can use the cursor
 variable.
>
>Any one get any idea?
>
>Thanks
>
>
Received on Sat Jul 21 2001 - 23:47:47 CEST

Original text of this message