Stored Procedure: Copy table from; path = text variable

Поиск
Список
Период
Сортировка
От Charles Pare
Тема Stored Procedure: Copy table from; path = text variable
Дата
Msg-id BAY124-W186331C42248ED7DADA894EF0C0@phx.gbl
обсуждение исходный текст
Ответы Re: Stored Procedure: Copy table from; path = text variable  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
Hi, in a stored procedure, if I do
COPY table FROM 'mypath' DELIMITERS '\t'; it works but if my path is a text variable which contain my path, i.e.
COPY table FROM mytextvar DELIMITERS '\t'; it doesn't work, I get

ERROR: syntax error at or near "$1"
SQL state: 42601
Context: SQL statement in PL/PgSQL function "parseinsert" near line 15

Is there any workaround? I want to create a temporary table, copy from and parse the table, all with dynamic path depending of how the function is called.

Thank's
Charles


Explore the seven wonders of the world Learn more!

В списке pgsql-general по дате отправления:

Предыдущее
От: Emi Lu
Дата:
Сообщение: Date for a week day of a month
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Stored Procedure: Copy table from; path = text variable