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: Variable for column name

Re: Variable for column name

From: Billy Verreynne <vslabs_at_onwe.co.za>
Date: Wed, 27 Oct 1999 10:56:46 +0200
Message-ID: <7v6f28$bg2$1@ctb-nnrp1.saix.net>


dan_beatty_at_my-deja.com wrote in message <7v58hp$nom$1_at_nnrp1.deja.com>...

<snipped>
>What I want to do is use the v_field_name as follows:
>
> UPDATE new_table
> SET v_field_name = :NEW.udf
>

This can not be parsed by Oracle as "v_field_name" contains a variable. Does it refer to a numeric, date or varchar? How does Oracle check that the column name is valid? Etc.

The only way for Oracle to parse this is to do it at runtime - not possible in a normal PL/SQL block where the parsing is done at compilation time. The solution is to use dynamic SQL in a PL/SQL block (there's a DBMS SQL package that supports it). The PL/SQL manual also describes dynamic SQL I think.

regards,
Billy Received on Wed Oct 27 1999 - 03:56:46 CDT

Original text of this message

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