pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dinesh <dbhandary@mongonet.net>
To: pgsql-admin@postgresql.org
Subject: including variables in COPY command
Date: Wed, 19 Dec 2007 17:28:21 -0800
Message-ID: <4769C535.2000603@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





view thread (4+ messages)  latest in thread

Message-ID: <4769C535.2000603@mongonet.net>
Permalink:  ../4769C535.2000603@mongonet.net/
Also on:    postgresql.org/message-id/4769C535.2000603@mongonet.net

 · 

reply

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: <4769C535.2000603@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