如何从.NET调用Oracle表函数(流水线函数)

问题描述:

在我的.NET应用程序中,我必须调用Oracle流水线表函数. 我是否需要映射Oracle UDT(对象和表)并将表对象的参数添加到ADO.NET Command对象,还是应该使用数据读取器?

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?

我知道,当我想将表传递给Oracle过程时,必须将Oracle UDT映射到.NET类.我可以使用相同的方法来调用流水线函数吗?还是应该在ADO.NET命令中指定文本"SELECT * FROM TABLE(myFunction(...))"并为每行使用一个数据读取器?

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?

先谢谢!

最简单的方法是使用SELECT * FROM ...,但是在所有Oracle版本中都可以使用的SQL可能是这样的:

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))

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