How to call Oracle table function (pipelined function) from .NET

旧巷老猫 提交于 2019-12-21 21:19:46

问题


from my .NET application I have to invoke an Oracle pipelined table function. Do I need to map the Oracle UDTs (object and table) and to add a parameter for the table object to the ADO.NET Command object, or should I use a Data Reader?

I know that I have to map the Oracle UDTs to .NET classes when I want to pass a table to Oracle procedure. Can I use the same method to invoke a pipelined function? Or should I specify in my ADO.NET Command the Text "SELECT * FROM TABLE(myFunction(...))" and use a Data Reader for every row?

Thanx in advance!


回答1:


The easiest will be to use SELECT * FROM ..., however the SQL that would work in all versions of Oracle maybe like this:

SELECT * FROM TABLE(CAST(myFunction(...) AS functionReturnType))



来源:https://stackoverflow.com/questions/9606327/how-to-call-oracle-table-function-pipelined-function-from-net

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