我在linux下用sqlplus执行test.sql不知道为什么不成功,test.sql内容如下:
declare 
cou_num   number; 
reg_num   varchar2(10);
val_num   varchar2(10);
begin
    select count(*)  into cou_num from eax_mode_user where userid=19881988;
    select agentid_reg into reg_num from eax_user where userid=19881988;
    select value into val_num from system_cfg where lower(name)='agentid';
    if(cou_num>0 and reg_num=val_num) then 
        delete from eax_mode_user where userid=19881988 and topid=(select max(topid) from eax_mode_user where userid=19881988);
        commit;
end   if; 
end;
但是我在windows下用PL/SQL Developer执行却能成功,求大牛解答,谢谢

解决方案 »

  1.   

    报什么错误?另外,windows下的文本有行结束符,linux不认.你可以用vi开一下test.sql中是不是有一些不认识字符。
      

  2.   

    不报错误,有日志SQL*Plus: Release 9.2.0.8.0 - Production on Mon Jan 9 20:27:55 2012Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - ProductionSQL>   2    3    4    5    6    7    8    9   10  Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
      

  3.   

    在那个文件后面加一行,输入要一个 "/"  斜线.end;
    /
      

  4.   

    加 "/" 斜线.好使,谢谢fudaliang1999