Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> R: Variable for column name
Your SQL statement is dynamic (column name at run-time). You have to use
routines from a predefined package (DBMS_SQL) that properly managed dynamic
statements and also DDL statements. Your update will be split into some
phases (preparing, parsing and executing) each one accomplished by a
procedure/function in the package.
I don't know if there are limitations in the use of this package inside a
trigger but I don't think so.
See the manual for more precise information on the DBMS_SQL package.
Riccardo
<dan_beatty_at_my-deja.com> wrote in message 7v58hp$nom$1_at_nnrp1.deja.com...
> I would like to use a variable for a column name in a trigger that I'm
> writing.
>
> For example I have:
>
> SELECT field_name
> INTO v_field_name
> FROM field_table;
>
> What I want to do is use the v_field_name as follows:
>
> UPDATE new_table
> SET v_field_name = :NEW.udf
>
> However, this doesn't work. Any help would be appreciated.
> Thanks,
> Dan
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Oct 27 1999 - 04:11:57 CDT