SlideShare a Scribd company logo
PL/SQL Introduction
Q.> What is PL/SQL?
Ans.> PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's procedural extension for
SQL and the Oracle relational database. PL/SQL is available in Oracle Database (since version 7). PL/SQL
(Procedural Language extensions to SQL) is designed specifically for the seamless processing of SQL commands.
PL/SQL stored and compiled in the database, runs within the Oracle executable and inherits the robustness,
security, and portability of the Oracle Database. PL/SQL is a combination of SQL along with the procedural features
of programming languages.
Features of PL/SQL
 block (modular) structure
 flow-control statements and loops
 variables, constants, and types
 structured data
 customized error handling
 it allows you to store compiled code directly in the database.
 once a given block of code is loaded into memory, any number of users can use the same copy of it
simultaneously (although behavior is as though each user had her own copy), which is useful for the
Oracle WebServer.
 enables you to define triggers, which are subprograms that the database executes automatically in
response to specified events.
 is tightly integrated with SQL.
 offers extensive error checking.
 supports object-oriented programming.
 It supports developing web applications and server pages.
PL/SQL Syntax PL/SQL block consists of three sub-parts:
 DECLARATIONS
 EXECUTABLE COMMANDS
 EXCEPTION HANDLING DECLARATIONS
This section includes the declarations for variables, cursors, sub-programs, and other elements to be used
in the program.
This section starts with DECLARE keyword.
This section is optional.
EXECUTABLE COMMANDS This section includes executable PL/SQL statements of the program. It
should have at least one executable line of code. This section starts with BEGIN keyword and ends with
END; keyword. This section is mandatory.
EXCEPTION HANDLING This section includes exception(s) that handle errors in the program. This
section starts with EXCEPTION keyword and is placed between BEGIN and END;
Basic structure:
DECLARE
<declarations sections>
BEGIN
<executable command(s)>
EXCEPTION
<exception handling>
END;
Using Comments:
 Single line comments:
Single line comments can be written as:
-- Single line Comment
 Multi-line comments:
Multi-line comments can be written as:
/* Multi-line Comment */
Declaring Variables:
Syntax:
Variable_name data_type;
Or
Variable_name data_type:=value;
Or
Variable_name data_type DEFAULT value;
For example:
vSalary number;
or
vSalary number:=1000;
or
vSalary number DEFAULT 1000;
You can also use CONSTANT and NOT NULL as:
Variable_name CONSTANT data_type NOT NULL :=value;
For example:
vMax CONSTANT number NOT NULL:=100;
When you use CONSTANT or NOT NULL then you must initialize the variable.
PL/SQL identifiers are constants, variables, exceptions, procedures, cursors, and reserved words. The
identifiers consist of a letter optionally followed by more letters, numerals, dollar signs, underscores, and
number signs and should not exceed 30 characters. By default, identifiers are not case-sensitive. So you
can use integer or INTEGER to represent a numeric value. You cannot use a reserved keyword as an
identifier.
Printing a message
To print a message use:
dbms_output.put_line(‘message’);
To concatenate use ||
dbms_output.put_line(‘message1’||’message2’);
dbms_output.put_line(‘Employee Id: ’||65489);
To print value of a variable use:
dbms_output.put_line(‘Value: ’||variable_name);
Sample PL/SQL Program:
DECLARE
vMessage varchar2(50):=’Welcome to PL/SQL’;
BEGIN
dbms_output.put_line(vMessage);
END;
/
The END; line signals the end of the PL/SQL block. To run the code from SQL command line, you may
need to type / at the beginning of the first blank line after the last line of the code. When the above code is
executed at SQL prompt, it produces the following result:
Welcome to PL/SQL
PL/SQL procedure successfully completed.
Visit: http://pictorialpoint.blogspot.in
Pl sql

More Related Content

What's hot

PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
Bharat Kalia
 
PL/SQL Fundamentals I
PL/SQL Fundamentals IPL/SQL Fundamentals I
PL/SQL Fundamentals I
Nick Buytaert
 
Plsql
PlsqlPlsql
Oracle PL/SQL online training | PL/SQL online Training
Oracle PL/SQL online training | PL/SQL online TrainingOracle PL/SQL online training | PL/SQL online Training
Oracle PL/SQL online training | PL/SQL online Training
suresh
 
