PL SQL输出未显示 [英] PL SQL output is not getting displayed
本文介绍了PL SQL输出未显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Oracle Virtualbox中运行的代码非常简单.但是由于某种原因,它没有显示pl/sql输出.
I have fairly simply code ..running in Oracle Virtualbox. However for some reason it is not displaying pl/sql output.
这是代码段
SQL> set serveroutput on
SQL> list
1 Create or Replace procedure mytz
2 IS
3 v_mytz TIMESTAMP WITH TIME ZONE DEFAULT '2013-05-05 12:00:00 AM';
4 BEGIN
5 DBMS_OUTPUT.PUT_LINE ('Default timestamp is ' );
6* end mytz ;
SQL> /
Procedure created.
SQL>
要在SQL提示符下查看输出,我需要做些特别的事情吗?
Is there anything I need to do special to see the output on SQL prompt ?
推荐答案
您必须实际运行该过程,而不仅仅是创建它,例如:
You have to actually run the procedure, not just create it, e.g.:
set serverputput on
exec mytz;
set serveroutput
SQL * Plus命令必须在执行过程的会话中,而不是在创建过程的会话中(如果它们不同).
The set serveroutput
SQL*Plus command has to be in the session the procedure is executed, not the one where it is created (if they are different).
您目前未显示变量的值;也许您想要这个?
You are not showing the value of your variable at the moment; maybe you wanted this?
dbms_output.put_line('Default timestamp is: ' || v_mytz);
这篇关于PL SQL输出未显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文