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

Home -> Community -> Usenet -> c.d.o.server -> Re: Proceeding table object as procedure argument

Re: Proceeding table object as procedure argument

From: Tom Best <oracle_person_at_yahoo.com>
Date: Tue, 23 Jul 2002 09:13:57 -0400
Message-ID: <ahjh41$9n7$1@news.bentley.com>


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

Original text of this message

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