﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>语源科技BlogJava-企业业务流程</title><link>http://www.blogjava.net/chsdll/</link><description>平台测试，流程构建，流程改进，流程实施，流程测试</description><language>zh-cn</language><lastBuildDate>Thu, 07 May 2026 08:58:35 GMT</lastBuildDate><pubDate>Thu, 07 May 2026 08:58:35 GMT</pubDate><ttl>60</ttl><item><title>Oracle DBMS_OUTPUT作用(转)</title><link>http://www.blogjava.net/chsdll/archive/2008/09/02/226516.html</link><dc:creator>朗月繁星</dc:creator><author>朗月繁星</author><pubDate>Tue, 02 Sep 2008 13:59:00 GMT</pubDate><guid>http://www.blogjava.net/chsdll/archive/2008/09/02/226516.html</guid><wfw:comment>http://www.blogjava.net/chsdll/comments/226516.html</wfw:comment><comments>http://www.blogjava.net/chsdll/archive/2008/09/02/226516.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/chsdll/comments/commentRss/226516.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/chsdll/services/trackbacks/226516.html</trackback:ping><description><![CDATA[<h2>DBMS_OUTPUT package</h2>
The DBMS_OUTPUT package give you the possibility to send messages from pl/sql. An option that is used mostly is to enable the DBMS_OUTPUT package and show the contents of the message-buffer in the screen. In SQL*PLUS this can be done with the command: 'SET SERVEROUTPUT ON' or 'SET SERVEROUT ON' In tools like TOAD you can enable the output with a button.
<h3>subprograms</h3>
<h4>dbms_output.enable</h4>
With dbms_output.enable you can enable the subprograms PUT, PUT_LINE, GET_LINE, GET_LINES and NEW_LINE. If the dbms_output package is not enabled these subprograms will ignore the call. If the command 'SET SERVEROUT ON' is called, the package will automatically be enabled.<br />
<strong>syntax</strong><br />
dbms_output.enable; or <br />
dbms_output.enable(buffer_size); (Up to Oracle 10g the buffersize os an integer between 2,000 and 1,000,000; From Oracle 10g Release 2 the buffersize is unlimited)
<h4>dbms_output.disable</h4>
With dmbs_output.disable you disable the subprograms PUT, PUT_LINE, GET_LINE, GET_LINES and NEW_LINE. A call to these subprograms will be ignored and the buffer is purged.<br />
<br />
<strong>syntax</strong><br />
dbms_output.disable; <br />
<br />
<br />
<h4>dbms_output.put and dbms_output.put_line</h4>
The dbms_output.put_line or dbms_output.put procedures add the passed parameter to the buffer. These procedures are overloaded and can be called with a VARCHAR2, DATE or NUMBER parameter. These parameters will be implicitely converted to VARCHAR2 before they are put on the buffer. The put_line procedure automatically adds and end-of-line to the buffer. If the line is bigger than the buffer limit, you will receive an error message.<br />
<br />
<strong>syntax</strong><br />
dbms_output.put(parameter); (with parameter a VARCHAR2, DATE or NUMBER value) dbms_output.put_line(parameter); (with parameter a VARCHAR2, DATE or NUMBER value)
<h4>dbms_output.new_line</h4>
The dbms_output.new_line procedure adds and end-of-line to the buffer.<br />
<br />
<strong>syntax</strong><br />
dbms_output.new_line;<br />
<h4>dbms_output.get_line and dbms_output.get_lines</h4>
The dbms_output.get_line and dbms_output.get_lines procedures get 1 or more lines from the buffer. The get_line procedure gets 1 line and the get_lines procedure gets a array of lines from the buffer.<br />
<br />
<strong>syntax</strong><br />
dbms_output.get_line(p_line,p_status); <br />
with p_line the returned line-value and status an integer value. Up to Oracle 10gR2 the maximum lenght of p_line is 255 bytes. From Oracle 10gR2 the line length limit is 32K (32767). If p_status returns 0, the call is completed succesfully.<br />
If there are no more lines in the buffer, p_status will return 1.<br />
<br />
dbms_output.get_lines(p_lines, p_numlines) <br />
where p_lines has up to Oracle 10gR2 datatype CHARARR (table of VARCHAR2(255)). And from Oracle 10gR2 the datatype is DBMSOUTPUT_LINESARRAY (VARRAY(2147483647) OF VARCHAR2(32767)) And p_numlines is an IN/OUT parameter with datatype INTEGER representing the number of lines you want to get from the buffer. The returning value of p_numlines is the number of lines actually retrieved. <br />
<img src ="http://www.blogjava.net/chsdll/aggbug/226516.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/chsdll/" target="_blank">朗月繁星</a> 2008-09-02 21:59 <a href="http://www.blogjava.net/chsdll/archive/2008/09/02/226516.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>