The DBMS_OUTPUT package is created when the Oracle database is installed. The dbmsoutp.sql script (found in the built-in packages source code directory, as described in Chapter 1, Introduction) contains the source code for this package's specification. This script is called by the catproc.sql script, which is normally run immediately after database creation. The script creates the public synonym DBMS_OUTPUT for the package. Instance-wise access to this package is provided on installation, so no additional steps should be necessary in order to use DBMS_OUTPUT. As far as package usage is concerned, you will almost always be using only the DBMS_OUTPUT.PUT_LINE procedure and only in SQL*Plus. The following anonymous PL/SQL block uses DBMS_OUTPUT to display the name and salary of each employee in department 10:DECLARE
   CURSOR emp_cur 
   IS
      SELECT ename, sal
        FROM emp
       WHERE deptno = 10
       ORDER BY sal DESC;
BEGIN
   FOR emp_rec IN emp_cur
   LOOP
      DBMS_OUTPUT.PUT_LINE 
         ('Employee ' || emp_rec.ename || ' earns ' || 
          TO_CHAR (emp_rec.sal) || ' dollars.');
   END LOOP;
END;
/

解决方案 »

  1.   

    I'll try. thank you for your kindness. 
    by the way, why do you answer all of the questions in english not in chinese,r u a foreigner? maybe, I will go abroad soon! wuwuwu, miss both my parents ,brother,girlfriend and my closed friend 。sincerely your's  TheFlyingBird
      

  2.   

    不是老外因为那是online documents
      

  3.   

    Hiahiahia,BTW , YOu must doset serveroutput onto display the output of dbms_output