惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
aimingoo的专栏
aimingoo的专栏
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
J
Java Code Geeks
G
Google Developers Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
罗磊的独立博客
GbyAI
GbyAI
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 老狐狸

关于Update语句在不同数据库中的差别 出错存储过程 F_GETTABLELID 正则表达式求值 - 老狐狸 - 博客园 创建层次查询 ultrawebgrid - 老狐狸 - 博客园 javascript - 老狐狸 - 博客园 case when用法和and 后加条件 exp/imp导出导入工具的使用 ASP.NET1.1中Grid自定义眉头 asp.net1.0 TreeView asp.net2.0 TreeView 创建记录、数组 关闭远程数据库连接 创建游标 创建新的序列 创建隐式游标 创建临时表 更新表(多表相关联)
老狐狸 · 2006-06-23 · via 博客园 - 老狐狸

包头:

create or replace package GetMonthPlan is

  TYPE T_MonthPlan 
IS REF CURSOR;
  
Procedure p_GetMonthStockPlan(sYear       in varchar,
                                sMonth      
in varchar,
                                t_ReturnCur out T_MonthPlan 
--返回的游标
                                );
  
Procedure p_GetMonthPlan(sYear       in varchar,
                                sMonth      
in varchar,
                                t_ReturnCur out T_MonthPlan 
--返回的游标
                                );
end GetMonthPlan;

包体:

create or replace package body GetMonthPlan is
  
Procedure p_GetMonthStockPlan(sYear       in varchar,
                                sMonth      
in varchar,
                                t_ReturnCur out T_MonthPlan) 
is
  
begin
    ImportMonthForestProduct(sYear, sMonth);
    
open t_ReturnCur for
      
select t.estimateyear,
             t.
month,
             t.forestquantity,
             t.fixquantity,
             g.productname,
             g.productCode,
             t.productid
        
from f_monthstockplan t, g_me_productinfo g
       
where t.productid = g.productid
         
and t.estimateyear = sYear
         
and t.month = sMonth
         
order by g.productCode;
  
end p_GetMonthStockPlan;
   
Procedure p_GetMonthPlan(sYear       in varchar,
                                sMonth      
in varchar,
                                t_ReturnCur out T_MonthPlan) 
is
  
begin
    ImportMonthStockProduct(sYear, sMonth);
    
open t_ReturnCur for
      
select t.estimateyear,
             t.
month,
             t.forestquantity,
             t.fixquantity,
             g.productname,
             g.productCode,
             t.productid
        
from f_monthplan t, g_me_productinfo g
       
where t.productid = g.productid
         
and t.estimateyear = sYear
         
and t.month = sMonth
         
order by g.productCode;
  
end p_GetMonthPlan;
end GetMonthPlan;