"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > DBMS_OUTPUT.PUT_LINE in PLSQL

DBMS_OUTPUT.PUT_LINE in PLSQL

Published on 2024-11-06
Browse:591

DBMS_OUTPUT.PUT_LINE in PLSQL

In Oracle PL/SQL, the method to print output is using the DBMS_OUTPUT.PUT_LINE procedure. This procedure writes text to the console or output buffer, which can be viewed after execution if DBMS_OUTPUT is enabled. Here’s how you use it:

  1. First, enable output in your SQL environment (like SQL*Plus or Oracle SQL Developer):

SET SERVEROUTPUT ON;

  1. Use DBMS_OUTPUT.PUT_LINE to print output:

BEGIN
DBMS_OUTPUT.PUT_LINE('Hello, World!');
END;
/

This will display:

Hello, World!

Make sure that SERVEROUTPUT is enabled; otherwise, you won't see the output in your console.

Release Statement This article is reproduced at: https://dev.to/mrcaption49/dbmsoutputputline-in-plsql-omk?1 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3