Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

including variables in COPY command


  • From: Dinesh <dbhandary(at)mongonet(dot)net>
  • To: pgsql-admin(at)postgresql(dot)org
  • Subject: including variables in COPY command
  • Date: Wed, 19 Dec 2007 17:28:21 -0800
  • Message-id: <4769C535.2000603@mongonet.net> <text/plain>

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





Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group