pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Wieck <janwieck@yahoo.com>
To: Travis Hoyt <thoyt@npc.net>
Cc: pgsql-sql@postgresql.org
Subject: Re: function error
Date: Wed, 27 Mar 2002 15:25:59 -0500 (EST)
Message-ID: <200203272025.g2RKPxH27695@saturn.janwieck.net> (raw)
In-Reply-To: <DBEMKMGOMJAGKAKEPPEGKEANDHAA.thoyt@npc.net>

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




view thread (14+ messages)  latest in thread

Message-ID: <200203272025.g2RKPxH27695@saturn.janwieck.net>
Permalink:  ../200203272025.g2RKPxH27695@saturn.janwieck.net/
Also on:    postgresql.org/message-id/200203272025.g2RKPxH27695@saturn.janwieck.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: janwieck@yahoo.com, thoyt@npc.net
  Subject: Re: function error
  In-Reply-To: <200203272025.g2RKPxH27695@saturn.janwieck.net>
  References: <DBEMKMGOMJAGKAKEPPEGKEANDHAA.thoyt@npc.net> <200203272025.g2RKPxH27695@saturn.janwieck.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox