Re: PL/SQL substitution question

From: William L. Pribyl <wlp_at_hounix.org>
Date: Sun, 3 May 1992 14:00:54 GMT
Message-ID: <1992May3.140054.21676_at_hounix.org>


In article <1992Apr30.160640.1_at_sugaree.uu.net> james_at_sugaree.uu.net (James O. Payne, Jr.) writes:

>What do I need to replace my brackets with to get this test procedure to work?
>
> update [site.user_name].sitetest
> set val2 = datarow.val2
> where val1 = datarow.val1;
 

>===========================================================================
>| James O. Payne, Jr. |
>| IKEA NA Information Systems |
>| Plymouth Meeting, PA 19462 USA 215/834-0180 x343 |
>===========================================================================

There may be other ways to tackle this problem, but here is one: I believe this is the same problem as "select ... from X" where X is a variable. SQL doesn't let you do this. So what you get to do instead is somehow generate the required SQL statements and then execute them. The usual way to generate SQL is either to write "dynamic SQL" in a programmatic interface (Pro*C, for example) or, using SQL or PL/SQL, build the needed SQL script as textual records in a temporary table. The temp table might be of structure (seq number, text char(80). Then spool the contents of the temporary table to a file and execute as a script. If you want more details, e-mail me...

--Bill

-- 
-------------------------------------------------------------------------
William L. Pribyl                 |  Internet:  wlp_at_hounix.org
DataCraft, Inc.                   |     or   :  70451.2315_at_compuserve.com
Houston, TX   Voice: 713-526-7345 |--------------------------------------
Received on Sun May 03 1992 - 16:00:54 CEST

Original text of this message