项目实例 声明包 创建存储过程,调用
2015-03-31 14:43
316 查看
--声明包 create or replace package pkg_region_to_region as type type_cursor is ref cursor; procedure read_rows (header varchar2, result out type_cursor); end pkg_region_to_region; --创建存储过程 create or replace package body pkg_region_to_region as procedure read_rows(header varchar2, result out type_cursor) is sqlText varchar2(5000); begin open result for select * from ( select count(*), br2.name, br2.code,header startcode from (select * from (select R.name startname, R.code startcode, B.stationid startstationid from Region R left join BASECELLSTATION B on B.region = R.code) br left join (select t.*, t.DESTINATIONSTATION stationid from TRIPINFO t) TR on tr.stationid = br.startstationid where startcode = header order by startcode) TT1 left join (select R.name name, R.code code, B.stationid stationid from Region R left join BASECELLSTATION B on B.region = R.code) br2 on br2.stationid = TT1.ORIGINSTATION GROUP by br2.code, br2.name order by br2.code); --dbms_output.put_line(sqlText); --sqlText; end read_rows; end pkg_region_to_region; --调用存储过程 var result refcursor exec pkg_region_to_region.read_rows('1',:result); print result
相关文章推荐
- 创建存储过程并用java调用实例
- Oracle创建表语句(Create table)语法详解及示例、、 C# 调用Oracle 存储过程返回数据集 实例
- 存储过程学习三(创建存储过程实例)
- 存储过程从入门到熟练(多个存储过程完整实例及调用方法)
- 存储过程从入门到熟练(多个存储过程完整实例及调用方法)_AX
- 在ASP.NETAtlas中调用WebService—创建Mashup调用远端WebService(Yahoo!天气实例)
- MySQL创建存储过程实例
- 在ASP.NET Atlas中调用Web Service——创建Mashup调用远端Web Service(Yahoo!天气实例)
- [Database]创建存储过程并在ASP.NET中的调用带参数的存储过程与及调用带参数的SQL语句对比
- 写一个sql中视图和存储过程的简单创建和调用方法!!!自我备忘用····
- 存储过程从入门到熟练(多个存储过程完整实例及调用方法)
- MySQL5创建存储过程实例,指南
- Servlet调用SQL Server2000存储过程实例
- 存储过程从入门到熟练(多个存储过程完整实例及调用方法)[转]
- 利用反射来动态创建实例和调用方法
- 写一个sql中视图和存储过程的简单创建和调用方法!!!自我备忘用····
- 存储过程从入门到熟练(多个存储过程完整实例及调用方法)_AX
- 存储过程从入门到熟练(多个存储过程完整实例及调用方法)
- 存储过程实例与调用方法
- SQL2005 XML Soap端点创建及.net调用实例