Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 557824754A8 for ; Wed, 14 Aug 2002 09:03:09 -0400 (EDT) Received: from anchor-post-35.mail.demon.net (anchor-post-35.mail.demon.net [194.217.242.85]) by postgresql.org (Postfix) with ESMTP id 9FD96476689 for ; Wed, 14 Aug 2002 09:03:03 -0400 (EDT) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-35.mail.demon.net with esmtp (Exim 3.36 #2) id 17exnl-00021P-0U; Wed, 14 Aug 2002 14:03:07 +0100 Received: from localhost ([127.0.0.1] helo=localhost.localdomain ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.35 #1 (Debian)) id 17exnf-0007so-00; Wed, 14 Aug 2002 14:02:59 +0100 Subject: Re: parser: parse error at or near "$1" From: Oliver Elphick To: Sugandha Shah Cc: pgsql-sql@postgresql.org In-Reply-To: <026801c2438d$c9466a00$2005a8c0@cybage.com> References: <026801c2438d$c9466a00$2005a8c0@cybage.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 14 Aug 2002 14:02:59 +0100 Message-Id: <1029330179.28727.14.camel@linda> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/224 X-Sequence-Number: 9070 On Wed, 2002-08-14 at 13:26, Sugandha Shah wrote: > Hi , > I'm getting this error : > > Error occurred while executing PL/pgSQL function ins_schedule_status > line 42 at SQL statement > parser: parse error at or near "$1" > > Unable to locate the cause. Please any hint or clue will be of great help. > > Below is the function > > > CREATE FUNCTION ins_schedule_status(int4,time without time zone,varchar(256),int2,int2,int2) RETURNS int4 AS ' > DECLARE > schedule_id ALIAS FOR $1; ... > insert into status_log ( log_id, computer_id,schedule_id,status, schedule_id in the insert is a column name; the alias subsitutes $1 at that point. You had better choose variable names that don't conflict with anything else. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "Let us therefore come boldly unto the throne of grace, that we may obtain mercy, and find grace to help in time of need." Hebrews 4:16