SlideShare a Scribd company logo
SQL Fundamentals Oracle 11g
M U H A M M A D WA H E E D
O R AC L E DATA BA S E D E V E LO P E R
E M A I L : m .wa h e e d 3 6 6 8 @ g m a i l . co m
Lecture#9
Readable Outputs with
iSQL*Plus
Substitution Variables
2
Substitution Variables(cont’d)
Use iSQL*Plus substitution variables to:
• Store values temporarily
- Single ampersand( & )
- Double ampersand( && )
- DEFINE command
•Pass variable values between SQL statements
3
Substitution Variables(cont’d)
Use of & substitution variable:
• Use a variable with pre-fixed ampersand to prompt the user for a value
4
Substitution Variables(cont’d)
Use of character and date substitution variables:
• Use single quotes with character and date values
5
Substitution Variables(cont’d)
Use substitution variables to supplement the following :
•Entire SELECT statements
•Table names
•Column expressions
•WHERE conditions
•ORDER BY clauses
6
Substitution Variables(cont’d)
Use substitution variables to supplement the following :
•Example:
7
Substitution Variables(cont’d)
Use of DEFINE substitution variable:
• Creates a user variable with the CHAR data type
DEFINE variable = value (if value includes spaces than use single quotes to enclose the value)
• A defined variable is available for the session
8
Substitution Variables(cont’d)
Use of DEFINE and UNDEFINE commands:
• A variable remains defined until you either
- Use the UNDEFINE command to clear it
- Exit iSQL*Plus
•You can verify changes with DEFINE command
9
Substitution Variables(cont’d)
Use of && with substitution variables:
• If you want to reuse a variable value without prompting the user each time
10
MERGE Statement
•It performs UPDATE if record exists and INSERT if record not found.
•Mostly used in data warehousing applications.
•Syntax:
MERGE INTO <receiver_table_name> <receiver_table_alias>
USING <sender_table_name> <table_alias>
ON (<receiver_table_alias>.<column_name>= <sender_table_alias>.<column_name>)
WHEN MATCHED THEN
UPDATE SET
<receiver_table_alias>.<column_name> = <sender_table_name>.<column_name>
WHEN NOT MATCHED THEN
INSERT VALUES(<sender_table_name>.<column_name> ,…..);
11
MERGE Statement
•Syntax can be simply described as:
12
Motivational Speaking
13
Feedback/Suggestions?
Give your feedback at: m.waheed3668@gmail.com
The feedback I get is that my books are honest.
- Laurie Halse Anderson

More Related Content

What's hot (19)

PPTX
SQL: Structured Query Language
Rohit Bisht
 
ODP
Sql commands
Balakumaran Arunachalam
 
PPTX
SQL-Alter Table, SELECT DISTINCT & WHERE
I L0V3 CODING DR
 
PPTX
SQL(DDL & DML)
Sharad Dubey
 
PPTX
Database constraints
Khadija Parween
 
PPTX
Database Management - Lecture 2 - SQL select, insert, update and delete
Al-Mamun Sarkar
 
PDF
Sql delete, truncate, drop statements
Vivek Singh
 
PPTX
STRUCTURE OF SQL QUERIES
VENNILAV6
 
PPT
SQL Tutorial - Basic Commands
1keydata
 
PPT
Sql DML
Vikas Gupta
 
PPTX
3. ddl create
Amrit Kaur
 
PPTX
Creating database using sql commands
Belle Wx
 
PPTX
Oracle SQL DML Statements
A Data Guru
 
PDF
Sql commands
Mohd Tousif
 
PPTX
2. DML_INSERT_DELETE_UPDATE
Amrit Kaur
 
PPTX
Oracle SQL - Select Part -1 let's write some queries!
A Data Guru
 
PPTX
Clase 13 integridad modificada
Titiushko Jazz
 
SQL: Structured Query Language
Rohit Bisht
 
SQL-Alter Table, SELECT DISTINCT & WHERE
I L0V3 CODING DR
 
SQL(DDL & DML)
Sharad Dubey
 
