Re: plpgsql test function

From: JanWieck(at)t-online(dot)de (Jan Wieck)
To: kurt_miller(at)sfgh(dot)org
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: plpgsql test function
Date: 2000-07-11 18:55:23
Message-ID: 200007111855.UAA19302@hot.jw.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

kurt miller wrote:
> This simple test function fails.
>
> ----------------------------------------------
> drop function testit(text);
> create function testit(text) returns text as '
> DECLARE
> myval text;
> BEGIN
> myval:= $1;
> return myval;
> END;
> ' language 'plpgsql';
>
> select testit('testing');
> select testit(''testing'');
> ----------------------------------------------
>
> Result:
>
> DROP
> CREATE
> ERROR: parser: parse error at or near ""
> ERROR: parser: parse error at or near "testing"
>
> It doesn't seem like the parameter passing mechanism is working.
> What am i missing?

All I can see is a missing whitespace after "myval".
The PL/pgSQL parser isn't that smart as the main one.

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-general by date

  From Date Subject
Next Message teixeira 2000-07-11 19:00:57 Re: Benchmarks?
Previous Message Prasanth A. Kumar 2000-07-11 18:46:23 Re: Slashdot discussion