First Program – PL/SQL

A simple program in PL/SQL

Firtsprogram

Above program executed and printed the output as “PL/SQL procedure successfully completed.” but not printed “Hello Learner”.

We need to execute “SET SERVEROUTPUT ON” if we need to see the output of the code.

Firtsprogram2

Declaring and usage of variables in program

declare

Here, DECLARE statement is used to declare the variables and := operation is used to assign value to the variable.

DBMS_OUTPUT.PUT_LINE is used to print the values.

Commenting Codes

Comments let you include  text within your code to explain what the code does. PL/SQL compiler ignores comments.

PL/SQL supports two types of comments.

  • Single line comments (- -)
  • Multi line comments (/*    ……….*/)

Comments.JPG

Advertisements

Post your Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s