⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 08-outpt.sql

📁 《Oracle8i PL/SQL程序设计》附源码
💻 SQL
字号:
REM 08-OUTPT.SQL
REM This file contains the example demonstrating the DBMS_OUTPUT
REM package, from Chapter 8 of "Oracle PL/SQL Programming".

REM This is version 1.0 of this file, updated 2/18/96.
REM Comments and questions should go to Scott Urman, at
REM surman@us.oracle.com.

SET SERVEROUTPUT ON
DECLARE
  /* Demonstrates using PUT_LINE and GET_LINE. */
  v_Data      DBMS_OUTPUT.CHARARR;
  v_NumLines  NUMBER;
BEGIN
  -- Enable the buffer first.
  DBMS_OUTPUT.ENABLE(1000000);

  -- Put some data in the buffer first, so GET_LINES will
  -- retrieve something.
  DBMS_OUTPUT.PUT_LINE('Line One');
  DBMS_OUTPUT.PUT_LINE('Line Two');
  DBMS_OUTPUT.PUT_LINE('Line Three');

  -- Set the maximum number of lines which we want to retrieve.
  v_NumLines := 3;

  /* Get the contents of the buffer back. Note that v_Data is
     declared of type DBMS_OUTPUT.CHARARR, so that it matches
     the declaration of DBMS_OUTPUT.GET_LINES. */
  DBMS_OUTPUT.GET_LINES(v_Data, v_NumLines);

  /* Loop through the returned buffer, and insert the contents
     into temp_table. */
  FOR v_Counter IN 1..v_NumLines LOOP
    INSERT INTO temp_table (char_col)
      VALUES (v_Data(v_Counter));
  END LOOP;
END;
/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -