select count(*) from ws_bffault_statistic,我想在取出这个count(*)的值 赋给 num,该如何写num=?

解决方案 »

  1.   

    declare
    num number(12);
    begin
    select count(*) into num from ws_bffault_statistic
    end;
      

  2.   

    用oracle的啥函数啊?没有用存储过程
      

  3.   

    用oracle的啥函数啊?没有用存储过程
      

  4.   

    自己写个函数或者存储过程 
    例如
    create function fun_cnt return number is
    num number(12); 
    begin 
    select count(*) into num from ws_bffault_statistic ;
    return num;
    end;
    ,JAVA执行得到结果
    Java调用Oracle的过程和函数
    http://database.51cto.com/art/200509/2849.htm