ORACLE 截断字符串_Oracle数据库_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

ORACLE 截断字符串

作者:黑客防线网安Oracle维护基地 来源:黑客防线网安Oracle维护基地 浏览次数:0

黑客防线网安网讯:create or replace procedure ModifyLadingItemPack(  ASoditemguid varchar2,                  --合同电子仓单明细GUID  ALadingitemGUID varchar2,               --提单子项GUID  ACDRe...

create or replace procedure ModifyLadingItemPack
(
  ASoditemguid varchar2,                  --合同电子仓单明细GUID
  ALadingitemGUID varchar2,               --提单子项GUID
  ACDResID varchar2,                      --电子仓单号
  APackageIDList varchar2,                --仓单捆包具体GUID列表
  Aladingnum float,
  Aladingpieces float,
  AReturnValue out integer                --返回值:
)
is
  ALadingItem_PackagesGUID varchar(32);
  ATempIDList varchar2(4000);
  AID varchar2(32);
  APackageWeight float;
  APackagePiece float;
  ATotalPackWeight float;
begin
  AReturnValue := 1;
  ATempIDList := APackageIDList;
  APackageWeight :=0;
  APackagePiece :=0;    ---------------------------------更新合同电子仓单明细---------------------------
  while ( INSTR(ATempIDList,':' ) > 0 ) or ( LENGTH(ATempIDList ) > 0 ) loop
        if INSTR(ATempIDList,':' ) > 0 then            select sys_guid() into ALadingItem_PackagesGUID from dual;
           AID := SUBSTR(ATempIDList ,1,INSTR( ATempIDList,':') - 1 );
           ATempIDList := SUBSTR(ATempIDList,INSTR( ATempIDList,':') + 1 , LENGTH(ATempIDList) - INSTR(ATempIDList,':'));            ---------------------------------提单捆包明细----------------------------------
           insert into HT_LadingItem_packages(sGUID, sLadingItemGUID, sCDResID, sPackageID)
          values(ALadingItem_PackagesGUID, ALadingitemGUID, ACDResID,AID);            ---------------------------------更新仓单捆包明细状态---------------------------
           UPDATE ZY_Packages SET state = 5 WHERE SGUID = AID;            select fWeight into ATotalPackWeight from ZY_Packages where sGUID=AID;            APackageWeight:=APackageWeight+ATotalPackWeight;
           APackagePiece:=APackagePiece+1;
        else
           AID := ATempIDList;
           ATempIDList := '';
        end if;
   end loop;    update HT_SODItem set fLadingNum=fLadingNum+APackageWeight,fLadingPieces=fLadingPieces+APackagePiece
   where sGUID=ASoditemguid;   COMMIT;
EXCEPTION
  WHEN OTHERS THEN BEGIN
    AReturnValue := 99;
    ROLLBACK;
  END;
end;

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-12159-1.html
网站维护教程更新时间:2012-03-23 00:33:28  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer