cursor return null

From: Ramesh T <rameshparnanditech(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Hubert Lubaczewski <depesz(at)gmail(dot)com>
Subject: cursor return null
Date: 2014-07-21 14:13:10
Message-ID: CAK8Zd=v+H6m0p39H8YS5ePXnPwHY-VPwMiz3fSKz4LPCoOfinA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,
in postgres function (id bigint ),the following code not return
any value with artNums ,But when i do select statement ony it's output the
values with out include cursor

i.e,cursor problem ..?

please let me know what should i do to getvalues from cursor, but i dont
where i missing

function (id bigint )

DECLARE
PartNums varchar (10000);
artNums CURSOR for
SELECT p.PART_NUM part_num
FROM lineitem sol, part p
WHERE sol.ORDER_ID = id AND p.PART_ID = sol.PART_ID;

BEGIN
FOR cPart IN artNums LOOP
BEGIN
PartNums := PartNums || cPart.part_num || ', ';
END;

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2014-07-21 14:17:58 Re: check database integrity
Previous Message Rebecca Clarke 2014-07-21 13:22:43 Re: Track changes to function code