Home » SQL & PL/SQL » SQL & PL/SQL » variable in implicit cursor problem
variable in implicit cursor problem [message #37200] Thu, 24 January 2002 02:16 Go to next message
John D. Elliott
Messages: 3
Registered: October 2001
Junior Member
All,

Here is the simple version of the code.

declare

v_schema varchar2(30);

begin
v_schema := 'scott.emp';

select * from v_schema;

end;
/

I get the pls-00201 error that v_schema is not declared. I even try and substitute in place of the variable scott.emp and it says scott is not declared. I know this must be something simple, but I have tried everything I can think of. I have tried quoting, separating the schema and table name into different variables, etc.

Any suggestions would be very welcomed.

Thanks,

John
Re: variable in implicit cursor problem [message #37203 is a reply to message #37200] Thu, 24 January 2002 04:43 Go to previous message
dinakar shetty
Messages: 29
Registered: January 2002
Junior Member
hi in oracle u can execute a dynamically created string directly
Use
DBMS_SQL
new REF_CURSOR
or
Excecute immidiate
Previous Topic: Cannot commit in a trigger
Next Topic: what is the equivalent of temporary table of sql server in oracle
Goto Forum:
  


Current Time: Tue Apr 16 18:52:38 CDT 2024