Comments on: On returning a collection of user defined objects from PL/SQL to Java – shortcut using a sys_refcursor https://technology.amis.nl/2006/05/02/on-returning-a-collection-of-user-defined-objects-from-plsql-to-java-shortcut-using-a-sys_refcursor/ Friends of Oracle and Java Wed, 24 Jun 2015 09:59:44 +0000 hourly 1 http://wordpress.org/?v=4.2.2 By: Jon https://technology.amis.nl/2006/05/02/on-returning-a-collection-of-user-defined-objects-from-plsql-to-java-shortcut-using-a-sys_refcursor/#comment-3201 Sat, 15 Dec 2007 13:37:00 +0000 http://technology.amis.nl/blog/?p=1176#comment-3201 Hi

This might be a little off the subject but having worked with
pl/sql and ref cursors ( of which I am really hoping will be
obsolete in the future ) I can recommend this article

http://www.oracle-base.com/articles/8i/ComplexRecordsets.php#PLSQLTables

for working with in memory pl/sql types and refcursors

]]>
By: Scott Pedigo https://technology.amis.nl/2006/05/02/on-returning-a-collection-of-user-defined-objects-from-plsql-to-java-shortcut-using-a-sys_refcursor/#comment-3200 Wed, 28 Feb 2007 11:43:17 +0000 http://technology.amis.nl/blog/?p=1176#comment-3200 http://technology.amis.nl/blog/?p=1176

create or replace
function get_rss_items
return sys_refcursor
as

l_cursor sys_refcursor;
begin
open l_cursor
for select *
from table( get_rss_items_tbl )
;
return l_cursor;
end;

Did you actually test this? I tried to do exactly what you propose in PL/SQL and the Oracle compiler gives me the error messagses:
PLS-00231 function ‘xxx’ may not be used in SQL

]]>
By: Sukanya Subramanian https://technology.amis.nl/2006/05/02/on-returning-a-collection-of-user-defined-objects-from-plsql-to-java-shortcut-using-a-sys_refcursor/#comment-3199 Wed, 05 Jul 2006 14:43:07 +0000 http://technology.amis.nl/blog/?p=1176#comment-3199 How do i manage if the Type has types inside ?
For eg –

CREATE OR REPLACE TYPE sample_type_internal AS OBJECT(
phoneNumber number
);

CREATE OR REPLACE TYPE list_sample_type_internal IS TABLE OF sample_type_internal;

CREATE OR REPLACE TYPE sample_type AS OBJECT(
name VARCHAR2(20),
listPhoneNumbers list_sample_type_internal
);

]]>