El día 29 de agosto de 2011 16:12, Pavel Stehule
escribió:
> 2011/8/29 Martín Marqués :
>>>
>>> refcursors can be dynamic defined
>>
>> OK, I'm totally lost. How do you define a dynamic cursor? Couldn't
>> find anything in the manuals.
>>
>
> DECLARE
> curs1 refcursor;
> BEGIN
> OPEN curs1 FOR
2011/8/29 Martín Marqués :
> El día 29 de agosto de 2011 15:52, Pavel Stehule
> escribió:
>> 2011/8/29 Martín Marqués :
>>> El día 29 de agosto de 2011 15:28, Pavel Stehule
>>> escribió:
2011/8/29 Martín Marqués :
> Actually, what we are trying to do is return 2 recordsets with the
>
El día 29 de agosto de 2011 15:52, Pavel Stehule
escribió:
> 2011/8/29 Martín Marqués :
>> El día 29 de agosto de 2011 15:28, Pavel Stehule
>> escribió:
>>> 2011/8/29 Martín Marqués :
Actually, what we are trying to do is return 2 recordsets with the
same function call (simulate SP from
2011/8/29 Martín Marqués :
> El día 29 de agosto de 2011 15:28, Pavel Stehule
> escribió:
>> 2011/8/29 Martín Marqués :
>>> Actually, what we are trying to do is return 2 recordsets with the
>>> same function call (simulate SP from SQL Server returning 2
>>> recordsets).
>>>
>>> I found out that I
El día 29 de agosto de 2011 15:28, Pavel Stehule
escribió:
> 2011/8/29 Martín Marqués :
>> Actually, what we are trying to do is return 2 recordsets with the
>> same function call (simulate SP from SQL Server returning 2
>> recordsets).
>>
>> I found out that I had to do PERFORM * FROM construyecu
2011/8/29 Martín Marqués :
> Actually, what we are trying to do is return 2 recordsets with the
> same function call (simulate SP from SQL Server returning 2
> recordsets).
>
> I found out that I had to do PERFORM * FROM construyecursordesdequery($1,
> query)
> which works now, but can't run 2 dif
Actually, what we are trying to do is return 2 recordsets with the
same function call (simulate SP from SQL Server returning 2
recordsets).
I found out that I had to do PERFORM * FROM construyecursordesdequery($1, query)
which works now, but can't run 2 different queries on the same cursor.
I was
El día 26 de agosto de 2011 09:15, Merlin Moncure escribió:
> 2011/8/26 Martín Marqués :
>> El día 26 de agosto de 2011 00:04, Merlin Moncure
>> escribió:
>>> 2011/8/25 Martín Marqués :
CREATE OR REPLACE FUNCTION prueba_cursor(codigo integer, curCursor
refcursor)
RETURNS SETOF
2011/8/26 Martín Marqués :
> El día 26 de agosto de 2011 00:04, Merlin Moncure
> escribió:
>> 2011/8/25 Martín Marqués :
>>> CREATE OR REPLACE FUNCTION prueba_cursor(codigo integer, curCursor
>>> refcursor)
>>> RETURNS SETOF refcursor AS
>>> $BODY$
>>> DECLARE
>>> cur alias for $2;
>>> B
El día 26 de agosto de 2011 00:04, Merlin Moncure escribió:
> 2011/8/25 Martín Marqués :
>> CREATE OR REPLACE FUNCTION prueba_cursor(codigo integer, curCursor refcursor)
>> RETURNS SETOF refcursor AS
>> $BODY$
>> DECLARE
>> cur alias for $2;
>> BEGIN
>> PERFORM mpf.ConstruyeCursorDes
2011/8/25 Martín Marqués :
> CREATE OR REPLACE FUNCTION prueba_cursor(codigo integer, curCursor refcursor)
> RETURNS SETOF refcursor AS
> $BODY$
> DECLARE
> cur alias for $2;
> BEGIN
> PERFORM mpf.ConstruyeCursorDesdeQuery('cur' ,'SELECT * from
> tab1 WHERE field < 11000');
> END;
> $
Sorry, pressed send. :-(
I have, as the functions show below, 2 functions that call one
another, passing a cursor (AFAIK). The problem is that it doesn't
work, giving errors when executing the last SELECT.
Is it posible to pass a cursor from one function to another?
El día 25 de agosto de 2011 2
CREATE OR REPLACE FUNCTION prueba_cursor(codigo integer, curCursor refcursor)
RETURNS SETOF refcursor AS
$BODY$
DECLARE
cur alias for $2;
BEGIN
PERFORM mpf.ConstruyeCursorDesdeQuery('cur' ,'SELECT * from
tab1 WHERE field < 11000');
END;
$BODY$
LANGUAGE 'plpgsql' VOLATILE
COST 100
R
13 matches
Mail list logo