我的pL/SQL怎么没有打印阿?

胖和尚minifat 2004-08-01 10:54:46
[oracle@mars2 fun]$ more call1.sql
declare
tot_id integer;
tot_cnt integer;
begin
-- call fun
-- tot_id := get_id( 30, tot_cnt );
DBMS_OUTPUT.PUT_LINE( 'total id is: '||tot_id||' , count is '|| tot_cnt );
end;
/
[oracle@mars2 fun]$ sqlplus system/emsdts

SQL*Plus: Release 10.1.0.2.0 - Production on Sun Aug 1 10:53:53 2004

Copyright (c) 1982, 2004, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> start call1.sql

PL/SQL procedure successfully completed.

SQL>
...全文
108 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
胖和尚minifat 2004-08-01
  • 打赏
  • 举报
回复
但是自己定义的函数调用不了啊
[oracle@mars2 fun]$ more call1.sql
declare
tot_id integer;
tot_cnt integer;
begin
-- call fun
tot_id := get_id( 30, tot_cnt );
DBMS_OUTPUT.PUT_LINE( 'total id is: '||tot_id||' , count is '|| tot_cnt );
end;
/
[oracle@mars2 fun]$ more fun1.sql
create function system.get_id(
least integer,
total_count integer )
return integer
is
ret integer;
begin
select sum(ID), count(*) into ret, total_count
from yyq_test
where ID>least;
return ret;
end get_id;
/
[oracle@mars2 fun]$ sqlplus system/emsdts

SQL*Plus: Release 10.1.0.2.0 - Production on Sun Aug 1 11:48:32 2004

Copyright (c) 1982, 2004, Oracle. All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> star^H^H^H^[[3~
SP2-0310: unable to open fil.sql"
SQL> set serveroutput on
SQL> start fun1.sql

Warning: Function created with compilation errors.

SQL> start call1.sql
tot_id := get_id( 30, tot_cnt );
*
ERROR at line 6:
ORA-06550: line 6, column 13:
PLS-00905: object SYSTEM.GET_ID is invalid
ORA-06550: line 6, column 3:
PL/SQL: Statement ignored


SQL>
hot.wind 2004-08-01
  • 打赏
  • 举报
回复
SQL> set serveroutput on
SQL> start call1.sql
胖和尚minifat 2004-08-01
  • 打赏
  • 举报
回复
thanks
tyl3 2004-08-01
  • 打赏
  • 举报
回复
set serveroutput on
dlab 2004-08-01
  • 打赏
  • 举报
回复
set serveroutput on
zhpsam109 2004-08-01
  • 打赏
  • 举报
回复
学习!

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