using pipelined function with TOraQuery
Posted: Thu 02 Dec 2004 20:18
Hello,
a pipelined function belongs to a package. The necessary types are declared gobally for the schema.
FUNCTION GET_ZP_STANZLISTE(dtStart IN DATE, dtEnde IN DATE)
RETURN ttblZPSTANZLISTE PIPELINED;
In SQL*Plus I can do:
SELECT *
FROM TABLE(CAST(PKG_STANZLISTEN.GET_ZP_STANZLISTE(to_date('01.01.2005', 'dd.mm.yyyy'), to_date('31.12.2005', 'dd.mm.yyyy')) AS ttblZPSTANZLISTE));
This query returns the expected rows and I can treat it like any other query against a table.
But how can I use the pipelined function inside a TOraQuery with parameters?
I tried:
begin
:RESULT := claudio_admin.PKG_STANZLISTEN.GET_ZP_STANZLISTE(:DTSTART, :DTENDE);
end;
This code was created by the Stored Procedure Call Generator. After setting :DTSTART and :DTENDE and trying to open the query I get the error message "Type of object must be defined".
Thanks for your help,
Thomas
a pipelined function belongs to a package. The necessary types are declared gobally for the schema.
FUNCTION GET_ZP_STANZLISTE(dtStart IN DATE, dtEnde IN DATE)
RETURN ttblZPSTANZLISTE PIPELINED;
In SQL*Plus I can do:
SELECT *
FROM TABLE(CAST(PKG_STANZLISTEN.GET_ZP_STANZLISTE(to_date('01.01.2005', 'dd.mm.yyyy'), to_date('31.12.2005', 'dd.mm.yyyy')) AS ttblZPSTANZLISTE));
This query returns the expected rows and I can treat it like any other query against a table.
But how can I use the pipelined function inside a TOraQuery with parameters?
I tried:
begin
:RESULT := claudio_admin.PKG_STANZLISTEN.GET_ZP_STANZLISTE(:DTSTART, :DTENDE);
end;
This code was created by the Stored Procedure Call Generator. After setting :DTSTART and :DTENDE and trying to open the query I get the error message "Type of object must be defined".
Thanks for your help,
Thomas