Re: Stored Procedure: Copy table from; path = text variable

From: Charles Pare <debile_trash(at)hotmail(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Stored Procedure: Copy table from; path = text variable
Date: 2007-07-03 19:39:13
Message-ID: BAY124-W34F77EE6794B092B0D2002EF0C0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Wow, it works greatThank's for the quick answerThe Postgres community is amazing!Charles> Date: Tue, 3 Jul 2007 20:01:03 +0100> From: dev(at)archonet(dot)com> To: debile_trash(at)hotmail(dot)com> CC: pgsql-general(at)postgresql(dot)org> Subject: Re: [GENERAL] Stored Procedure: Copy table from; path = text variable> > Charles Pare wrote:> > 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:> > 42601Context: SQL statement in PL/PgSQL function "parseinsert" near> > line 15Is 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'sCharles > > Try building your COPY as text and use EXECUTE.> > -- > Richard Huxton> Archonet Ltd> > ---------------------------(end of broadcast)---------------------------> TIP 4: Have you searched our list archives?> > http://archives.postgresql.org/
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gabriele 2007-07-03 19:43:13 Design Tool
Previous Message Nick Barr 2007-07-03 19:17:11 Re: Date for a week day of a month