create  or  replace  procedure  test_pro01  is
v_dt date;  
begin  
select  sysdate into v_dt from  dual;  
end;  
/  

解决方案 »

  1.   

    SQL> create or replace procedure z_counts is
      2  z_counts number
      3  select count(*) into z_counts from message where pub_date> to_date(to_char(sysdate,'yyyy-m
    m-dd'),'yyyy-mm-dd');
      4  end;
      5  /警告: 创建的过程带有编译错误。
    那这怎么不行啊》?
      

  2.   

    create  or  replace  procedure  z_counts  is  
    z_counts  number; --少了;号  
    select  count(*)  into  z_counts  from  message  where  pub_date  >  to_date(to_char(sysdate,'yyyy-m  
    m-dd'),'yyyy-mm-dd');  
    end;  
    /  
     
      

  3.   

    SQL> create or replace procedure z_counts is
      2  z_counts number;
        begin
      3  select count(*) into z_counts from message where pub_date> to_date(to_char(sysdate,'yyyy-m
    m-dd'),'yyyy-mm-dd');
      4  end;
      5  /