X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 56C103A4167 for ; Mon, 25 Oct 2004 18:19:21 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 76580-01 for ; Mon, 25 Oct 2004 17:19:18 +0000 (GMT) Received: from smtp017.mail.yahoo.com (smtp017.mail.yahoo.com [216.136.174.114]) by svr1.postgresql.org (Postfix) with SMTP id 7E7E43A415A for ; Mon, 25 Oct 2004 18:19:13 +0100 (BST) Received: from unknown (HELO jupiter.black-lion.info) (janwieck@68.80.245.191 with login) by smtp017.mail.yahoo.com with SMTP; 25 Oct 2004 17:19:11 -0000 Received: from [172.21.8.18] (ismtp.afilias.com [216.217.55.254]) (authenticated bits=0) by jupiter.black-lion.info (8.12.10/8.12.9) with ESMTP id i9PHJ894006439; Mon, 25 Oct 2004 13:19:09 -0400 (EDT) (envelope-from JanWieck@Yahoo.com) Message-ID: <417D3586.10600@Yahoo.com> Date: Mon, 25 Oct 2004 13:19:02 -0400 From: Jan Wieck User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Gifford Hesketh Cc: pgsql-sql@postgresql.org Subject: Re: "copy from" in "create function" References: <4f6940a604102015034e5560bb@mail.gmail.com> In-Reply-To: <4f6940a604102015034e5560bb@mail.gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.6 tagged_above=0.0 required=5.0 tests=RCVD_IN_NJABL_DUL, RCVD_IN_SORBS_DUL X-Spam-Level: * X-Archive-Number: 200410/181 X-Sequence-Number: 19284 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 #