Reuse of REF Cursor

From: "Abraham, Danny" <danny_abraham(at)bmc(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Cc: "Abraham, Danny" <danny_abraham(at)bmc(dot)com>
Subject: Reuse of REF Cursor
Date: 2021-04-11 15:03:00
Message-ID: PH0PR02MB74461F234A7AD20FA8FB70588E719@PH0PR02MB7446.namprd02.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Has anybody faced a problem with reusing a ref cursor?

C1 refcursor;
....
stmt := 'select1 ' ;
open C1 for execute stmt;
fetch C1 into rc1;
close C1;

stmt := 'select2 ...' ;
open C1 for execute stmt;
fetch C1 into rc2;
close C1;

???

I am getting inconsistent errors: IDTCONTEXT: PL/pgSQL function ...... ) line 42 at FETCH

PG Version 9.5.5 on Linux.

Thanks

Danny

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Vincent Veyron 2021-04-11 15:03:41 Re: Who altered the database?
Previous Message Ron 2021-04-11 14:52:18 Re: The Amazon CloudFront distribution is configured to block access from your country.