Re: Execute Immediate
by "Bryan Bateman" <batemanb(at)home.com>
|
Date: |
Sat, 16 Dec 2000 06:56:16 -0000 |
To: |
"Susan Bishop" <aka_susanb(at)yahoo.com>, "hwglang" <hwg-languages(at)hwg.org> |
References: |
yahoo |
|
todo: View
Thread,
Original
|
|
For which database??? All have slightly different syntaxes.
----- Original Message -----
From: "Susan Bishop" <aka_susanb(at)yahoo.com>
To: "hwglang" <hwg-languages(at)hwg.org>
Sent: Friday, December 15, 2000 4:22 AM
Subject: Execute Immediate
> Hi All,
>
> I got roped into having to write some dynamic sql. Can it be used like
> this to update multiple rows? Does this look right?
> --------------------------------------------------------------------------
-----------------------------
>
> VAR t_key NUMBER;
> VAR t_nam VARCHAR2;
> Select record_id into :t_key from yadayad where field_name = 'ladeda';
> Select table_name into :t_nam from .....
> . run
>
> BEGIN
>
> execute immediate
>
> 'Insert into mgn_asset_value_list (parent_id, list_id, sort_order,
> value)
> SELECT record_id, '||:t_key||', rownum, TT from '||:t_nam||' whereTT is
> NOT NULL';
>
> END
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free (at)yahoo.com address at http://mail.yahoo.com
>
HWG: hwg-languages mailing list archives,
maintained by Webmasters @ IWA