From: Ivan B. <iv...@cv...> - 2010-11-19 19:46:12
|
On 11/19/2010 03:27 PM, Rémy Guillemette wrote: >> What is the datatype returned by your function? >> >> Can you send its declaration? >> >> Ivan >> > Sorry for my late response. I change my email. I was not receiveing > any response... > > The return type of my function is : sys_refcursor. > > I cannot post here the function but you can try a function like this one: > > CREATE OR REPLACE PACKAGE myshema.worktest_pck AS > function getTestValue(in_zo varchar2) return sys_refcursor; > END worktest_pck; > / > CREATE OR REPLACE PACKAGE BODY myshema.worktest_pck AS > > function getTestValue(in_zo varchar2) > return sys_refcursor > is > lv_cur sys_refcursor; > begin > open lv_cur for > select trunc(sysdate) as logdate from dual; > return lv_cur; > end; > > END worktest_pck; > / > > --------------------------------------------------------------------------- > Testcase: > select worktest_pck.getTestValue('hello') from dual; > > > I've to disapoint you, this feature is not supported(yet). The datatype sys_refcursor represents a table itself and fetching fields of datatype cursor are not supported neither by OTL nor trotl connection provider. As far as I know it does not work even in toad nor in SQLDeveloper. It only works in sqlplus. Ivan |