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

推荐订阅源

人人都是产品经理
人人都是产品经理
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
B
Blog
D
Docker
C
Check Point Blog
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
MongoDB | Blog
MongoDB | Blog
WordPress大学
WordPress大学
Jina AI
Jina AI
罗磊的独立博客
月光博客
月光博客
博客园 - Franky
L
LangChain Blog
H
Help Net Security
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
小众软件
小众软件
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

博客园 - 老狐狸

关于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;