pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedHow do I print a message in a function?
3+ messages / 3 participants
[nested] [flat]
* How do I print a message in a function?
@ 2001-07-02 23:46 Wei Weng <wweng@kencast.com>
2001-07-03 00:59 ` Re: How do I print a message in a function? Jie Liang <jliang@ipinc.com>
0 siblings, 1 reply; 3+ messages in thread
From: Wei Weng @ 2001-07-02 23:46 UTC (permalink / raw)
To: pgsql-sql
I did something like
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.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: How do I print a message in a function?
2001-07-02 23:46 How do I print a message in a function? Wei Weng <wweng@kencast.com>
@ 2001-07-03 00:59 ` Jie Liang <jliang@ipinc.com>
0 siblings, 0 replies; 3+ messages in thread
From: Jie Liang @ 2001-07-03 00:59 UTC (permalink / raw)
To: Wei Weng <wweng@kencast.com>; +Cc: pgsql-sql
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@ipinc.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@postgresql.org
>
^ permalink raw reply [nested|flat] 3+ messages in thread
* RE: How do I print a message in a function?
@ 2001-07-03 14:08 Jeff Eckermann <jeckermann@verio.net>
0 siblings, 0 replies; 3+ messages in thread
From: Jeff Eckermann @ 2001-07-03 14:08 UTC (permalink / raw)
To: Wei Weng <wweng@kencast.com>; +Cc: 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@ipinc.com]
> Sent: Monday, July 02, 2001 7:59 PM
> To: Wei Weng
> Cc: pgsql-sql@postgresql.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@ipinc.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@postgresql.org
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2001-07-03 14:08 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-07-02 23:46 How do I print a message in a function? Wei Weng <wweng@kencast.com>
2001-07-03 00:59 ` Jie Liang <jliang@ipinc.com>
2001-07-03 14:08 RE: How do I print a message in a function? Jeff Eckermann <jeckermann@verio.net>
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