including variables in copy command - Mailing list pgsql-admin

From Dinesh
Subject including variables in copy command
Date
Msg-id 4769C8EA.3000005@mongonet.net
Whole thread Raw
Responses Re: including variables in copy command  ("Phillip Smith" <phillip.smith@weatherbeeta.com.au>)
List pgsql-admin
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
end_date. It works fine when I passed the real value. Has anyone used
variable within a copy ?  Please let me know.

Thanks,

Dinesh

pgsql-admin by date:

Previous
From: "Phillip Smith"
Date:
Subject: Re: Dump database more than 1 flat file
Next
From: "Phillip Smith"
Date:
Subject: Re: including variables in copy command