sql server 存储过程转换成 oracle
CREATEprocedurejsmxq@gongsiint,-----参数公司@periodvarchar(30)-----参数期间asdeclare@cunhuobi...
CREATE procedure jsmxq
@gongsi int, -----参数公司
@period varchar(30) -----参数期间
as
declare @cunhuobianma int,@scl decimal(16,2)
declare loop_cursor cursor for
select cunhuobianma,scl
from scl
where gongsi=@gongsi and month=@period
begin
open loop_cursor
fetch next from loop_cursor
into @cunhuobianma, @scl
delete from mxql where gongsi=@gongsi and month=@period
while @@FETCH_STATUS = 0
begin
IF EXISTS (select * from scm_chanpinjiegouhead a where gongsi=@gongsi and chanchengpin=@cunhuobianma )
begin 展开
@gongsi int, -----参数公司
@period varchar(30) -----参数期间
as
declare @cunhuobianma int,@scl decimal(16,2)
declare loop_cursor cursor for
select cunhuobianma,scl
from scl
where gongsi=@gongsi and month=@period
begin
open loop_cursor
fetch next from loop_cursor
into @cunhuobianma, @scl
delete from mxql where gongsi=@gongsi and month=@period
while @@FETCH_STATUS = 0
begin
IF EXISTS (select * from scm_chanpinjiegouhead a where gongsi=@gongsi and chanchengpin=@cunhuobianma )
begin 展开
展开全部
-- 这个之所以修改参数的名字的原因是你的参数与表中的列重名了
CREATE or Replace procedure jsmxq(Pgongsi int, Pperiod varchar(30)) as
declare
cunhuobianma int;
scl number(16,2);
begin
for cur in (select cunhuobianma, scl
from scl
where gongsi = pgongsi
and month = pperiod) loop
delete from mxql where gongsi = pgongsi and month= pperiod;
if sql%notfound then
begin
-- 你没有写全的语句
end;
end if;
end loop;
end;
CREATE or Replace procedure jsmxq(Pgongsi int, Pperiod varchar(30)) as
declare
cunhuobianma int;
scl number(16,2);
begin
for cur in (select cunhuobianma, scl
from scl
where gongsi = pgongsi
and month = pperiod) loop
delete from mxql where gongsi = pgongsi and month= pperiod;
if sql%notfound then
begin
-- 你没有写全的语句
end;
end if;
end loop;
end;
今至电子科技有限公司
2024-08-23 广告
2024-08-23 广告
数据库备份是确保数据安全与业务连续性的关键环节。我们上海今至电子科技有限公司高度重视数据保护,定期执行全面的数据库备份策略。这包括使用先进工具和技术,对关键业务数据进行自动化备份,并存储在安全可靠的外部存储介质或云端。通过定期验证备份的完整...
点击进入详情页
本回答由今至电子科技有限公司提供
展开全部
CREATE OR REPLACE procedure jsmxq
gongsi NUMBER, -----参数公司
period varchar2(30) -----参数期间
as
BEGIN
declare
cunhuobianma NUMBER,
scl decimal(16,2)
declare loop_cursor cursor for
select cunhuobianma,scl
from scl
where gongsi:=gongsi
and month:=period
begin
open loop_cursor
fetch next from loop_cursor
into cunhuobianma, scl
delete from mxql where gongsi:=gongsi and month=:period
while @@FETCH_STATUS = 0
begin
IF EXISTS (select * from scm_chanpinjiegouhead a where gongsi=@gongsi and chanchengpin=@cunhuobianma )
begin
gongsi NUMBER, -----参数公司
period varchar2(30) -----参数期间
as
BEGIN
declare
cunhuobianma NUMBER,
scl decimal(16,2)
declare loop_cursor cursor for
select cunhuobianma,scl
from scl
where gongsi:=gongsi
and month:=period
begin
open loop_cursor
fetch next from loop_cursor
into cunhuobianma, scl
delete from mxql where gongsi:=gongsi and month=:period
while @@FETCH_STATUS = 0
begin
IF EXISTS (select * from scm_chanpinjiegouhead a where gongsi=@gongsi and chanchengpin=@cunhuobianma )
begin
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询