I
I
iloer2015-05-22 15:43:15
PostgreSQL
iloer, 2015-05-22 15:43:15

FireDac PostgreeSQL Get the result of a function that returns refCursor?

Dear professionals, please help me deal with the problem:
The PostgreSQL server itself and the function

CREATE OR REPLACE FUNCTION adqa_ref_cursors3()
  RETURNS refcursor AS
$BODY$
DECLARE 
  ref REFCURSOR;
BEGIN
  OPEN ref FOR SELECT * FROM "Customers";
  RETURN ref;
END;
$BODY$

the function itself works correctly in pgAdmin, but when I try to use it in Delphi using the adStoredProc component, I try to get the result of its execution
procedure TForm1.Button1Click(Sender: TObject);
begin
  ADStoredProc1.FetchOptions.AutoClose := False;
  ADStoredProc1.StoredProcName := 'adqa_ref_cursors3';
  ADStoredProc1.Open;
end;

As a result, I get an error with the text
'[FireDAC][Phys][PG][libpq] ERROR: cursor "unnamed portal 1" does not exist'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
arch1tect0r, 2015-05-28
@arch1tect0r

Try asking the component developers a question. It seems that their old forum is not dead yet www.da-soft.com/forums/anydac-osnovnoj-russkij.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question