Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> runtime tablenames in stored procedure.

runtime tablenames in stored procedure.

From: <kagopi_at_my-deja.com>
Date: Mon, 17 Jan 2000 22:57:47 GMT
Message-ID: <8606p2$156$1@nnrp1.deja.com>


Hi all,

Is there a way to provide the table names to a stored procedure at runtime.. ?

I would like to select say, 'login_name' from 3 different tables and use them in a similar way, but the table names should be flexible enough to be determined at runtime.

I have the code below, but it wouldn't
compile.

replace.sql

***************************************set echo on
create or replace procedure ReplaceLoginNamesWithEmpId(
        table_name in char,
        handle_mgr in char)

as
begin
declare
        cursor ID_CURSOR is
        select otheruserid,login_name
        from known_users,table_name
        where login_name = known_users.web_username ;
        empid   varchar(200);
        logname varchar(200);

begin
        open ID_CURSOR;
        for curs_id_rows in  id_cursor
        loop
                fetch ID_CURSOR into empid,logname;
-- insert into dummy_copy values(empid);
        end loop;
        commit;

end;
end;

please cc to kagopi_at_hotmail.com.

thanks,
gopinath

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Jan 17 2000 - 16:57:47 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US