Returned ref cursor not supported

元气小坏坏 提交于 2019-12-14 03:19:54

问题


I'm trying to make a chart in a database dashboard reporting software(Logi Info). I've got a PL SQL package that returns a ref cursor with multiple values but it seems the Logi Info does not support this and gives me an error ORA-00904: "DASHBOARD_PACKAGE"."GETSUMMARYDATA": invalid identifier. I think its either not supported or that my querty is wrong. This is my query:

select dashboard_package.getSummaryData(1,sysdate) from dual

Is that how to call a function that returns multiple values? if so, is there a solution to this problem (return type not supported)?


回答1:


This is a compilation error. Your GETSUMMARYDATA() function is referencing an invalid object name, a table, a column or whatever. If you're using dynamic SQL you won't get this compilation error until runtime.

So, you need to code through the source of your function and find the misnamed thing. The line number which goes with the error message should help you here.




回答2:


If you are using SQL*Plus, you need to use a special syntax in order to access REF CURSORS.

This is well explained in the SQL*Plus manual:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch5.htm#sthref1127

So it would be something like this in your case:

VARIABLE cv REFCURSOR
EXECUTE dashboard_package.getSummaryData(1, sysdate, :cv)
print cv

Note that the position of the :cv variable depends on the definition of your procedure.
But as you did not show us the source code...

Edit
To cover all possibilies (as mentioned by APC): If the function indeed returns a ref cursor, then the syntax is slightly different as explained in the next chapter of the manual:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch5.htm#sthref1128

VARIABLE cv REFCURSOR
execute :cv := dashboard_package.getSummaryData(1, sysdate);
print cv


来源:https://stackoverflow.com/questions/4613973/returned-ref-cursor-not-supported

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!