From: Dinesh <dbhandary@mongonet.net>
To: pgsql-admin@postgresql.org
Subject: including variables in copy command
Date: Wed, 19 Dec 2007 17:44:10 -0800
Message-ID: <4769C8EA.3000005@mongonet.net> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: dbhandary@mongonet.net
Subject: Re: including variables in copy command
In-Reply-To: <4769C8EA.3000005@mongonet.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox