Re: Any Pl/SQL Guru's out there?

From: Maximus <qweqwe_at_qwqwewq.com>
Date: Fri, 23 May 2003 23:45:41 GMT
Message-ID: <Foyza.53430$3C2.1623030_at_news3.calgary.shaw.ca>


"NavEEd" <naveed010_at_hotmail.com> wrote in message news:CMqza.701$vE1.69133_at_ursa-nb00s0.nbnet.nb.ca...
>
> I'm trying to dynamically assign a value to a dynamic column. Very
 dynamic.
> :)
>
> All seriousness though, here's what I am trying to do
>
> table_rec.<dynamic_col> := SUBSTR(raw_rec.DATA, 1, 9);
>
> Dynamic_Col is a value stored in the table, ie. Customer_Name. I know I
> can do this with update statements, but I don't want to have 25-30 updates
> per record.
>
> I'm wondering if doing it this way is out of scope using DBMS_SQL
>
> sql_string := 'SELECT SUBSTR(raw_rec.DATA, 1, 9) INTO
> table_rec.'||rec.col_name|| ' FROM DUAL;';
>
> Where rec.col_name = Customer_name
>
> Any help would be appreciated.

What you need to use is the EXECUTE IMMEDIATE statement (see the PL/SQL User's Guide). Received on Sat May 24 2003 - 01:45:41 CEST

Original text of this message