mysql 语法问题,oracle 存储过程 转为 mysql
createorreplaceprocedureQUHAO_GetPrintNum(v_itemidinvarchar2,v_idcardnoinvarchar2,v_i...
create or replace procedure QUHAO_GetPrintNum(v_itemid in varchar2,
v_idcardno in varchar2,v_idcardname in varchar2,
v_printNo out varchar2,v_itemname out varchar2)
as
v_seqnum number(20);
v_orderid varchar2(26);
v_prex varchar2(6);
begin
execute immediate ' select SEQ_item_'||v_itemid||'.nextval from dual' into v_seqnum;
select lpad(v_seqnum,20,'0') into v_orderid from dual;
select itemprex,itemname into v_prex, v_itemname from QUHAOITEM where itemid=v_itemid;
v_orderid:=v_prex||v_orderid;
DBMS_OUTPUT.put_line(v_orderid);
insert into QUHAOUNCALL ( id,orderid,Itemid,Qutime,iscall,idcardno,idcardname)
values(SEQ_QUHAOUNCALL.nextval,v_orderid,v_itemid,sysdate,0,v_idcardno,v_idcardname);
v_printNo:=v_orderid;
end; 展开
v_idcardno in varchar2,v_idcardname in varchar2,
v_printNo out varchar2,v_itemname out varchar2)
as
v_seqnum number(20);
v_orderid varchar2(26);
v_prex varchar2(6);
begin
execute immediate ' select SEQ_item_'||v_itemid||'.nextval from dual' into v_seqnum;
select lpad(v_seqnum,20,'0') into v_orderid from dual;
select itemprex,itemname into v_prex, v_itemname from QUHAOITEM where itemid=v_itemid;
v_orderid:=v_prex||v_orderid;
DBMS_OUTPUT.put_line(v_orderid);
insert into QUHAOUNCALL ( id,orderid,Itemid,Qutime,iscall,idcardno,idcardname)
values(SEQ_QUHAOUNCALL.nextval,v_orderid,v_itemid,sysdate,0,v_idcardno,v_idcardname);
v_printNo:=v_orderid;
end; 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询