在oracle存储过程时,出现错误:pls-00103:出现符号"insert"在需要下列之一时
createorreplaceprocedurebomCopy(oldIdvarchar2,newIdvarchar2,uservarchar2,companyvarch...
create or replace procedure bomCopy
(
oldId varchar2,
newId varchar2,
user varchar2,
company varchar2
)
as
INSERT cc_record_bom SELECT SYS_GUID(),item, item_class, item_d,item_d_class,net_qty,waste_qty,
total_qty,bom_ver,start_date,end_date,newId,remark,user,sysdate,
user,sysdate,company FROM cc_record_bom where CODE=oldId;
INSERT cc_stand_bom
select SYS_GUID(),item,item_d,net_qty,waste_qty,total_qty,bom_ver,start_date,end_date
,newId,remark,user,sysdate,user,sysdate,company,item_class,item_d_class
from cc_stand_bom where code=oldId;
INSERT cc_wo_bom select item,item_d,net_qty,waste_qty ,total_qty,bom_ver,start_date,end_date,newId,remark
,user,sysdate,user ,sysdate ,company ,item_class,item_d_class
from cc_wo_bom where code=oldId;
end bomCopy;
这是我的存储过程,请高手帮忙解决下。。 展开
(
oldId varchar2,
newId varchar2,
user varchar2,
company varchar2
)
as
INSERT cc_record_bom SELECT SYS_GUID(),item, item_class, item_d,item_d_class,net_qty,waste_qty,
total_qty,bom_ver,start_date,end_date,newId,remark,user,sysdate,
user,sysdate,company FROM cc_record_bom where CODE=oldId;
INSERT cc_stand_bom
select SYS_GUID(),item,item_d,net_qty,waste_qty,total_qty,bom_ver,start_date,end_date
,newId,remark,user,sysdate,user,sysdate,company,item_class,item_d_class
from cc_stand_bom where code=oldId;
INSERT cc_wo_bom select item,item_d,net_qty,waste_qty ,total_qty,bom_ver,start_date,end_date,newId,remark
,user,sysdate,user ,sysdate ,company ,item_class,item_d_class
from cc_wo_bom where code=oldId;
end bomCopy;
这是我的存储过程,请高手帮忙解决下。。 展开
5个回答
展开全部
as 后要写begin
CREATE OR REPLACE PROCEDURE Bomcopy(Oldid VARCHAR2,
Newid VARCHAR2,
USER VARCHAR2,
Company VARCHAR2) AS
begin
INSERT Cc_Record_Bom
SELECT Sys_Guid(),
Item,
Item_Class,
Item_d,
Item_d_Class,
Net_Qty,
Waste_Qty,
Total_Qty,
Bom_Ver,
Start_Date,
End_Date,
Newid,
Remark,
USER,
SYSDATE,
USER,
SYSDATE,
Company
FROM Cc_Record_Bom
WHERE Code = Oldid;
INSERT Cc_Stand_Bom
SELECT Sys_Guid(),
Item,
Item_d,
Net_Qty,
Waste_Qty,
Total_Qty,
Bom_Ver,
Start_Date,
End_Date,
Newid,
Remark,
USER,
SYSDATE,
USER,
SYSDATE,
Company,
Item_Class,
Item_d_Class
FROM Cc_Stand_Bom
WHERE Code = Oldid;
INSERT Cc_Wo_Bom
SELECT Item,
Item_d,
Net_Qty,
Waste_Qty,
Total_Qty,
Bom_Ver,
Start_Date,
End_Date,
Newid,
Remark,
USER,
SYSDATE,
USER,
SYSDATE,
Company,
Item_Class,
Item_d_Class
FROM Cc_Wo_Bom
WHERE Code = Oldid;
END Bomcopy;
CREATE OR REPLACE PROCEDURE Bomcopy(Oldid VARCHAR2,
Newid VARCHAR2,
USER VARCHAR2,
Company VARCHAR2) AS
begin
INSERT Cc_Record_Bom
SELECT Sys_Guid(),
Item,
Item_Class,
Item_d,
Item_d_Class,
Net_Qty,
Waste_Qty,
Total_Qty,
Bom_Ver,
Start_Date,
End_Date,
Newid,
Remark,
USER,
SYSDATE,
USER,
SYSDATE,
Company
FROM Cc_Record_Bom
WHERE Code = Oldid;
INSERT Cc_Stand_Bom
SELECT Sys_Guid(),
Item,
Item_d,
Net_Qty,
Waste_Qty,
Total_Qty,
Bom_Ver,
Start_Date,
End_Date,
Newid,
Remark,
USER,
SYSDATE,
USER,
SYSDATE,
Company,
Item_Class,
Item_d_Class
FROM Cc_Stand_Bom
WHERE Code = Oldid;
INSERT Cc_Wo_Bom
SELECT Item,
Item_d,
Net_Qty,
Waste_Qty,
Total_Qty,
Bom_Ver,
Start_Date,
End_Date,
Newid,
Remark,
USER,
SYSDATE,
USER,
SYSDATE,
Company,
Item_Class,
Item_d_Class
FROM Cc_Wo_Bom
WHERE Code = Oldid;
END Bomcopy;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在你的每个 inset 后面加上 into
追问
还是不行,
错误:PLS-00103: 出现符号 ";"在需要下列之一时:
:= . ) , @ % default
character
行:3
文本:oldId varchar2;
错误:PLS-00103: 出现符号 ")"在需要下列之一时:
begin function package pragma
procedure subtype type use
form current cursor
行:7
文本:)
追答
把分号还改成逗号
oldId varchar2,
newId varchar2,
user varchar2,
company varchar2
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
oldId varchar2;
newId varchar2;
user varchar2;
company varchar2;
变量定义后用分号;
newId varchar2;
user varchar2;
company varchar2;
变量定义后用分号;
追问
PROCEDURE CCJOCHU.BOMCOPY 编译错误
错误:PLS-00103: 出现符号 ";"在需要下列之一时:
:= . ) , @ % default
character
行:3
文本:oldId varchar2;
错误:PLS-00103: 出现符号 ")"在需要下列之一时:
:= . ( @ % ; not null range
default character
行:7
文本:)
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
as后面 要加 BEGIN
追问
加了还是一样啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
哥哥,你的begin呢?开始加个bigin再试试
追问
加了也是一样
追答
因为看不到表的结构,我推断可能错误的可能,
第一个Oldid,Newid Varchar2你确定oldid不是number?
第二个 Company不是定义的传入参数?还是字段呢?
第三 表Cc_Record_Bom的字段确定是18个?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询