including variables in COPY command

Поиск
Список
Период
Сортировка
От Dinesh
Тема including variables in COPY command
Дата
Msg-id 4769C535.2000603@mongonet.net
обсуждение исходный текст
Список 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 по дате отправления:

Предыдущее
От: "Jorge Servan"
Дата:
Сообщение: Re: problem with compilation of dynalloc2 segmentation fault
Следующее
От: Dinesh
Дата:
Сообщение: including variables in copy command