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

PDF
SQL Fundamentals - Lecture 2
PDF
Oracle SQL Fundamentals - Lecture 3
PDF
Data Manipulation(DML) and Transaction Control (TCL)
PDF
Basics of SELECT Statement - Oracle SQL
PDF
SQL Functions - Oracle SQL Fundamentals
PPTX
Sql basic things
PPT
Sql basics and DDL statements
SQL Fundamentals - Lecture 2
Oracle SQL Fundamentals - Lecture 3
Data Manipulation(DML) and Transaction Control (TCL)
Basics of SELECT Statement - Oracle SQL
SQL Functions - Oracle SQL Fundamentals
Sql basic things
Sql basics and DDL statements

What's hot (19)

PPTX
SQL: Structured Query Language
ODP
PPTX
SQL-Alter Table, SELECT DISTINCT & WHERE
PPTX
SQL(DDL & DML)
PPTX
Database constraints
PPTX
Database Management - Lecture 2 - SQL select, insert, update and delete
PDF
Sql delete, truncate, drop statements
PPTX
STRUCTURE OF SQL QUERIES
PPT
SQL Tutorial - Basic Commands
PPT
Sql DML
PPTX
3. ddl create
PPTX
Creating database using sql commands
PPTX
Oracle SQL DML Statements
PDF
Sql commands
PPTX
2. DML_INSERT_DELETE_UPDATE
PPTX
Oracle SQL - Select Part -1 let's write some queries!
PPTX
Clase 13 integridad modificada
SQL: Structured Query Language
SQL-Alter Table, SELECT DISTINCT & WHERE
SQL(DDL & DML)
Database constraints
Database Management - Lecture 2 - SQL select, insert, update and delete
Sql delete, truncate, drop statements
STRUCTURE OF SQL QUERIES
SQL Tutorial - Basic Commands
Sql DML
3. ddl create
Creating database using sql commands
Oracle SQL DML Statements
Sql commands
2. DML_INSERT_DELETE_UPDATE
Oracle SQL - Select Part -1 let's write some queries!
Clase 13 integridad modificada
Ad

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

PPT
PPT
Producing Readable Output with iSQL*Plus - Oracle Data Base
PPSX
PDF
Sql coding-standard-sqlserver
PDF
Database development coding standards
PPTX
PPTX
PLSQL.pptx
PPTX
PL_SQL - II.pptx
PPTX
SignalR & SQL Dependency
PPT
PL/SQL Stored Procedures And Cursors.ppt
PPTX
Data weave (MuleSoft)
PPT
Introduction to c
DOC
3963066 pl-sql-notes-only
PPT
03 Writing Control Structures, Writing with Compatible Data Types Using Expli...
PPTX
Lab1 select statement
PDF
Parameter substitution in Aginity Workbench
PPTX
SQL LECTURE.pptx
PPTX
Pl sql Prograaming of Database management system
PPTX
Stored procedure tunning
PPTX
Structure query language (sql)
Producing Readable Output with iSQL*Plus - Oracle Data Base
Sql coding-standard-sqlserver
Database development coding standards
PLSQL.pptx
PL_SQL - II.pptx
SignalR & SQL Dependency
PL/SQL Stored Procedures And Cursors.ppt
Data weave (MuleSoft)
Introduction to c
3963066 pl-sql-notes-only
03 Writing Control Structures, Writing with Compatible Data Types Using Expli...
Lab1 select statement
Parameter substitution in Aginity Workbench
SQL LECTURE.pptx
Pl sql Prograaming of Database management system
Stored procedure tunning
Structure query language (sql)
Ad

Recently uploaded (20)

PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PPTX
The various Industrial Revolutions .pptx
PPTX
Chapter 5: Probability Theory and Statistics
PPTX
observCloud-Native Containerability and monitoring.pptx
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
A comparative study of natural language inference in Swahili using monolingua...
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
August Patch Tuesday
PDF
Getting Started with Data Integration: FME Form 101
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PDF
Architecture types and enterprise applications.pdf
Assigned Numbers - 2025 - Bluetooth® Document
WOOl fibre morphology and structure.pdf for textiles
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
The various Industrial Revolutions .pptx
Chapter 5: Probability Theory and Statistics
observCloud-Native Containerability and monitoring.pptx
Final SEM Unit 1 for mit wpu at pune .pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
CloudStack 4.21: First Look Webinar slides
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
A comparative study of natural language inference in Swahili using monolingua...
O2C Customer Invoices to Receipt V15A.pptx
Benefits of Physical activity for teenagers.pptx
August Patch Tuesday
Getting Started with Data Integration: FME Form 101
Univ-Connecticut-ChatGPT-Presentaion.pdf
A contest of sentiment analysis: k-nearest neighbor versus neural network
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Architecture types and enterprise applications.pdf

SQL Readable Outputs - Oracle SQL Fundamentals