Follow us: Connect on YouTube Connect on YouTube Connect on YouTube


Sunday, 3 April 2016

First PL/SQL Program

   X   NUMBER(3) :=  10;
   Y   NUMBER(3) :=  20;

    DBMS_OUTPUT.PUT_LINE(‘Welcome to PL/SQL Programming’);
    DBMS_OUTPUT.PUT_LINE(‘The value of variable X is : ‘ ||  X);
    DBMS_OUTPUT.PUT_LINE(‘The value of variable Y is : ‘ ||  Y);

The Result will be :
 The value of variable X is : 10
 The value of variable Y is : 20

For each execution, a PL/SQL block is first compiled by the PLSQL compiler and if there are any compilation errors then the errors are shown. If compilation is successful then the block is immediately executed. A PL/SQL block is not stored in the database so to execute it again it has to be reloaded.

Note:- One can prefix a variable with “&” in the PL/SQL body to create a substitution variable, that prompts the user to enter a value.
Share this article :


  1. Hallo,

    Hip Hip Hooray! I was always told that slightly slow in the head, a slow learner. Not anymore! It’s like you have my back. I can’t tell you how much I’ve learnt here and how easily! Thank you for blessing me with this
    effortlessly ingestible digestible content

    The third-party has installed SQL Server 2017 for our company but we dont know it is a license or cracked version :( How to check it?

    I am so grateful for your blog. Really looking forward to read more.

    Thanks a heaps,

  2. Szia,

    Grazie! Grazie! Grazie! Your blog is indeed quite interesting around First PL/SQL Program ! I agree with you on lot of points!

    I posted before regarding using oracle UDT stored procedure parameter type to pass a list of records for multiple insert using .net c#.
    I had the below example where a class definition is needed at .net side to map to oracle object. Unfortunately, I did not apply this due to the extra mapping code that is needed.

    My question is: did this change with oracle 12c? Can we now use:

    parameter.UdtTypeName = directOracleUDTName; //without the need for .net definition and mapping classes
    Once again thanks for your tutorial.

    Best Regards,

  3. Oracle apps and Fusion Self Paced Training Videos by Industry Experts. Please Check

  4. Oracle Apps R12 and Oracle Fusion Cloud Self Paced Online Training Videos Published on Udemy with Life Time Access & Live Meeting Support to Clear your Queries. Avail 25% to 80% discount. Please Check for Never Before Offers and Discount Coupon Codes.