pl/sql Procedure
pl/sql Procedurepl/sql Procedure
pl/sql Procedure
Pooja Dixit
 
Pl sql content
Pl sql contentPl sql content
Pl sql content
MargaretMaryT
 
PLSQL Tutorial
PLSQL TutorialPLSQL Tutorial
PLSQL Tutorial
Quang Minh Đoàn
 
Exception handling in plsql
Exception handling in plsqlException handling in plsql
Exception handling in plsql
Arun Sial
 
ORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERSORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERS
mohdoracle
 
PLSQL Cursors
PLSQL CursorsPLSQL Cursors
PLSQL Cursors
spin_naresh
 
Oracle: Cursors
Oracle: CursorsOracle: Cursors
Oracle: Cursors
DataminingTools Inc
 
Introduction to PL/SQL
Introduction to PL/SQLIntroduction to PL/SQL
Introduction to PL/SQL
Kailash N
 
Basic cursors in oracle
Basic cursors in oracleBasic cursors in oracle
Basic cursors in oracle
Suhel Firdus
 
PL/SQL Complete Tutorial. All Topics Covered
PL/SQL Complete Tutorial. All Topics CoveredPL/SQL Complete Tutorial. All Topics Covered
PL/SQL Complete Tutorial. All Topics Covered
Danish Mehraj
 
Coding standards
Coding standardsCoding standards
Coding standards
mallareddy0107
 
Trigger and cursor program using sql
Trigger and cursor program using sqlTrigger and cursor program using sql
Trigger and cursor program using sql
Sushil Mishra
 
PLSQL
PLSQLPLSQL
Oracle etl openworld
Oracle etl openworldOracle etl openworld
Oracle etl openworld
Rodrigo Bastos
 

What's hot (18)

PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts PL/SQL Introduction and Concepts
PL/SQL Introduction and Concepts
 
PL/SQL Fundamentals I
PL/SQL Fundamentals IPL/SQL Fundamentals I
PL/SQL Fundamentals I
 
Plsql
PlsqlPlsql
Plsql
 
Oracle PL/SQL online training | PL/SQL online Training
Oracle PL/SQL online training | PL/SQL online TrainingOracle PL/SQL online training | PL/SQL online Training
Oracle PL/SQL online training | PL/SQL online Training
 
pl/sql Procedure
pl/sql Procedurepl/sql Procedure
pl/sql Procedure
 
Pl sql content
Pl sql contentPl sql content
Pl sql content
 
PLSQL Tutorial
PLSQL TutorialPLSQL Tutorial
PLSQL Tutorial
 
Exception handling in plsql
Exception handling in plsqlException handling in plsql
Exception handling in plsql
 
ORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERSORACLE PL SQL FOR BEGINNERS
ORACLE PL SQL FOR BEGINNERS
 
PLSQL Cursors
PLSQL CursorsPLSQL Cursors
PLSQL Cursors
 
Oracle: Cursors
Oracle: CursorsOracle: Cursors
Oracle: Cursors
 
Introduction to PL/SQL
Introduction to PL/SQLIntroduction to PL/SQL
Introduction to PL/SQL
 
Basic cursors in oracle
Basic cursors in oracleBasic cursors in oracle
Basic cursors in oracle
 
PL/SQL Complete Tutorial. All Topics Covered
PL/SQL Complete Tutorial. All Topics CoveredPL/SQL Complete Tutorial. All Topics Covered
PL/SQL Complete Tutorial. All Topics Covered
 
Coding standards
Coding standardsCoding standards
Coding standards
 
Trigger and cursor program using sql
Trigger and cursor program using sqlTrigger and cursor program using sql
Trigger and cursor program using sql
 
PLSQL
PLSQLPLSQL
PLSQL
 
Oracle etl openworld
Oracle etl openworldOracle etl openworld
Oracle etl openworld
 

Viewers also liked

DP & Shakespeare
DP & ShakespeareDP & Shakespeare
DP & Shakespeare
Bengt & Maarit de Paulis
 
