Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Proceeding table object as procedure argument
Stjepan:
Use dynamic SQL. Create the SQL statement as a string, concatenating the parameters containing the table/column names. Something like this:
sql_statement := 'update ' || p_tablename || ' set ' || p_columnname || ' =
''' || p_someval || '''';
execute immediate sql_statement;
HTH,
Tom Best
"Stjepan Brbot" <stjepan.brbot_at_zg.hinet.hr> wrote in message
news:ahj6kv$b4e0$2_at_as201.hinet.hr...
> How can I send table (object) to database PL/SQL procedure as an
> argument? For example I'd like to create generic procedure accepting the
> table (object) for updating one column in that table with particular
> value. Of course, every table sent to this procedure should have the
> same column.
>
> This procedure should execute DML like this where 'tablename' is the
> table (object) sent as argument to this procedure:
>
> UPDATE tablename.column SET 'xyz';
>
> --
>
> Stjepan Brbot
>
>
>
>
Received on Tue Jul 23 2002 - 08:13:57 CDT