variable copy statement?
variable copy statement?
От:
"Magnus L. Birkner" <Magnus@iridescent.bc.ca>
Дата:
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