SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS OFF 
GOALTER   PROCEDURE usp_SystemInitialize
( @InitPassword nvarchar(20) )
ASSET NOCOUNT ONIF @InitPassword<>'ePowerHRM' RETURN 1--ALTER TABLE CI_LIST DISABLE TRIGGER ALL
TRUNCATE TABLE SYST_USELOG
DELETE SYST_OPERATOR WHERE F_OPERATORID<>'SYSTEM'--ALTER TABLE CI_LIST ENABLE TRIGGER ALL
RETURN 0GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO这是MSSQL的过程,我现在要迁移到Oracle,这是我迁移的代码,有问题,高手赐教!Create Or Replace Procedure Usp_Systeminitialize(Initpassword Nvarchar2) As
Begin
  Exit When Initpassword<>'ePowerHRM';
Delete Table Syst_Uselog;
  Delete Syst_Operator Where f_Operatorid<>'SYSTEM';
End Usp_Systeminitialize;

解决方案 »

  1.   

    Create Or Replace Procedure Usp_Systeminitialize(Initpassword in Nvarchar2) As
    Begin
    if Initpassword<>'ePowerHRM' then
      return;
    end if
    TRUNCATE Syst_Uselog;
    Delete Syst_Operator Where f_Operatorid<>'SYSTEM';
    End Usp_Systeminitialize;
      

  2.   

    Compilation errors for PROCEDURE PSCHRM.USP_SYSTEMINITIALIZEError: PLS-00103: 出现符号 "TRUNCATE"在需要下列之一时:
           ;
           符号 ";在 "TRUNCATE" 继续之前已插入。
    Line: 6
    Text: TRUNCATE Syst_Uselog;
    我按你写的试了,报这个错误!
      

  3.   

    我现在已经创建成功代码如下:
    CREATE OR REPLACE Procedure Usp_Systeminitialize(Initpassword In Nvarchar2) As
    Begin Delete From Syst_Uselog;
    Delete Syst_Operator Where f_Operatorid <> 'SYSTEM';End Usp_Systeminitialize;但是有个问题没解决,就是当满足条件退出功能没实现:
    if Initpassword<>'ePowerHRM' then
      return;
    end if
    谁帮我搞定一下!
      

  4.   

    CREATE OR REPLACE Procedure Usp_Systeminitialize(Initpassword In varchar2) As
    Begin
    if Initpassword<>'ePowerHRM' then
    return;
    end if;
    Delete From Syst_Uselog;
    Delete Syst_Operator Where f_Operatorid <> 'SYSTEM';End Usp_Systeminitialize;
      

  5.   

    刚才end if 后忘记加分号了
      

  6.   

    Compilation errors for PROCEDURE PSCHRM.USP_SYSTEMINITIALIZEError: PLS-00103: 出现符号 "SYST_USELOG"在需要下列之一时:
           :=.(@%;
           符号 ":=" 被替换为 "SYST_USELOG" 后继续。
    Line: 6
    Text: Truncate Syst_Uselog;仍然错误
      

  7.   

    在过程内能够使用语句Truncate吗?返回值需要怎么处理?
      

  8.   

    汗!~~~~
    Create Or Replace Procedure Usp_Systeminitialize(Initpassword in varchar2,Rst out int) As
    Begin
    if Initpassword<>'ePowerHRM' then
    Rst:=0;
    return;
    end if;
    TRUNCATE Table Syst_Uselog;
    Delete Syst_Operator Where f_Operatorid<>'SYSTEM';
    Rst:=1;
    End Usp_Systeminitialize;
      

  9.   

    Compilation errors for PROCEDURE PSCHRM.USP_SYSTEMINITIALIZEError: PLS-00103: 出现符号 "TABLE"在需要下列之一时:
           :=.(@%;
           符号 ":=在 "TABLE" 继续之前已插入。
    Line: 7
    Text: TRUNCATE Table Syst_Uselog;仍然错误,不过我将Truncate table 换成delete from 就没错误了,谢谢!结帖!