Database constraints
Khadija Parween
 
Database Management - Lecture 2 - SQL select, insert, update and delete
Al-Mamun Sarkar
 
Sql delete, truncate, drop statements
Vivek Singh
 
STRUCTURE OF SQL QUERIES
VENNILAV6
 
SQL Tutorial - Basic Commands
1keydata
 
Sql DML
Vikas Gupta
 
3. ddl create
Amrit Kaur
 
Creating database using sql commands
Belle Wx
 
Oracle SQL DML Statements
A Data Guru
 
Sql commands
Mohd Tousif
 
2. DML_INSERT_DELETE_UPDATE
Amrit Kaur
 
Oracle SQL - Select Part -1 let's write some queries!
A Data Guru
 
Clase 13 integridad modificada
Titiushko Jazz
 

Similar to SQL Readable Outputs - Oracle SQL Fundamentals (20)

PPT
Les07
Vijay Kumar
 
PPT
Producing Readable Output with iSQL*Plus - Oracle Data Base
Salman Memon
 
PPSX
Sql2
LuisDeLeon74
 
PDF
Sql coding-standard-sqlserver
lochaaaa
 
PDF
Database development coding standards
Alessandro Baratella
 
PPTX
Pointer
khyati thakkar
 
PPTX
PLSQL.pptx
git21is061t
 
PPTX
PL_SQL - II.pptx
priyaprakash11
 
PPTX
SignalR & SQL Dependency
Narato
 
PPT
PL/SQL Stored Procedures And Cursors.ppt
sonaligaikwad281110
 
PPTX
Data weave (MuleSoft)
Nandu List5
 
PPT
Introduction to c
sunila tharagaturi
 
DOC
3963066 pl-sql-notes-only
Ashwin Kumar
 
PPT
03 Writing Control Structures, Writing with Compatible Data Types Using Expli...
rehaniltifat
 
PPTX
Lab1 select statement
Balqees Al.Mubarak
 
PDF
Parameter substitution in Aginity Workbench
Mary Uguet
 
PPTX
SQL LECTURE.pptx
TechnoSavage
 
PPTX
Pl sql Prograaming of Database management system
AjitPatil801582
 
PPTX
Stored procedure tunning
Virendra Yaduvanshi
 
PPTX
Structure query language (sql)
Nalina Kumari
 
Producing Readable Output with iSQL*Plus - Oracle Data Base
Salman Memon
 
Sql coding-standard-sqlserver
lochaaaa
 
Database development coding standards
Alessandro Baratella
 
PLSQL.pptx
git21is061t
 
PL_SQL - II.pptx
priyaprakash11
 
SignalR & SQL Dependency
Narato
 
PL/SQL Stored Procedures And Cursors.ppt
sonaligaikwad281110
 
Data weave (MuleSoft)
Nandu List5
 
Introduction to c
sunila tharagaturi
 
3963066 pl-sql-notes-only
Ashwin Kumar
 
03 Writing Control Structures, Writing with Compatible Data Types Using Expli...
rehaniltifat
 
Lab1 select statement
Balqees Al.Mubarak
 
Parameter substitution in Aginity Workbench
Mary Uguet
 
SQL LECTURE.pptx
TechnoSavage
 
Pl sql Prograaming of Database management system
AjitPatil801582
 
Stored procedure tunning
Virendra Yaduvanshi
 
Structure query language (sql)
Nalina Kumari
 
Ad

Recently uploaded (20)

PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PPTX
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
PDF
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
PPTX
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
PDF
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PDF
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
PDF
Next level data operations using Power Automate magic
Andries den Haan
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
DoS Attack vs DDoS Attack_ The Silent Wars of the Internet.pdf
CyberPro Magazine
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Quantum AI Discoveries: Fractal Patterns Consciousness and Cyclical Universes
Saikat Basu
 
Next level data operations using Power Automate magic
Andries den Haan
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
How to Visualize the ​Spatio-Temporal Data Using CesiumJS​
SANGHEE SHIN
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
 
Ad

SQL Readable Outputs - Oracle SQL Fundamentals