Re: [GENERAL] COPY with a variable path

2008-11-27 Thread Raymond O'Donnell
On 27/11/2008 23:09, Bill Todd wrote: > Raymond O'Donnell wrote: >> You could write a pl/pgsql function which constructs the query as a >> string and then runs it with EXECUTE. >> > According to the PostgreSQL help file EXECUTE is used to execute a > prepared statement. I tried that but when I

Re: [GENERAL] COPY with a variable path

2008-11-27 Thread Bill Todd
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 s

Re: [GENERAL] COPY with a variable path

2008-11-27 Thread Bill Todd
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 s

Re: [GENERAL] COPY with a variable path

2008-11-27 Thread Raymond O'Donnell
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 EXE

[GENERAL] COPY with a variable path

2008-11-27 Thread Bill Todd
I want to execute the following COPY command in a stored procedure, however, I need to pass the path to the file as an input parameter. 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? cop