ogmf
asked on
oracle authid cursor
How can a CURSOR inside a stored procedure accept variables passed in as a parameter? We want the cursor to SELECT from any schema we have in the database so we would like to pass in a variable for the schema name and have the cursor use this schema_name when it is defined. For example how can I get something like this to work:
CREATE PROCEDURE TEST (schema_name_parameter IN varchar2)
authid current_user
as
begin
declare
variable_junk char(1);
cursor a
as
select junk from schema_name_parameter.tabl e_junk;
begin
open a;
fetch junk into variable_junk;
end;
end;
end test;
/
CREATE PROCEDURE TEST (schema_name_parameter IN varchar2)
authid current_user
as
begin
declare
variable_junk char(1);
cursor a
as
select junk from schema_name_parameter.tabl
begin
open a;
fetch junk into variable_junk;
end;
end;
end test;
/
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.