How to run PL/SQL Program using Notepad
To run a PL/SQL program using notepad, you have to write your code in notepad and then execute the program by using SQL*Plus tool.
Steps:
1. Write following PL/SQL program code in notepad and save file as ‘world.sql’.
Example to run PL/SQL program using notepad
1 2 3 4 | BEGIN DBMS_OUTPUT.PUT_LINE('Welcome to PL/SQL World'); END; / |
2. Install Oracle Client(if not installed) and ensure, if your Oracle Database or Oracle Client installed with SQL* Plus tool. SQL*Plus is necessary for running PL/SQL programs.
3. Start the SQL*Plus by typing the following command:
Syntax:
1 | sqlplus username/password@database_name |
Example:
1 | sqlplus scott/tiger@employee |
4. For executing the PL/SQL program store written in notepad file by using the @symbol to call the script.
1 | @C:\temp\world.sql |
5. If SQL*Plus execute the script and does’nt display the output then type the following command:
1 | SET SERVEROUTPUT ON |
Check out our other PL/SQL programs examples