Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 699CFB5D8C5 for ; Tue, 9 Aug 2011 04:03:19 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 21197-07 for ; Tue, 9 Aug 2011 07:03:19 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by mail.postgresql.org (Postfix) with ESMTP id ACF29B5D800 for ; Tue, 9 Aug 2011 04:03:18 -0300 (ADT) Received: from wwwmaster.postgresql.org (wwwmaster.postgresql.org [217.196.146.204]) by wwwmaster.postgresql.org (8.14.3/8.14.3) with ESMTP id p7973H7L003207 for ; Tue, 9 Aug 2011 07:03:17 GMT (envelope-from www@wwwmaster.postgresql.org) Received: (from www@localhost) by wwwmaster.postgresql.org (8.14.3/8.14.3/Submit) id p7973HDJ003206; Tue, 9 Aug 2011 07:03:17 GMT (envelope-from www) Date: Tue, 9 Aug 2011 07:03:17 GMT Message-Id: <201108090703.p7973HDJ003206@wwwmaster.postgresql.org> To: pgsql-bugs@postgresql.org Subject: BUG #6156: Function returns refcursor which not returns values it gives From: "Tejesh" Content-Type: text/plain; charset=utf-8 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 201108/78 X-Sequence-Number: 30890 The following bug has been logged online: Bug reference: 6156 Logged by: Tejesh Email address: tejesh_10sports@yahoo.co.in PostgreSQL version: 1.6.2 Operating system: Win Xp Description: Function returns refcursor which not returns values it gives Details: Thanks in advance... i am writing functions that returns refcursor. i have written many functions like that.. but someof my functions that returns so i dont get results.. plz help me... sample code as: CREATE OR REPLACE FUNCTION get_payment_details_by_receipt(p_mann_bill_no text, p_corp_id integer) RETURNS SETOF refcursor AS $BODY$declare ref1 refcursor; begin open ref1 for select 'Dehuroad Cantonment Board' as corp_name,dprop_payment_recipt_detail.property_code,dprop_payment_recipt_det ail.payment_uid,tax_payment_flag, loc_name,owner_name1, COALESCE(sum( CASE WHEN dprop_payment_recipt_detail.tax_type_id = 1 THEN dprop_payment_recipt_detail.tax_amount_paid ELSE NULL::double precision END), 0::double precision) AS dpt, COALESCE(sum( CASE WHEN dprop_payment_recipt_detail.tax_type_id = 2 THEN dprop_payment_recipt_detail.tax_amount_paid ELSE NULL::double precision END), 0::double precision) AS dsc, COALESCE(sum( CASE WHEN dprop_payment_recipt_detail.tax_type_id = 3 THEN dprop_payment_recipt_detail.tax_amount_paid ELSE NULL::double precision END), 0::double precision) AS dwt, COALESCE(sum( CASE when dprop_payment_recipt_detail.tax_type_id = 1000 THEN dprop_payment_recipt_detail.tax_amount_paid ELSE NULL::double precision END), 0::double precision) AS dto, COALESCE(sum( CASE when dprop_payment_recipt_detail.tax_type_id = 101 THEN dprop_payment_recipt_detail.tax_amount_paid ELSE NULL::double precision END), 0::double precision) AS t101, COALESCE(sum( CASE when dprop_payment_recipt_detail.tax_type_id = 102 THEN dprop_payment_recipt_detail.tax_amount_paid ELSE NULL::double precision END), 0::double precision) AS t102, COALESCE(sum( CASE when dprop_payment_recipt_detail.tax_type_id = 103 THEN dprop_payment_recipt_detail.tax_amount_paid ELSE NULL::double precision END), 0::double precision) AS t103,property_master_entry.revise_no, case when dprop_payment_recipt_master.man_bill_no='0' then dprop_payment_recipt_master.recipt_no ::character varying else dprop_payment_recipt_master.man_bill_no ::character varying end as man_bill_no, case when dprop_payment_recipt_master.man_payment_date is null then dprop_payment_recipt_master.payment_date::timestamp without time zone else dprop_payment_recipt_master.man_payment_date::timestamp without time zone end as display_date, dprop_payment_recipt_master.man_payment_date from dprop_payment_recipt_detail ,location_master,property_master_owner,dprop_payment_recipt_master,property_ master_entry where dprop_payment_recipt_master.man_bill_no ~ (p_mann_bill_no) and dprop_payment_recipt_detail.corp_councile_code=p_corp_id and dprop_payment_recipt_detail.property_code=property_master_owner.property_mas ter_id and dprop_payment_recipt_detail.location_code=location_master.loc_id and dprop_payment_recipt_detail.property_code=dprop_payment_recipt_master.proper ty_code and dprop_payment_recipt_detail.payment_uid=dprop_payment_recipt_master.payment_ uid and (property_master_entry.prop_master_id=dprop_payment_recipt_detail.property_c ode) group by dprop_payment_recipt_detail.property_code,tax_payment_flag,dprop_payment_rec ipt_detail.payment_uid,loc_name,owner_name1,dprop_payment_recipt_master.man_ bill_no, dprop_payment_recipt_master.man_payment_date,dprop_payment_recipt_master.rec ipt_no,dprop_payment_recipt_master.payment_date,property_master_entry.revise _no order by dprop_payment_recipt_detail.property_code,dprop_payment_recipt_detail.paymen t_uid; return next ref1; return; end$BODY$ LANGUAGE 'plpgsql' VOLATILE; ALTER FUNCTION get_payment_details_by_receipt(p_mann_bill_no text, p_corp_id integer) OWNER TO postgres; Thank you. Regards tejesh email id: tejesh_10sports@yahoo.co.in