variable copy statement?

From: "Magnus L(dot) Birkner" <Magnus(at)iridescent(dot)bc(dot)ca>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: variable copy statement?
Date: 2000-12-09 19:22:17
Message-ID: 069f01c06215$585c1980$030101c0@crdva1.bc.wave.home.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Browse pgsql-novice by date

  From Date Subject
Next Message mlw 2000-12-09 22:30:46 Re: OK, does anyone have any better ideas?
Previous Message Tom Lane 2000-12-09 16:39:14 Re: OK, does anyone have any better ideas?