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 -> Re: Dynamic stored procedure

Re: Dynamic stored procedure

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Fri, 31 Mar 2000 17:53:14 +0200
Message-ID: <954518690.15515.1.pluto.d4ee154e@news.demon.nl>


Personally I always wrap statements without cursor in the following small procedure

create or replace procedure do_sql(sqlstr in varchar2) is cur_handle integer;
res integer;
begin
cur_handle := dbms_sql.open_cursor;
dbms_sql.parse(cur_handle, sqlstr, dbms_sql.native); res := dbms_sql.execute(cur_handle);
dbms_sql.close(cur_handle);
end;

Hth,

Sybrand Bakker, Oracle DBA

Mike Thys <Mike_at_cybernet.be> wrote in message news:8c2cjh$ecd$1_at_news0.skynet.be...
> I try to create a dynamic stored procedure to do aan insert on a table..
>
> The parameter i need to have is the table name.
>
> thus my sql syntax look like "INSERT INTO " || MyTableName || " ( ID )
> values ( " || mySequenceID || " ) ";
>
> I suppose that a should use the DBMS_SQL objet...
>
> but what is the syntax
>
> ???
>
> Mike
>
>
>
>
Received on Fri Mar 31 2000 - 09:53:14 CST

Original text of this message

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