Home  >  Article  >  Database  >  Oracle procedure返回数据集小结

Oracle procedure返回数据集小结

WBOY
WBOYOriginal
2016-06-07 17:00:301209browse

要从Oracle Procedure获得数据集合,通常采用Ref Cursor的方式,要获得此Cursor,有以下几种方式:1.动态Sql返回:这种情况下,Pr

要从Oracle Procedure获得数据集合,通常采用Ref Cursor的方式,要获得此Cursor,有以下几种方式:

1.动态Sql返回:

这种情况下,Procedure的运算通常比较简单,比如根据参数组合sql或者多个Table的Join操作,但都可以通过一个sql语句完成查询。

2.如果Procedure逻辑运算比较复杂,,没办法在一个Sql中完成。通常运算过程中需要临时存储中间运算数据等等。
这种情况下,可以采取的方式:
1)使用嵌套表动态产生数据集,并运用Table()函数返回数据集。此种方式需要在DB中创建Object,并要创建嵌套表,
本地作用域中定义的Type不能被识别。
创建Object.

创建嵌套表,类型为上面创建的Object stockPallet_type

  • linux

  • Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn