Re: to_char problem

From: "Wei Wang" <ww220(at)cam(dot)ac(dot)uk>
To: "Richard Huxton" <dev(at)archonet(dot)com>, "pgsql" <pgsql-general(at)postgresql(dot)org>
Subject: Re: to_char problem
Date: 2004-02-17 12:37:45
Message-ID: 025a01c3f552$d8005650$726ee880@weiwang
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In that case, how do I RAISE NOTICE a text variable such as:
DECLARE tempstring text;
BEGIN
RAISE NOTICE tempstring;
END

----- Original Message -----
From: "Richard Huxton" <dev(at)archonet(dot)com>
To: "Wei Wang" <ww220(at)cam(dot)ac(dot)uk>; "pgsql" <pgsql-general(at)postgresql(dot)org>
Sent: Monday, February 16, 2004 8:24 PM
Subject: Re: [GENERAL] to_char problem

> On Monday 16 February 2004 19:15, Wei Wang wrote:
> > I get compile error for this code:
> >
> >
> > for i in 1..arg_count-1 LOOP
> > RAISE NOTICE quote_literal(to_char(i, ''9''));
> > END LOOP;
> >
> > where arg_count = 3.
> >
> > I tried RAISE NOTICE to_char(i, ''9''); as well.
> > to_char returns text, right? Then what did I do wrong here?
>
> Syntax is a little peculiar, you need to do something like
>
> RAISE NOTICE ''hello % world %'',i,j;
>
> Nothing else will do.
>
> --
> Richard Huxton
> Archonet Ltd
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message P.J. "Josh" Rovero 2004-02-17 12:42:38 Re: Reuse of Subselects
Previous Message Martijn van Oosterhout 2004-02-17 12:22:19 Re: Reuse of Subselects