Pl sql
Pl sqlPl sql
Why SoftLayer? なぜ、EC/通販統合パッケージリーダーのエルテックスは、SoftLayerを選んだのか?
Why SoftLayer? なぜ、EC/通販統合パッケージリーダーのエルテックスは、SoftLayerを選んだのか?Why SoftLayer? なぜ、EC/通販統合パッケージリーダーのエルテックスは、SoftLayerを選んだのか?
Why SoftLayer? なぜ、EC/通販統合パッケージリーダーのエルテックスは、SoftLayerを選んだのか?
softlayerjp
 
Agile fundamentals
Agile fundamentalsAgile fundamentals
Agile fundamentals
Anton Zhukov
 
sv Principerna & uppståndelse
sv Principerna & uppståndelsesv Principerna & uppståndelse
sv Principerna & uppståndelse
Bengt & Maarit de Paulis
 
センサテクノロジー Sensor Medal, Sensor Shieldの ご紹介
センサテクノロジー Sensor Medal, Sensor Shieldの ご紹介センサテクノロジー Sensor Medal, Sensor Shieldの ご紹介
センサテクノロジー Sensor Medal, Sensor Shieldの ご紹介
ROHM Semiconductor
 
Monacaソリューションセミナー20160621
Monacaソリューションセミナー20160621Monacaソリューションセミナー20160621
Monacaソリューションセミナー20160621
アシアル株式会社
 
Phonology areeya039
Phonology areeya039Phonology areeya039
Phonology areeya039
Areeya Hongsuwan
 
HTML5プロフェッショナル認定試験対策講座
HTML5プロフェッショナル認定試験対策講座HTML5プロフェッショナル認定試験対策講座
HTML5プロフェッショナル認定試験対策講座
アシアル株式会社
 
Haar like feature
Haar like featureHaar like feature
Haar like feature
czech0923
 
IoT×Emotion
IoT×EmotionIoT×Emotion
IoT×Emotion
Takaaki Shimoji
 
20151015 iotlt
20151015 iotlt20151015 iotlt
20151015 iotlt
Daiki Nakamura
 
Cell phone jammer pdf
Cell phone jammer pdfCell phone jammer pdf
Cell phone jammer pdf
Manu M
 
SEJ 2016 in Osaka KAITとの共同出展ご案内
SEJ 2016 in Osaka KAITとの共同出展ご案内SEJ 2016 in Osaka KAITとの共同出展ご案内
SEJ 2016 in Osaka KAITとの共同出展ご案内
sonycsl
 
GSM Security
GSM SecurityGSM Security
GSM Security
smita gupta
 

Viewers also liked (15)

DP & Shakespeare
DP & ShakespeareDP & Shakespeare
DP & Shakespeare
 
Pl sql
Pl sqlPl sql
Pl sql
 
Why SoftLayer? なぜ、EC/通販統合パッケージリーダーのエルテックスは、SoftLayerを選んだのか?
Why SoftLayer? なぜ、EC/通販統合パッケージリーダーのエルテックスは、SoftLayerを選んだのか?Why SoftLayer? なぜ、EC/通販統合パッケージリーダーのエルテックスは、SoftLayerを選んだのか?
Why SoftLayer? なぜ、EC/通販統合パッケージリーダーのエルテックスは、SoftLayerを選んだのか?
 
Agile fundamentals
Agile fundamentalsAgile fundamentals
Agile fundamentals
 
sv Principerna & uppståndelse
sv Principerna & uppståndelsesv Principerna & uppståndelse
sv Principerna & uppståndelse
 
センサテクノロジー Sensor Medal, Sensor Shieldの ご紹介
センサテクノロジー Sensor Medal, Sensor Shieldの ご紹介センサテクノロジー Sensor Medal, Sensor Shieldの ご紹介
センサテクノロジー Sensor Medal, Sensor Shieldの ご紹介
 
Monacaソリューションセミナー20160621
Monacaソリューションセミナー20160621Monacaソリューションセミナー20160621
Monacaソリューションセミナー20160621
 
Phonology areeya039
Phonology areeya039Phonology areeya039
Phonology areeya039
 
HTML5プロフェッショナル認定試験対策講座
HTML5プロフェッショナル認定試験対策講座HTML5プロフェッショナル認定試験対策講座
HTML5プロフェッショナル認定試験対策講座
 
