Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using variables while redirecting input from file?

Status
Not open for further replies.

fig

Programmer
Apr 29, 2001
1
0
0
US
If I want to test some SQL with the following at the CLI:

Code:
psql test < test.sql > test.txt

...is there a way to set a variable with a SELECT, and then use that variable when doing a subsequent INSERT in the test.sql file?

Ideas?

Thanks,
fig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top