Re: SELECT INTO returns incorrect values - Mailing list pgsql-general

From Tony Caduto
Subject Re: SELECT INTO returns incorrect values
Date
Msg-id 48BEEB8C.6010309@amsoftwaredesign.com
Whole thread Raw
In response to SELECT INTO returns incorrect values  (Bill Todd <pg@dbginc.com>)
List pgsql-general
Bill,
Did you try it like this:

parent_id = 0
category_name = ''
select category, parent_category_id
      from note.category
     where category_id = 477 into category_name, parent_id;
     raise notice 'curr cat, name, parent id: % % ', category_name,
parent_id;

I have found in the past that it's a good idea to initialize your vars
before you use them in PL/pgsql.


Also as a FYI, you don't need to upper case all your text in a function
(I know you have to do that in Firebird), just use standard case with
normal capitalization because
PostgreSQL will lowercase everything you send to the server that is not
in quotes.  It's a lot easier to read without the uppercase.

Later,

Tony Caduto
AM Software Design
Home of Lightning Admin for PostgreSQL
http://www.amsoftwaredesign.com

pgsql-general by date:

Previous
From: "Ian Harding"
Date:
Subject: Re: hash partitioning
Next
From: William Garrison
Date:
Subject: Re: Simple query not using index: why?