Haar like feature
Haar like featureHaar like feature
Haar like feature
 
IoT×Emotion
IoT×EmotionIoT×Emotion
IoT×Emotion
 
20151015 iotlt
20151015 iotlt20151015 iotlt
20151015 iotlt
 
Cell phone jammer pdf
Cell phone jammer pdfCell phone jammer pdf
Cell phone jammer pdf
 
SEJ 2016 in Osaka KAITとの共同出展ご案内
SEJ 2016 in Osaka KAITとの共同出展ご案内SEJ 2016 in Osaka KAITとの共同出展ご案内
SEJ 2016 in Osaka KAITとの共同出展ご案内
 
GSM Security
GSM SecurityGSM Security
GSM Security
 

Similar to Pl sql

PL SQL.pptx in computer language in database
PL SQL.pptx in computer language in databasePL SQL.pptx in computer language in database
PL SQL.pptx in computer language in database
ironman82715
 
pl_sql.ppt
pl_sql.pptpl_sql.ppt
pl_sql.ppt
Prabhat106214
 
What does PL_SQL stand for and what is the functioning of PL_SQL.docx
What does PL_SQL stand for and what is the functioning of PL_SQL.docxWhat does PL_SQL stand for and what is the functioning of PL_SQL.docx
What does PL_SQL stand for and what is the functioning of PL_SQL.docx
shivanikaale214
 
3963066 pl-sql-notes-only
3963066 pl-sql-notes-only3963066 pl-sql-notes-only
3963066 pl-sql-notes-only
Ashwin Kumar
 
Pl sql chapter 1
Pl sql chapter 1Pl sql chapter 1
Pl sql chapter 1
PrabhatKumar591
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
pooja_123
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
sweetysweety8
 
PLSQL.pptx
PLSQL.pptxPLSQL.pptx
PLSQL.pptx
git21is061t
 
B.Sc. II (IV Sem) RDBMS & PL/SQL Unit-5 PL/SQL, Cursor and Trigger
B.Sc. II (IV Sem) RDBMS & PL/SQL Unit-5 PL/SQL, Cursor and TriggerB.Sc. II (IV Sem) RDBMS & PL/SQL Unit-5 PL/SQL, Cursor and Trigger
B.Sc. II (IV Sem) RDBMS & PL/SQL Unit-5 PL/SQL, Cursor and Trigger
Assistant Professor, Shri Shivaji Science College, Amravati
 
Cordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to JavascriptCordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to Javascript
Binu Paul
 
embedded-static-&dynamic
embedded-static-&dynamicembedded-static-&dynamic
embedded-static-&dynamic
Saranya Natarajan
 
Introduction to PLSQL.PPT
Introduction to PLSQL.PPTIntroduction to PLSQL.PPT
Introduction to PLSQL.PPT
SujayaBiju
 
Pl sql
Pl sqlPl sql
Pl sql
Pl sqlPl sql
Pl sql
Pl sqlPl sql
Advanced_SQL_ISASasASasaASnjection (1).ppt
Advanced_SQL_ISASasASasaASnjection (1).pptAdvanced_SQL_ISASasASasaASnjection (1).ppt
Advanced_SQL_ISASasASasaASnjection (1).ppt
ssuserde23af
 
Oracle: PLSQL Introduction
Oracle: PLSQL IntroductionOracle: PLSQL Introduction
Oracle: PLSQL Introduction
DataminingTools Inc
 
Oracle: PLSQL Introduction
Oracle: PLSQL IntroductionOracle: PLSQL Introduction
Oracle: PLSQL Introduction
oracle content
 
Dbms 2011
Dbms 2011Dbms 2011
Dbms 2011
Atiqa Khan
 
Oracle DBA interview_questions
Oracle DBA interview_questionsOracle DBA interview_questions
Oracle DBA interview_questions
Naveen P
 

Similar to Pl sql (20)

PL SQL.pptx in computer language in database
PL SQL.pptx in computer language in databasePL SQL.pptx in computer language in database
PL SQL.pptx in computer language in database
 
pl_sql.ppt
pl_sql.pptpl_sql.ppt
pl_sql.ppt
 
