Re: "copy from" in "create function" - Mailing list pgsql-sql

From Jan Wieck
Subject Re: "copy from" in "create function"
Date
Msg-id 417D3586.10600@Yahoo.com
Whole thread Raw
In response to "copy from" in "create function"  (Gifford Hesketh <gifford.hesketh@gmail.com>)
List pgsql-sql
On 10/20/2004 6:03 PM, Gifford Hesketh wrote:

> Am I forgetting some limitation ?  I get "ERROR:  syntax error at or
> near "$1" at character 22" with this:
> 
> CREATE FUNCTION public.fn_b_import( text ) RETURNS void AS 
> '
> COPY b_import FROM $1 ;
> '
> LANGUAGE 'sql' STABLE;

Utility statements don't accept parameters for arguments. Use the 
EXECUTE syntax of PL/pgSQL for this.


Jan

-- 
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck@Yahoo.com #


pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: now() + integer, not rounded to whole day
Next
From: Marinos Yannikos
Date:
Subject: plpgsql: PERFORM vs. SELECT INTO (PERFORM not setting FOUND variable?)