Received: from smtp016.mail.yahoo.com (smtp016.mail.yahoo.com [216.136.174.113]) by postgresql.org (Postfix) with SMTP id 38DFA475858 for ; Wed, 27 Mar 2002 15:29:29 -0500 (EST) Received: from psc.progress.com (HELO saturn.janwieck.net) (janwieck@192.233.92.200 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 27 Mar 2002 20:28:08 -0000 Received: (from wieck@localhost) by saturn.janwieck.net (8.11.2/8.11.2) id g2RKPxH27695; Wed, 27 Mar 2002 15:25:59 -0500 From: Jan Wieck Message-Id: <200203272025.g2RKPxH27695@saturn.janwieck.net> Subject: Re: function error In-Reply-To: from Travis Hoyt at "Mar 27, 2002 02:59:39 pm" To: Travis Hoyt Date: Wed, 27 Mar 2002 15:25:59 -0500 (EST) Cc: pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200203/365 X-Sequence-Number: 7239 Travis Hoyt wrote: > CREATE FUNCTION biwklyavg(text, text, text) RETURNS numeric AS ' > DECLARE > system ALIAS $1; > startdate ALIAS $2; > enddate ALIAS $3; > result numeric; > > BEGIN > result := (select (avg(usr) + avg(sys)) from sardata where > systemid = system > and time between startdate and enddate; > END; > ' LANGUAGE 'sql'; What about using a language that actually supports the above syntax, like plpgsql? Jan > > Hello, > > The fuction listed above gives the following error: > > ERROR: parser: parse error at or near "alias" > > I'm running v7.2. Any ideas? I pulled this directly from the examples in > the PostgreSQL Developer's Handbook. > > Thanks, > > Travis -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com # _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com