What does PL_SQL stand for and what is the functioning of PL_SQL.docx
What does PL_SQL stand for and what is the functioning of PL_SQL.docxWhat does PL_SQL stand for and what is the functioning of PL_SQL.docx
What does PL_SQL stand for and what is the functioning of PL_SQL.docx
 
3963066 pl-sql-notes-only
3963066 pl-sql-notes-only3963066 pl-sql-notes-only
3963066 pl-sql-notes-only
 
Pl sql chapter 1
Pl sql chapter 1Pl sql chapter 1
Pl sql chapter 1
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
 
PLSQL.pptx
PLSQL.pptxPLSQL.pptx
PLSQL.pptx
 
B.Sc. II (IV Sem) RDBMS & PL/SQL Unit-5 PL/SQL, Cursor and Trigger
B.Sc. II (IV Sem) RDBMS & PL/SQL Unit-5 PL/SQL, Cursor and TriggerB.Sc. II (IV Sem) RDBMS & PL/SQL Unit-5 PL/SQL, Cursor and Trigger
B.Sc. II (IV Sem) RDBMS & PL/SQL Unit-5 PL/SQL, Cursor and Trigger
 
Cordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to JavascriptCordova training : Day 3 - Introduction to Javascript
Cordova training : Day 3 - Introduction to Javascript
 
embedded-static-&dynamic
embedded-static-&dynamicembedded-static-&dynamic
embedded-static-&dynamic
 
Introduction to PLSQL.PPT
Introduction to PLSQL.PPTIntroduction to PLSQL.PPT
Introduction to PLSQL.PPT
 
Pl sql
Pl sqlPl sql
Pl sql
 
Pl sql
Pl sqlPl sql
Pl sql
 
Pl sql
Pl sqlPl sql
Pl sql
 
Advanced_SQL_ISASasASasaASnjection (1).ppt
Advanced_SQL_ISASasASasaASnjection (1).pptAdvanced_SQL_ISASasASasaASnjection (1).ppt
Advanced_SQL_ISASasASasaASnjection (1).ppt
 
Oracle: PLSQL Introduction
Oracle: PLSQL IntroductionOracle: PLSQL Introduction
Oracle: PLSQL Introduction
 
Oracle: PLSQL Introduction
Oracle: PLSQL IntroductionOracle: PLSQL Introduction
Oracle: PLSQL Introduction
 
Dbms 2011
Dbms 2011Dbms 2011
Dbms 2011
 
Oracle DBA interview_questions
Oracle DBA interview_questionsOracle DBA interview_questions
Oracle DBA interview_questions
 

More from nikhilsh66131

Pl sql
Pl sqlPl sql
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
nikhilsh66131
 
Html beginners tutorial
Html beginners tutorialHtml beginners tutorial
Html beginners tutorial
nikhilsh66131
 
Bubble and-merge-sort
Bubble and-merge-sortBubble and-merge-sort
Bubble and-merge-sort
nikhilsh66131
 
Java ppt2
Java ppt2Java ppt2
Java ppt2
nikhilsh66131
 
Java ppt2
Java ppt2Java ppt2
Java ppt2
nikhilsh66131
 
Java ppt1
Java ppt1Java ppt1
Java ppt1
nikhilsh66131
 

More from nikhilsh66131 (7)

Pl sql
Pl sqlPl sql
Pl sql
 
Introduction to css
Introduction to cssIntroduction to css
Introduction to css
 
Html beginners tutorial
Html beginners tutorialHtml beginners tutorial
Html beginners tutorial
 
Bubble and-merge-sort
Bubble and-merge-sortBubble and-merge-sort
Bubble and-merge-sort
 
Java ppt2
Java ppt2Java ppt2
Java ppt2
 
Java ppt2
Java ppt2Java ppt2
Java ppt2
 
Java ppt1
Java ppt1Java ppt1
Java ppt1
 

Recently uploaded

Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
EduSkills OECD
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
Celine George
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
GeorgeMilliken2
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
Wahiba Chair Training & Consulting
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
Jyoti Chand
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
imrankhan141184
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
WaniBasim
 

