[ADMIN] including variables in copy command

2007-12-20 Thread Dinesh
Hi ALL, I am trying to use Copy command to copy data from table to a flat file. Here is an example: copy ( select * from employee where hire_date between begin_date and end_date) to '/var/data/text.txt' delimiter ';'; But my problem is the query is not able to read variable begin_date and

[ADMIN] including variables in COPY command

2007-12-20 Thread Dinesh
Hi ALL, I am trying to use Copy command to copy data from table to a flat file. Here is an example: copy ( select * from employee where hire_date between begin_date and end_date) to '/var/data/text.txt' delimiter ';'; But my problem is the query is not able to read variable begin_date and

Re: [ADMIN] including variables in copy command

2007-12-19 Thread Phillip Smith
Could you wrap it in a transaction block? begin; select * into temp_table from employee where hire_date between begin_date and end_date; copy temp_table to '/var/data/text.txt' delimiter ';'; commit; THINK BEFORE YOU PRINT - Save paper if you don't really need to print this *

[ADMIN] including variables in copy command

2007-12-19 Thread Dinesh
Hi ALL, I am trying to use Copy command to copy data from table to a flat file. Here is an example: copy ( select * from employee where hire_date between begin_date and end_date) to '/var/data/text.txt' delimiter ';'; But my problem is the query is not able to read variable begin_date and