Search Postgresql Archives

SELECT INTO returns incorrect values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following SELECT INTO returns incorrect values in the variables CATEGORY_NAME and PARENT_ID. If I copy the SELECT statement to pgAdmin, delete the INTO clause and run the query it returns the correct values. I am new to PostgreSQL and I must have something syntactically wrong in the SELECT but I can't see what it is. Any suggestions?

DECLARE
 PARENT_ID BIGINT;
 CATEGORY_NAME VARCHAR(40);
BEGIN
     SELECT CATEGORY, PARENT_CATEGORY_ID
     INTO CATEGORY_NAME, PARENT_ID
     FROM NOTE.CATEGORY
     WHERE CATEGORY_ID = 477;
RAISE NOTICE 'CURR CAT, NAME, PARENT ID: % % ', CATEGORY_NAME, PARENT_ID;
END;
$BODY$
 LANGUAGE 'plpgsql' VOLATILE

Thanks,

Bill


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux