Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Dynamic stored procedure
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
![]() |
![]() |