Re: COPY with a variable path

Поиск
Список
Период
Сортировка
От Bill Todd
Тема Re: COPY with a variable path
Дата
Msg-id 492F28B7.7040200@dbginc.com
обсуждение исходный текст
Ответ на Re: COPY with a variable path  (Raymond O'Donnell <rod@iol.ie>)
Список pgsql-general
Raymond O'Donnell wrote:
On 27/11/2008 20:52, Bill Todd wrote:
 
Substituting the input parameter for the literal path does not work and
neither does using PREPARE/EXECUTE. How can I pass the file path as a
parameter?   
You could write a pl/pgsql function which constructs the query as a
string and then runs it with EXECUTE.

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

 
According to the PostgreSQL help file EXECUTE is used to execute a prepared statement. I tried that but when I call PREPARE with COPY as the statement I get an error. Are you saying that I can also use EXECUTE as

EXECUTE AStringVariable;

where AStringVariable contains a valid SQL statement? If so, that is the solution.

Bill

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Nested Loop Left Join always shows rows=1
Следующее
От: Bill Todd
Дата:
Сообщение: Re: COPY with a variable path