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