RE: How do I print a message in a function?

From: Jeff Eckermann <jeckermann(at)verio(dot)net>
To: Wei Weng <wweng(at)kencast(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: RE: How do I print a message in a function?
Date: 2001-07-03 14:08:20
Message-ID: 08CD1781F85AD4118E0800A0C9B8580B094B0C@NEZU
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I think you need two other things as well:
1. A return statement: "RETURN some-integer;" before the END
2. A semicolon after the END; <--

> -----Original Message-----
> From: Jie Liang [SMTP:jliang(at)ipinc(dot)com]
> Sent: Monday, July 02, 2001 7:59 PM
> To: Wei Weng
> Cc: pgsql-sql(at)postgresql(dot)org
> Subject: Re: How do I print a message in a function?
>
> You have to use two single quota
>
> Jie LIANG
>
> St. Bernard Software
>
> 10350 Science Center Drive
> Suite 100, San Diego, CA 92121
> Office:(858)320-4873
>
> jliang(at)ipinc(dot)com
> www.stbernard.com
> www.ipinc.com
>
> On 2 Jul 2001, Wei Weng wrote:
>
> > I did something like
> >
>
> try this
>
>
> > create function test() returns integer as
> > '
> > declare
> > msg varchar;
> > begin
> > msg := ''test'';
> > RAISE NOTICE ''message is % '',msg;
> > end'
> > language 'plpgsql';
> >
> > The function compiled without any error, however, when I tried to run it
> > as select test(); it broke down with an error message " Unterminated " "
> >
> > Can anyone help me on this?
> >
> > Thanks!
> >
> >
> > --
> > Wei Weng
> > Network Software Engineer
> > KenCast Inc.
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2001-07-03 14:41:59 Re: [SQL] indexing arrays in pgaccess's query interface is failing
Previous Message Jan Wieck 2001-07-03 13:31:25 Re: problem with date/time constants