大家好,请问以下错误是什么原因造成的呢?
SQL> create or replace procedure pro
  2  is
  3  begin
  4  select * from student where id=11;
  5  end;
  6  /Warning: Procedure created with compilation errors

解决方案 »

  1.   

    show error  --可以看到错误信息select * from student where id=11;
    需要赋值给变量,如
    select id into v_id from student where id=11;
      

  2.   

    在存储过程中select后边必须带着into
      

  3.   

    要么定义一个游标,把select的结果暂存
    要么定义一个变量,用into到变量里面
      

  4.   

    楼主还是先看看procedure是干嘛用的吧,你这样写存储过程有什么意义呢
      

  5.   

    select 返回的结果存在哪里????要么into到变量,然后dbms.output.putline打印一下
    要么就放到游标里面
    或者把结果insert到一个表里面,比如
    insert into a(aa,bb) select cc,dd from b where id=1;  ---首先要建立a表。
    create table a as select cc,dd from b where id=1;---不需要手动建立表