将存储过程放到包里(跟同事学的)
来源:互联网 发布:东华理工行知分院照片 编辑:程序博客网 时间:2024/05/16 05:19
create or replace package PK_NET_MELT as
type cur is ref cursor;
procedure PRO_PMS_NET_MELT(t_cur_sor_ss out cur,stat out NUMBER);
procedure PRO_PMS_NET_MELT_NEW;
end PK_NET_MELT;
create or replace package body PK_NET_MELT AS
procedure PRO_PMS_NET_MELT(t_cur_sor_ss out cur,stat out NUMBER)
is
cursor cur_sors is select pcc.id id,pcc.teller_code teller,p.status address_status,pcc.status salesman_status,em.empno ids_salesman_code,
(case when em.status='1' then '0' else '1' end)ids_salesman_status,
ex.orgstatus ids_address_status from t_partner_core_config pcc
join t_partner p on pcc.teller_code=p.teller
join empno em on em.empno=pcc.partner_code
join extorg ex on pcc.teller_code=ex.orgcode;
v_rowdata cur_sors%rowtype;--使用游标里的字段类型
t_count int;
begin
open cur_sors;
loop
fetch cur_sors into v_rowdata;--将游标
exit when cur_sors%notfound;
update t_partner_core_config set
address_status=v_rowdata.address_status,
ids_salesman_code=v_rowdata.ids_salesman_code,
ids_salesman_status=v_rowdata.ids_salesman_status,
ids_address_status=v_rowdata.ids_address_status
where teller_code=v_rowdata.teller and t_partner_core_config.id=v_rowdata.id;
dbms_output.put_line('sss');
end loop;
select count(*) into t_count from t_partner_core_config where address_status<>ids_address_status or status<>ids_salesman_status;
if t_count>0
create or replace package PK_NET_MELT as
type cur is ref cursor;
procedure PRO_PMS_NET_MELT(t_cur_sor_ss out cur,stat out NUMBER);
procedure PRO_PMS_NET_MELT_NEW;
end PK_NET_MELT;
create or replace package body PK_NET_MELT AS
procedure PRO_PMS_NET_MELT(t_cur_sor_ss out cur,stat out NUMBER)
is
cursor cur_sors is select pcc.id id,pcc.teller_code teller,p.status address_status,pcc.status salesman_status,em.empno ids_salesman_code,
(case when em.status='1' then '0' else '1' end)ids_salesman_status,
ex.orgstatus ids_address_status from t_partner_core_config pcc
join t_partner p on pcc.teller_code=p.teller
join empno em on em.empno=pcc.partner_code
join extorg ex on pcc.teller_code=ex.orgcode;
v_rowdata cur_sors%rowtype;
t_count int;
begin
open cur_sors;
loop
fetch cur_sors into v_rowdata;--将游标
exit when cur_sors%notfound;
update t_partner_core_config set
address_status=v_rowdata.address_status,
ids_salesman_code=v_rowdata.ids_salesman_code,
ids_salesman_status=v_rowdata.ids_salesman_status,
ids_address_status=v_rowdata.ids_address_status
where teller_code=v_rowdata.teller and t_partner_core_config.id=v_rowdata.id;
dbms_output.put_line('sss');
end loop;
select count(*) into t_count from t_partner_core_config where address_status<>ids_address_status or status<>ids_salesman_status;
if t_count>0
then open t_cur_sor_ss for select id,teller_code,status,ids_salesman_code,ids_address_status,address_status,ids_salesman_status fromt_partner_core_config where address_status<>ids_address_status or status<>ids_salesman_status;
stat:=1;
end if;
if t_count=0 then
stat:=2;
end if;
end PRO_PMS_NET_MELT;
procedure PRO_PMS_NET_MELT_NEW
is
type v_record is record(
id t_partner_core_config.id%type,
teller t_partner_core_config.teller_code%type,
status t_partner_core_config.status%type,
ids_salesman_code t_partner_core_config.ids_salesman_code%type,
ids_address_status t_partner_core_config.ids_address_status%type,
address_status t_partner_core_config.address_status%type,
ids_salesman_status t_partner_core_config.ids_salesman_status%type
);
v_rowdata v_record;
t_cur_sor_s cur;
begin
end PRO_PMS_NET_MELT_NEW;
END PK_NET_MELT;
teller_code,status,ids_salesman_code,ids_address_status,address_status,ids_salesman_status from t_partner_core_config where address_status<>ids_address_status or status<>ids_salesman_status;
stat:=1;
end if;
if t_count=0 then
stat:=2;
end if;
end PRO_PMS_NET_MELT;
procedure PRO_PMS_NET_MELT_NEW
is
type v_record is record(
id t_partner_core_config.id%type,
teller t_partner_core_config.teller_code%type,
status t_partner_core_config.status%type,
ids_salesman_code t_partner_core_config.ids_salesman_code%type,
ids_address_status t_partner_core_config.ids_address_status%type,
address_status t_partner_core_config.address_status%type,
ids_salesman_status t_partner_core_config.ids_salesman_status%type
);
v_rowdata v_record;
t_cur_sor_s cur;
begin
end PRO_PMS_NET_MELT_NEW;
END PK_NET_MELT;
type cur is ref cursor;
procedure PRO_PMS_NET_MELT(t_cur_sor_ss out cur,stat out NUMBER);
procedure PRO_PMS_NET_MELT_NEW;
end PK_NET_MELT;
create or replace package body PK_NET_MELT AS
procedure PRO_PMS_NET_MELT(t_cur_sor_ss out cur,stat out NUMBER)
is
cursor cur_sors is select pcc.id id,pcc.teller_code teller,p.status address_status,pcc.status salesman_status,em.empno ids_salesman_code,
(case when em.status='1' then '0' else '1' end)ids_salesman_status,
ex.orgstatus ids_address_status from t_partner_core_config pcc
join t_partner p on pcc.teller_code=p.teller
join empno em on em.empno=pcc.partner_code
join extorg ex on pcc.teller_code=ex.orgcode;
v_rowdata cur_sors%rowtype;--使用游标里的字段类型
t_count int;
begin
open cur_sors;
loop
fetch cur_sors into v_rowdata;--将游标
exit when cur_sors%notfound;
update t_partner_core_config set
address_status=v_rowdata.address_status,
ids_salesman_code=v_rowdata.ids_salesman_code,
ids_salesman_status=v_rowdata.ids_salesman_status,
ids_address_status=v_rowdata.ids_address_status
where teller_code=v_rowdata.teller and t_partner_core_config.id=v_rowdata.id;
dbms_output.put_line('sss');
end loop;
select count(*) into t_count from t_partner_core_config where address_status<>ids_address_status or status<>ids_salesman_status;
if t_count>0
create or replace package PK_NET_MELT as
type cur is ref cursor;
procedure PRO_PMS_NET_MELT(t_cur_sor_ss out cur,stat out NUMBER);
procedure PRO_PMS_NET_MELT_NEW;
end PK_NET_MELT;
create or replace package body PK_NET_MELT AS
procedure PRO_PMS_NET_MELT(t_cur_sor_ss out cur,stat out NUMBER)
is
cursor cur_sors is select pcc.id id,pcc.teller_code teller,p.status address_status,pcc.status salesman_status,em.empno ids_salesman_code,
(case when em.status='1' then '0' else '1' end)ids_salesman_status,
ex.orgstatus ids_address_status from t_partner_core_config pcc
join t_partner p on pcc.teller_code=p.teller
join empno em on em.empno=pcc.partner_code
join extorg ex on pcc.teller_code=ex.orgcode;
v_rowdata cur_sors%rowtype;
t_count int;
begin
open cur_sors;
loop
fetch cur_sors into v_rowdata;--将游标
exit when cur_sors%notfound;
update t_partner_core_config set
address_status=v_rowdata.address_status,
ids_salesman_code=v_rowdata.ids_salesman_code,
ids_salesman_status=v_rowdata.ids_salesman_status,
ids_address_status=v_rowdata.ids_address_status
where teller_code=v_rowdata.teller and t_partner_core_config.id=v_rowdata.id;
dbms_output.put_line('sss');
end loop;
select count(*) into t_count from t_partner_core_config where address_status<>ids_address_status or status<>ids_salesman_status;
if t_count>0
then open t_cur_sor_ss for select id,teller_code,status,ids_salesman_code,ids_address_status,address_status,ids_salesman_status fromt_partner_core_config where address_status<>ids_address_status or status<>ids_salesman_status;
stat:=1;
end if;
if t_count=0 then
stat:=2;
end if;
end PRO_PMS_NET_MELT;
procedure PRO_PMS_NET_MELT_NEW
is
type v_record is record(
id t_partner_core_config.id%type,
teller t_partner_core_config.teller_code%type,
status t_partner_core_config.status%type,
ids_salesman_code t_partner_core_config.ids_salesman_code%type,
ids_address_status t_partner_core_config.ids_address_status%type,
address_status t_partner_core_config.address_status%type,
ids_salesman_status t_partner_core_config.ids_salesman_status%type
);
v_rowdata v_record;
t_cur_sor_s cur;
begin
end PRO_PMS_NET_MELT_NEW;
END PK_NET_MELT;
teller_code,status,ids_salesman_code,ids_address_status,address_status,ids_salesman_status from t_partner_core_config where address_status<>ids_address_status or status<>ids_salesman_status;
stat:=1;
end if;
if t_count=0 then
stat:=2;
end if;
end PRO_PMS_NET_MELT;
procedure PRO_PMS_NET_MELT_NEW
is
type v_record is record(
id t_partner_core_config.id%type,
teller t_partner_core_config.teller_code%type,
status t_partner_core_config.status%type,
ids_salesman_code t_partner_core_config.ids_salesman_code%type,
ids_address_status t_partner_core_config.ids_address_status%type,
address_status t_partner_core_config.address_status%type,
ids_salesman_status t_partner_core_config.ids_salesman_status%type
);
v_rowdata v_record;
t_cur_sor_s cur;
begin
end PRO_PMS_NET_MELT_NEW;
END PK_NET_MELT;
0 0
- 将存储过程放到包里(跟同事学的)
- 第一个存储过程的例子(跟同事学的)
- 跟我学MySQL存储过程
- 跟我学MySQL存储过程
- 跟我学MySQL存储过程
- 跟我学MySQL存储过程
- 跟我学MySQL存储过程
- 跟我学MySQL存储过程
- 【转】跟我学MySQL存储过程
- 将存储过程里的数据 插入临时表
- 存储过程跟存储函数的区别
- 将两个不同的文档放到两个屏幕里
- 如何将xtype: 'selectfield‘放到var定义的对象里
- 怎么将CDR里的图片放到表格中
- 将大图片完整的放到小div里
- 存储过程A里,将存储过程B的结果集存到A的临时表或者表变量里
- 公司一同事写的存储过程 带游标
- 将js代码放到<head>标签和放到<body>标签里的区别
- 为什么会出现“负库存”、“负毛利”?
- Scripts:根据sql_id和hash_value查询AWR中的执行计划dplan_awr.sql
- 第十四周(例题)——课本例题熟悉。
- Applet 的运行控制及生命周期的实现
- CSS3 选择器 基本选择器介绍
- 将存储过程放到包里(跟同事学的)
- linu下启动was的命令
- 获取时间
- 模块化机器人问世 能连接组装成桌椅床等家具
- 别让“互联网思维”沦为东施效颦的笑话
- 最简单的搭建android开发平台的方法
- 详解css 定位与定位应用
- Scripts:数据库升级诊断脚本dbupgdiag.sql
- 专访罗永浩 锤子手机为精英服务屌丝走开 成为下一个苹果