Re: [GENERAL] Dynamic File Name for COPY TO in Stored Procedure

2012-02-23 Thread Carlos Oliva
That worked. Thank you Adrian -Original Message- From: Adrian Klaver [mailto:adrian.kla...@gmail.com] Sent: Thursday, February 23, 2012 9:58 AM To: pgsql-general@postgresql.org Cc: Carlos Oliva Subject: Re: [GENERAL] Dynamic File Name for COPY TO in Stored Procedure On Thursday

Re: [GENERAL] Dynamic File Name for COPY TO in Stored Procedure

2012-02-23 Thread Adrian Klaver
On Thursday, February 23, 2012 6:42:53 am Carlos Oliva wrote: > Hi, > What would it be the correct format for using a variable in a stored > procedure that uses COPY TO? > > I have the current stored procedure: > CREATE FUNCTION Table_To_File(text) RETURNS void AS $delimeter$ >COPY (SELECT * F

[GENERAL] Dynamic File Name for COPY TO in Stored Procedure

2012-02-23 Thread Carlos Oliva
Hi, What would it be the correct format for using a variable in a stored procedure that uses COPY TO? I have the current stored procedure: CREATE FUNCTION Table_To_File(text) RETURNS void AS $delimeter$ COPY (SELECT * FROM table_to_xml('table', true, false, '')) TO '$1' WITH CSV QUOTE ' '; $de