Thread: Automated scripting...

Automated scripting...

From
jkakar@expressus.com
Date:
Hi,

I'm building a script to create a relatively large database.  At some
point in the script I would like to be able to save values into
variables so that I can use them to populate rows.

Is this possible with SQL?  My understanding is that it is not
possible but thought I'd ask anyway.

Thanks,
Jamu.

-- 
Jamu Kakar (Developer)            Expressus Design Studio, Inc.
jkakar@expressus.com            708-1641 Lonsdale Avenue
V: (604) 903-6994            North Vancouver, BC, V7M 2J5


Re: Automated scripting...

From
Christopher Sawtell
Date:
On Wed, 31 Jan 2001 12:54, jkakar@expressus.com wrote:
> Hi,
>
> I'm building a script to create a relatively large database.  At some
> point in the script I would like to be able to save values into
> variables so that I can use them to populate rows.
>
> Is this possible with SQL?  My understanding is that it is not
> possible but thought I'd ask anyway.

I know it seems a bit messy, but you could always use a temporary table to 
store the values.

-- 
Sincerely etc.,
NAME       Christopher SawtellCELL PHONE 021 257 4451ICQ UIN    45863470EMAIL      csawtell @ xtra . co . nzCNOTES
ftp://ftp.funet.fi/pub/languages/C/tutorials/sawtell_C.tar.gz
-->> Please refrain from using HTML or WORD attachments in e-mails to me <<--



Re: Automated scripting...

From
"Albert REINER"
Date:
Saluton,

On Tue, Jan 30, 2001 at 03:54:53PM -0800, jkakar@expressus.com wrote:
...
> I'm building a script to create a relatively large database.  At some
> point in the script I would like to be able to save values into
> variables so that I can use them to populate rows.

Your script will be handled via psql, right? Then you can use \set and
interpolation, as described in `man psql`.

Albert.


-- 

--------------------------------------------------------------------------
Albert Reiner                                   <areiner@tph.tuwien.ac.at>
Deutsch       *       English       *       Esperanto       *       Latine
--------------------------------------------------------------------------