如题
如果记录零条记录的华 就出错
用了一个if exists  () then 语法之后,虽然不报错了 但是发现没有删除
求教解决方法

解决方案 »

  1.   

    [code=SQ]
    declare
    cnt number(8);
    begin
    select count(*) into cnt from tablename;
    if cnt>0 then
    delete from tablename;
    else then 
    dbms_output.put_line('没有数据');
    end; [/code]
      

  2.   

    [code=SQ]
    declare 
    cnt number(8); 
    begin 
    select count(*) into cnt from tablename; 
    if cnt>0 then 
    delete from tablename; 
    else then 
    dbms_output.put_line('没有数据'); 
    end;[/code]