Re: "copy from" in "create function"

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Gifford Hesketh <gifford(dot)hesketh(at)gmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: "copy from" in "create function"
Date: 2004-10-25 17:19:02
Message-ID: 417D3586.10600@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)Yahoo(dot)com #

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Marinos Yannikos 2004-10-25 19:44:49 plpgsql: PERFORM vs. SELECT INTO (PERFORM not setting FOUND variable?)
Previous Message Bruno Wolff III 2004-10-25 16:32:50 Re: now() + integer, not rounded to whole day