Skip site navigation (1) Skip section navigation (2)

Re: variable substitution in SQL commands

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: bill house <wchouse(at)bellsouth(dot)net>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: variable substitution in SQL commands
Date: 2010-01-31 21:06:20
Message-ID: 16258.1264971980@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-novice
bill house <wchouse(at)bellsouth(dot)net> writes:
> I am trying to learn how to construct SQL commands using information 
> derived from other SQL commands/querys.
> These commands are stored for the moment in a simple text file which 
> would be executed by the psql client like so:
> 	current_database=# \i sql_command_file.sql

This is really getting beyond what you can do usefully with a simple
psql text file.  My first suggestion would be to see if you can write
what you need as a plpgsql function.

			regards, tom lane

In response to

Responses

pgsql-novice by date

Next:From: bill houseDate: 2010-02-01 03:27:21
Subject: Re: variable substitution in SQL commands
Previous:From: bill houseDate: 2010-01-31 21:03:19
Subject: variable substitution in SQL commands

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group