Recently uploaded (20)

Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptxBeyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
Beyond Degrees - Empowering the Workforce in the Context of Skills-First.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17How to Make a Field Mandatory in Odoo 17
How to Make a Field Mandatory in Odoo 17
 
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
What is Digital Literacy? A guest blog from Andy McLaughlin, University of Ab...
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience How to Create a More Engaging and Human Online Learning Experience
How to Create a More Engaging and Human Online Learning Experience
 
Wound healing PPT
Wound healing PPTWound healing PPT
Wound healing PPT
 
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
Traditional Musical Instruments of Arunachal Pradesh and Uttar Pradesh - RAYH...
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Liberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdfLiberal Approach to the Study of Indian Politics.pdf
Liberal Approach to the Study of Indian Politics.pdf
 

Pl sql

  • 2. Q.> What is PL/SQL? Ans.> PL/SQL (Procedural Language/Structured Query Language) is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database (since version 7). PL/SQL (Procedural Language extensions to SQL) is designed specifically for the seamless processing of SQL commands. PL/SQL stored and compiled in the database, runs within the Oracle executable and inherits the robustness, security, and portability of the Oracle Database. PL/SQL is a combination of SQL along with the procedural features of programming languages. Features of PL/SQL  block (modular) structure  flow-control statements and loops  variables, constants, and types  structured data  customized error handling  it allows you to store compiled code directly in the database.  once a given block of code is loaded into memory, any number of users can use the same copy of it simultaneously (although behavior is as though each user had her own copy), which is useful for the Oracle WebServer.  enables you to define triggers, which are subprograms that the database executes automatically in response to specified events.  is tightly integrated with SQL.  offers extensive error checking.  supports object-oriented programming.  It supports developing web applications and server pages.
  • 3. PL/SQL Syntax PL/SQL block consists of three sub-parts:  DECLARATIONS  EXECUTABLE COMMANDS  EXCEPTION HANDLING DECLARATIONS This section includes the declarations for variables, cursors, sub-programs, and other elements to be used in the program. This section starts with DECLARE keyword. This section is optional. EXECUTABLE COMMANDS This section includes executable PL/SQL statements of the program. It should have at least one executable line of code. This section starts with BEGIN keyword and ends with END; keyword. This section is mandatory. EXCEPTION HANDLING This section includes exception(s) that handle errors in the program. This section starts with EXCEPTION keyword and is placed between BEGIN and END; Basic structure: DECLARE <declarations sections> BEGIN <executable command(s)> EXCEPTION <exception handling> END; Using Comments:  Single line comments: Single line comments can be written as: -- Single line Comment  Multi-line comments: Multi-line comments can be written as: /* Multi-line Comment */
  • 4. Declaring Variables: Syntax: Variable_name data_type; Or Variable_name data_type:=value; Or Variable_name data_type DEFAULT value; For example: vSalary number; or vSalary number:=1000; or vSalary number DEFAULT 1000; You can also use CONSTANT and NOT NULL as: Variable_name CONSTANT data_type NOT NULL :=value; For example: vMax CONSTANT number NOT NULL:=100; When you use CONSTANT or NOT NULL then you must initialize the variable. PL/SQL identifiers are constants, variables, exceptions, procedures, cursors, and reserved words. The identifiers consist of a letter optionally followed by more letters, numerals, dollar signs, underscores, and number signs and should not exceed 30 characters. By default, identifiers are not case-sensitive. So you can use integer or INTEGER to represent a numeric value. You cannot use a reserved keyword as an identifier.
  • 5. Printing a message To print a message use: dbms_output.put_line(‘message’); To concatenate use || dbms_output.put_line(‘message1’||’message2’); dbms_output.put_line(‘Employee Id: ’||65489); To print value of a variable use: dbms_output.put_line(‘Value: ’||variable_name); Sample PL/SQL Program: DECLARE vMessage varchar2(50):=’Welcome to PL/SQL’; BEGIN dbms_output.put_line(vMessage); END; / The END; line signals the end of the PL/SQL block. To run the code from SQL command line, you may need to type / at the beginning of the first blank line after the last line of the code. When the above code is executed at SQL prompt, it produces the following result: Welcome to PL/SQL PL/SQL procedure successfully completed. Visit: http://pictorialpoint.blogspot.in