doc-exports/docs/dws/dev/dws_04_0553.html
Lu, Huayi e6fa411af0 DWS DEV 830.201 version
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com>
Co-authored-by: Lu, Huayi <luhuayi@huawei.com>
Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
2024-05-16 07:24:04 +00:00

122 lines
12 KiB
HTML

<a name="EN-US_TOPIC_0000001188323648"></a><a name="EN-US_TOPIC_0000001188323648"></a>
<h1 class="topictitle1">DBMS_OUTPUT</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001188323648__s954c63c382244d3fb42bc0beac0c58b7"><h4 class="sectiontitle">Related Interfaces</h4><p id="EN-US_TOPIC_0000001188323648__afd2da6e40293408492835fcc2b4e7ea0"><a href="#EN-US_TOPIC_0000001188323648__table1347845844912">Table 1</a> provides all interfaces supported by the <strong id="EN-US_TOPIC_0000001188323648__b727224118355">DBMS_OUTPUT</strong> package.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001188323648__table1347845844912"></a><a name="table1347845844912"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188323648__table1347845844912" frame="border" border="1" rules="all"><caption><b>Table 1 </b>DBMS_OUTPUT</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188323648__row19480195818499"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.1.3.2.3.1.1"><p id="EN-US_TOPIC_0000001188323648__aa581b981a4b349ed8131c677058f9db2">API</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="80%" id="mcps1.3.1.3.2.3.1.2"><p id="EN-US_TOPIC_0000001188323648__a13bd937f2dd5441a946985a5f67d4f9e">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188323648__row548065810495"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001188323648__aec8a7a4d51a549c2914c64508b70282d"><a href="#EN-US_TOPIC_0000001188323648__t0f2c22fccf6e46e887e8bcc67641cb45">DBMS_OUTPUT.PUT_LINE</a></p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001188323648__afa35316802e84d5bbe93242481a17db8">Outputs the specified text. The text length cannot exceed 32,767 bytes.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188323648__row15480758174911"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001188323648__a5864c8c56c354752a44294b1b442409b"><a href="#EN-US_TOPIC_0000001188323648__t710910bfc110480ba9325098ec57b4ad">DBMS_OUTPUT.PUT</a></p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001188323648__a413ea0cc64bc480d9b47df29bb64abee">Outputs the specified text to the front of the specified text without adding a line break. The text length cannot exceed 32,767 bytes.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001188323648__row12480135824913"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.3.2.3.1.1 "><p id="EN-US_TOPIC_0000001188323648__ac12441e7a9b6421697c3e31bb5df972d"><a href="#EN-US_TOPIC_0000001188323648__t6f5db9a88c364c16a334176b641c714e">DBMS_OUTPUT.ENABLE</a></p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.1.3.2.3.1.2 "><p id="EN-US_TOPIC_0000001188323648__a4ae11c8883264454bd993971a29dc772">Sets the buffer area size. If this interface is not specified, the maximum buffer size is 20,000 bytes and the minimum buffer size is 2000 bytes. If the specified buffer size is less than 2000 bytes, the default minimum buffer size is applied.</p>
</td>
</tr>
</tbody>
</table>
</div>
<ul id="EN-US_TOPIC_0000001188323648__u98112aa698ea476da4c6fbb745eec6ed"><li id="EN-US_TOPIC_0000001188323648__l235f1c5b599f4724870c0de664e7e1e4">DBMS_OUTPUT.PUT_LINE</li></ul>
<p id="EN-US_TOPIC_0000001188323648__a2989e9756d024e0da2da80d0daa80d2e">The PUT_LINE procedure writes a row of text carrying a line end symbol in the buffer. The DBMS_OUTPUT.PUT_LINE function prototype is:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188323648__s99279cb7097744c9ba02fa97516d07ca"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">DBMS_OUTPUT</span><span class="p">.</span><span class="n">PUT_LINE</span><span class="w"> </span><span class="p">(</span>
<span class="n">item</span><span class="w"> </span><span class="k">IN</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">);</span>
</pre></div></td></tr></table></div>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001188323648__t0f2c22fccf6e46e887e8bcc67641cb45"></a><a name="t0f2c22fccf6e46e887e8bcc67641cb45"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188323648__t0f2c22fccf6e46e887e8bcc67641cb45" frame="border" border="1" rules="all"><caption><b>Table 2 </b>DBMS_OUTPUT.PUT_LINE interface parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188323648__r974c0e7a707a49659e09be8ceb9bac7e"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.1.7.2.3.1.1"><p id="EN-US_TOPIC_0000001188323648__a352e6aaf3fbe427fb21e19f8e824d41d">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="80%" id="mcps1.3.1.7.2.3.1.2"><p id="EN-US_TOPIC_0000001188323648__a5ea25261948b4e10acfb17c26db2b6a9">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188323648__r3e86eb22b4ce41048ee56d4b9404e817"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.7.2.3.1.1 "><p id="EN-US_TOPIC_0000001188323648__ade434f40e8834c9e8a1f471d3d927e0f">item</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.1.7.2.3.1.2 "><p id="EN-US_TOPIC_0000001188323648__a9394286661284c2eba69f4cc3795723a">Specifies the text that was written to the buffer.</p>
</td>
</tr>
</tbody>
</table>
</div>
<ul id="EN-US_TOPIC_0000001188323648__uec08f06bc8394dea965ebb53a5184abf"><li id="EN-US_TOPIC_0000001188323648__l61b9b718cb4e45959a17d57783f51389">DBMS_OUTPUT.PUT</li></ul>
<p id="EN-US_TOPIC_0000001188323648__aca672e57f3664b31802afdbbd7e019e4">The stored procedure <strong id="EN-US_TOPIC_0000001188323648__b842352706112018">PUT</strong> outputs the specified text to the front of the specified text without adding a linefeed. The DBMS_OUTPUT.PUT function prototype is:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188323648__s3a8489e306c04e3e8f5aef7105393e22"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">DBMS_OUTPUT</span><span class="p">.</span><span class="n">PUT</span><span class="w"> </span><span class="p">(</span>
<span class="n">item</span><span class="w"> </span><span class="k">IN</span><span class="w"> </span><span class="n">VARCHAR2</span><span class="p">);</span>
</pre></div></td></tr></table></div>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001188323648__t710910bfc110480ba9325098ec57b4ad"></a><a name="t710910bfc110480ba9325098ec57b4ad"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188323648__t710910bfc110480ba9325098ec57b4ad" frame="border" border="1" rules="all"><caption><b>Table 3 </b>DBMS_OUTPUT.PUT interface parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188323648__r1eef2e184b9843efa7d3dddd268525ba"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.1.11.2.3.1.1"><p id="EN-US_TOPIC_0000001188323648__acf05ff1ef00f4251a4d94f6789c25e9d">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="80%" id="mcps1.3.1.11.2.3.1.2"><p id="EN-US_TOPIC_0000001188323648__aae2d5d3dda164d9cb2f2f3c7d94de2bb">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188323648__r9cb33216ca704b92b3ccfe502ffa3bee"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.11.2.3.1.1 "><p id="EN-US_TOPIC_0000001188323648__a6de8d16fe70d4bc08838498e8c09a891">item</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.1.11.2.3.1.2 "><p id="EN-US_TOPIC_0000001188323648__a6805aace0b4a43e2bddd6646db114cdc">Specifies the text that was written to the specified text.</p>
</td>
</tr>
</tbody>
</table>
</div>
<ul id="EN-US_TOPIC_0000001188323648__uf3e1911c1c014da6980965ce22b6f3b4"><li id="EN-US_TOPIC_0000001188323648__lf8716a1c9459449da426ffc63d9a4e35">DBMS_OUTPUT.ENABLE</li></ul>
<p id="EN-US_TOPIC_0000001188323648__ace150a0185e54b2eab2b3697f8791631">The stored procedure <strong id="EN-US_TOPIC_0000001188323648__b842352706112923">ENABLE</strong> sets the output buffer size. If the size is not specified, it contains a maximum of 20,000 bytes. The DBMS_OUTPUT.ENABLE function prototype is:</p>
<div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188323648__see6719dec8b64739a64584dbe0a6d53c"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span></pre></div></td><td class="code"><div><pre><span></span><span class="n">DBMS_OUTPUT</span><span class="p">.</span><span class="n">ENABLE</span><span class="w"> </span><span class="p">(</span>
<span class="n">buf</span><span class="w"> </span><span class="k">IN</span><span class="w"> </span><span class="nb">INTEGER</span><span class="p">);</span>
</pre></div></td></tr></table></div>
</div>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001188323648__t6f5db9a88c364c16a334176b641c714e"></a><a name="t6f5db9a88c364c16a334176b641c714e"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001188323648__t6f5db9a88c364c16a334176b641c714e" frame="border" border="1" rules="all"><caption><b>Table 4 </b>DBMS_OUTPUT.ENABLE interface parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001188323648__r9d53c942ef6c4da09e53904048cc3a40"><th align="left" class="cellrowborder" valign="top" width="20%" id="mcps1.3.1.15.2.3.1.1"><p id="EN-US_TOPIC_0000001188323648__a88e3a6144090499da01d02d13f20990b">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="80%" id="mcps1.3.1.15.2.3.1.2"><p id="EN-US_TOPIC_0000001188323648__adce6412042f84001a010eff0e9a5cdee">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001188323648__r8b8804dd69754e1eaa0e49f0e39ca311"><td class="cellrowborder" valign="top" width="20%" headers="mcps1.3.1.15.2.3.1.1 "><p id="EN-US_TOPIC_0000001188323648__a80fc300c078e43cfa9c057fa73d0fa98">buf</p>
</td>
<td class="cellrowborder" valign="top" width="80%" headers="mcps1.3.1.15.2.3.1.2 "><p id="EN-US_TOPIC_0000001188323648__a1f8463da25b4450996a5460bb6ae3567">Sets the buffer area size.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001188323648__s7429146bc1184f62befa73f63e65b866"><h4 class="sectiontitle">Examples</h4><div class="codecoloring" codetype="Sql" id="EN-US_TOPIC_0000001188323648__s3b35a68a22f74e8490601e53dbc37e1d"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
<span class="normal">2</span>
<span class="normal">3</span>
<span class="normal">4</span>
<span class="normal">5</span>
<span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span><span class="k">BEGIN</span>
<span class="w"> </span><span class="n">DBMS_OUTPUT</span><span class="p">.</span><span class="n">ENABLE</span><span class="p">(</span><span class="mi">50</span><span class="p">);</span>
<span class="w"> </span><span class="n">DBMS_OUTPUT</span><span class="p">.</span><span class="n">PUT</span><span class="w"> </span><span class="p">(</span><span class="s1">'hello, '</span><span class="p">);</span>
<span class="w"> </span><span class="n">DBMS_OUTPUT</span><span class="p">.</span><span class="n">PUT_LINE</span><span class="p">(</span><span class="s1">'database!'</span><span class="p">);</span><span class="c1">-- Displaying &quot;hello, database!&quot;</span>
<span class="k">END</span><span class="p">;</span>
<span class="o">/</span>
</pre></div></td></tr></table></div>
</div>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_04_0550.html">Advanced Packages</a></div>
</div>
</div>