ORA-06550:第1行,第65列:PLS-00103:遇到以下某种情况时遇到符号“CREATE”:

时间:2017-08-09 23:58:01

标签: plsql oracle-apex-5 procedures

我的代码

   CREATE OR REPLACE PROCEDURE myproc IS
       CurrDep Number;
       Tot Number;
       accm Number;

       Cursor Cur_lcd is
           select  * from Courier_Scanner;
       Cur_row Courier_Scanner%rowtype;
   Begin

       for Cur_row  in Cur_lcd
       Loop
           CurrDep := (Cur_row.PURCHASE_PRICE- Cur_row.SALVAGE)/Cur_row.LIFE_SPAN;
           accm:= Cur_row.TOTAL_ACC_DEP;
           Tot := CurrDep + accm;

           Update Courier_Scanner
           set CURR_PRED_DEP = Currdep,
               TOTAL_ACC_DEP = Tot,
               NET_VALUE = Cur_row.PURCHASE_PRICE-Tot 
               ACCUMULATED_DEP = accm
           where  SC_NO = Cur_row.SC_NO;
       end loop;

       commit;
   END myproc;     

ERROR:

    ORA-06550: line 1, column 65: PLS-00103: Encountered the symbol "CREATE"                                         
    when expecting one of the following: ( begin case declare exit for goto 
    if loop mod null pragma raise return select update while with <an 
    identifier> <a double-

任何人都可以通过指出程序中的确切错误来帮助我。我花了好几个小时,但看不到任何。

2 个答案:

答案 0 :(得分:0)

该存储过程绝对没有问题。如果您正在使用TOAD或SQL * Plus,请确保在要编译的每个PL / SQL块之后在单独的行上放置正斜杠。正斜杠是TOAD和SQL * Plus中的默认块终止符。

答案 1 :(得分:0)

中的update语句中缺少逗号(,
  

NET_VALUE = Cur_row.PURCHASE_PRICE-Tot ACCUMULATED_DEP = accm where   SC_NO = Cur_row.SC_NO;

纠正如下:

UPDATE Courier_Scanner
         SET CURR_PRED_DEP = Currdep,
             TOTAL_ACC_DEP = Tot,
             NET_VALUE = Cur_row.PURCHASE_PRICE - Tot,
             ACCUMULATED_DEP = accm
       WHERE SC_NO = Cur_row.SC_NO;