Skip to Main Content

SQL Developer Data Modeler

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

PLSQL DBMS_OUTPUT.PUT_LINE

chr1sfJul 29 2012 — edited Jul 30 2012
This is my error;
______________________________________________________
SQL> @test.sql
DBMS_OUPUT.PUT_LINE('Status: ' || status);
*
ERROR at line 12:
ORA-06550: line 12, column 7:
PLS-00201: identifier 'DBMS_OUPUT.PUT_LINE' must be declared
ORA-06550: line 12, column 7:
PL/SQL: Statement ignored
________________________________________________________

Here’s my test script;
________________________________________________________
SET SERVEROUTPUT ON SIZE 1000000

DECLARE
CURSOR def_p IS SELECT * FROM emp_payment_method_tb;
status NVARCHAR2(100) := 'Mask for payment method DAT file location complete';

BEGIN
FOR i IN def_p
LOOP
UPDATE emp_payment_method_tb
SET default_path=(SELECT DBMS_RANDOM.STRING('A', 20) default_path FROM DUAL);
END LOOP;
COMMIT;
DBMS_OUPUT.PUT_LINE('Status: ' || status);
END;
/
___________________________________________________

If I remove the dbms_output line the script runs as expected. This is a sample table to test the script. The idea is to have the script mask certain parts of a database after a clone.
___________________________________________________
SQL> select * from emp_payment_method_tb;

METHOD DEFAULT_PATH
-------------------- ----------------------------------------
ABC c:\admin
DEF g:\path\files


SQL> @test.sql

PL/SQL procedure successfully completed.

SQL> select * from emp_payment_method_tb;

METHOD DEFAULT_PATH
-------------------- ----------------------------------------
ABC fqaYYFCFcdjVuqoxXkGW
DEF fqaYYFCFcdjVuqoxXkGW
__________________________________________________
If I enter the declaration and run this under the same user in the same schema, it runs as expected.
__________________________________________________
SQL> set serveroutput on size 1000000
SQL> declare status NVARCHAR2(100) := 'Mask complete';
2 begin
3 dbms_output.put_line('Status:' || status);
4 end;
5 /
Status:Mask complete

PL/SQL procedure successfully completed.
______________________________________
Any ideas to what I have done wrong greatly appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 27 2012
Added on Jul 29 2012
4 comments
11,099 views