variable copy statement? - Mailing list pgsql-novice

From Magnus L. Birkner
Subject variable copy statement?
Date
Msg-id 069f01c06215$585c1980$030101c0@crdva1.bc.wave.home.com
Whole thread Raw
List pgsql-novice
Hi. I am new to PostGreSql from a background with Microsoft SQL Server.

Running PostgreSQL 7.0.3 on Red Hat Linux 6.2. I use a COPY statement to
write out a file but need to get the file name from a database table. How
can this be done? This is my statement that works fine:

COPY dbtable TO '/path/filename';

Now I need to select and create the '/path/filename' out of a database, and
then run the COPY statement as just created dynamically.

In MS SQL Server this could easily be done with the EXEC statement and a
variable containing the statement to be executed. How to do it in
PostGreSql?

Magnus



pgsql-novice by date:

Previous
From: "Andrew Chan"
Date:
Subject: ConnectDBStart() -- connect failed
Next
From: "Jody Weissmann"
Date:
Subject: processing results from INTERSECT, UNION or EXCEPT