日期:2014-05-17  浏览次数:21085 次

初用oracle 创建很简单的存储过程报错...感谢大侠来帮帮忙~不差分。
SQL code

create or replace procedure test_select
as
begin
  dbms_system.output_line('this is my first proc in oracle !');
end;



为什么说无效呢 ? 当我加上参数的时候又OK 了。
SQL code

create or replace procedure test_select(
     user_name out varchar2,
     user_id in number
)
as
begin
  dbms_system.output_line('this is my first proc in oracle !');
end;



妹的,这样又OK 了,,,,我擦, ,为什么呢 ?
另外谁给小弟介绍 存储过程的学习资料小弟 不胜感激 。


------解决方案--------------------
SQL code

--dbms_output.put_line你是不是寫錯了,執行試下
create or replace procedure test_select
as
begin
  dbms_output.put_line('this is my first proc in oracle !');
end;
/
exec test_select;
/

------解决方案--------------------
dbms_output.put_line('this is my first proc in oracle !');

------解决方案--------------------
带参数的真的没错? dbms_system.output_line 这是自己写?

SQL code
SQL> create or replace procedure test_select
  2
  3  as
  4  begin
  5    dbms_system.output_line('this is my first proc in oracle !');
  6  end;
  7  /

Warning: Procedure created with compilation errors.

SQL> show error
Errors for PROCEDURE TEST_SELECT:

LINE/COL ERROR
-------- -----------------------------
5/3      PLS-00201: identifier 'DBMS_SYSTEM.OUTPUT_LINE' must be declared
5/3      PL/SQL: Statement ignored
SQL> create or replace procedure test_select
  2  as
  3  begin
  4    dbms_output.put_line('this is my first proc in oracle !');
  5  end;
  6  /

Procedure created.

SQL>

------解决方案--------------------
dbms_output.put_line('this is my first proc in oracle !');

我的异常网推荐解决方案:oracle存储过程,http://www.aiyiweb.com/oracle-develop/177537.html