Hub Of Geekz

  • Home
  • About Me
  • Contact Us
  • Home
  • Languages
    • C++
    • Java
    • Perl
    • Prolog
    • Bootstrap
  • Database
    • SQL
    • PL/SQL
  • Study
    • Java
      • Java Collection
      • Java Concurrency
      • Java Interview Questions
      • Java Networking
    • Number System
  • Kavita
  • Entertainment
    • Hinglish Cafe
    • Videos
    • Jokes
  • Windows Tricks
  • How To

Thursday, 15 October 2015

PL/SQL Tutorial

 Earthcare Foundation NGO     10:00     PL/SQL, Programming     No comments   


Introduction to PL/SQL

During 1980s we were using the SQL which is not a procedural language, so because of this we were facing a lot of issues. So a new programming language was developed by Oracle Corporation in the late 1980s as procedural extension language for SQL and the Oracle relational database which was named as PL/SQL.
PL/SQL stands for Procedural Language extension of SQL.PL/SQL is a combination of SQL along with the procedural features of programming languages.

Features of PL/SQL

PL/SQL has the following features:
·         PL/SQL is tightly integrated with SQL
·         It offers extensive error checking
·         It is completely portable and high performance language
·         It offers a variety of programming structures
·         It supports structured programming through functions and procedures
·         It supports developing web applications and server pages
·         PL/SQL provides a built-in interpreted and OS independent programming environment.
·         PL/SQL saves time on design and debugging by strong features, such as exception handling, encapsulation, data hiding, and object-oriented data types.
·         Applications written in PL/SQL are fully portable.
·         PL/SQL provides high security level.
·         PL/SQL provides access to predefined SQL packages.

A Simple PL/SQL Block
PL/SQL block consists of 3 sections:
  • The Declaration section (optional).
  • The Execution section (mandatory).
  • The Exception Handling section (optional).
Declaration Section:

This section is optional and is used to declare any placeholders. These placeholders can be variables, constants cursors etc. The Declaration section of a PL/SQL Block starts with the reserved keyword DECLARE.
Execution Section:

Unlike declaration section, it is a mandatory section where the logic of the program will be written. The Execution section of a PL/SQL Block starts with the reserved keyword BEGIN and ends with END. We can use different types of constructs as for, while loops and conditional statements in this section. All the SQL queries will be also part of this section.
Exception Section:

This section is optional. The Exception section of a PL/SQL Block starts with the reserved keyword EXCEPTION. So if we think that there can be any error or exception then we can use this section and handle that exception.

DECLARE
     Variable declaration
BEGIN
     Program Execution
EXCEPTION
     Exception handling
END;

Simple Program:
DECLARE
   msg_to_user  varchar2(20):= 'Hello, World! This is my first program';
BEGIN
   dbms_output.put_line(msg_to_user  );
END;
/

Hello, World! This is my first program
PL/SQL procedure successfully completed.


You might be interested in

Cursor in PL/SQL
Triggers in PL/SQL
Create process in PL/SQL
PL/SQL program to find Greatest
PL/SQL program to get the area of circle
PL/SQL program to print different patterns
PL/SQL program to print Fibonacci Sequence
PL/SQL program to print the factorial of number
PL/SQL program to perform mathematical operations

  • Share This:  
  •  Facebook
  •  Twitter
  •  Google+
  •  Stumble
  •  Digg
Email ThisBlogThis!Share to XShare to Facebook
Newer Post Older Post Home

0 comments:

Post a Comment

Ad


Jobsmag.inIndian Education BlogThingsGuide

Subscribe

Do you want fresh and hot updates about us? Then subscribe to our Feeds.

Total Pageviews

Popular Posts

  • Write a program in PL/SQL to print the factorial of a number.
    In this post I will explain how to get the factorial of any given number. For that first you need to know what is the procedure to find ...
  • To find the GCD of two numbers in PROLOG.
    gcd(X,Y):-X=Y,write('GCD of two numbers is '),write(X); X=0,write('GCD of two numbers is '),write(Y); Y=0,write('G...
  • Write a PL/SQL code to get the Fibonacci Sequence
    First, I will explain what is Fibonacci Sequence and how to get this series. So, Fibonacci Sequence is a series of numbers 0,1,1,2,3,5,8,1...

Label

All Articles Best Resources Blogging Boost Traffic Bootstrap C Plus Plus Collection Comedy Comedy Posts Comedy Videos Concurrency creative commons website Education Employee Entertainment Fibonacci Sequence free images GirlFriend Hinglish Cafe How To Image Websites Inspirational Java Java Interview Questions Java Networking Kavita Sangrah Life Lock Sreen Love Number System Patterns Perl Picture PL/SQL Plastic Engineering Programming Prolog public domain SEO Servlet Short Story Shortcut Keys Social Media Social Services SQL SuVichar Thread Traffic True Events Ultimate Guide Windows Tricks Windows8.1 WordPress

Blog Archive

  • ►  2020 (43)
    • ►  September (41)
    • ►  August (2)
  • ►  2019 (1)
    • ►  July (1)
  • ►  2018 (9)
    • ►  September (7)
    • ►  July (1)
    • ►  May (1)
  • ►  2017 (8)
    • ►  June (3)
    • ►  May (3)
    • ►  March (1)
    • ►  January (1)
  • ►  2016 (2)
    • ►  September (1)
    • ►  January (1)
  • ▼  2015 (91)
    • ►  December (1)
    • ►  November (1)
    • ▼  October (6)
      • Top 5 free and best blogging platforms
      • WordPress:How to create a free blog in 15 minutes
      • Great Topics for a Blog
      • PL/SQL Tutorial
      • Why String is immutable in Java
      • Java program to print patterns
    • ►  May (10)
    • ►  March (20)
    • ►  February (50)
    • ►  January (3)
  • ►  2014 (339)
    • ►  December (1)
    • ►  October (55)
    • ►  September (58)
    • ►  August (94)
    • ►  July (64)
    • ►  June (67)
  • ►  2013 (34)
    • ►  August (5)
    • ►  April (29)
  • ►  2012 (20)
    • ►  November (1)
    • ►  October (15)
    • ►  September (4)

Author

  • Earthcare Foundation NGO
  • Kavita house
  • Unknown
  • Unknown

Info

Copyright © Hub Of Geekz | Powered by Blogger
Design by Hardeep Asrani | Blogger Theme by NewBloggerThemes.com | Distributed By Gooyaabi Templates