SlideShare a Scribd company logo
1 of 32
Producing Readable Output  with  i SQL*Plus
Objectives ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Substitution Variables I want to query different values. ... salary = ? … …  department_id = ? …  ... last_name = ? ... User
Substitution Variables ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Using the  &  Substitution Variable ,[object Object],SELECT employee_id, last_name, salary, department_id FROM employees WHERE employee_id = &employee_num ;
Using the  &  Substitution Variable 101 1 2
Character and Date Values  with Substitution Variables ,[object Object],[object Object],SELECT last_name, department_id, salary*12 FROM  employees WHERE  job_id = '&job_title' ;
Specifying Column Names,  Expressions, and Text ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Specifying Column Names,  Expressions, and Text SELECT employee_id, last_name, job_id,  &column_name FROM employees WHERE &condition ORDER BY &order_column ;
Defining Substitution Variables ,[object Object],[object Object],[object Object],[object Object]
DEFINE  and  UNDEFINE  Commands ,[object Object],[object Object],[object Object],[object Object],DEFINE job_title = IT_PROG DEFINE job_title DEFINE JOB_TITLE  = "IT_PROG" (CHAR) UNDEFINE job_title DEFINE job_title SP2-0135: symbol job_title is UNDEFINED
Using the  DEFINE  Command with  &  Substitution Variable ,[object Object],[object Object],SELECT employee_id, last_name, salary, department_id FROM  employees WHERE  employee_id = &employee_num ; DEFINE employee_num = 200
Using the  &&  Substitution Variable SELECT  employee_id, last_name, job_id, &&column_name FROM  employees ORDER BY &column_name; Use the double-ampersand ( && ) if you want to reuse  the variable value without prompting the user each  time. …
Using the  VERIFY  Command ,[object Object],[object Object],[object Object],old  3: WHERE  employee_id = &employee_num new  3: WHERE  employee_id = 200 SET VERIFY ON SELECT employee_id, last_name, salary, department_id FROM  employees WHERE  employee_id = &employee_num;
Customizing the  i SQL*Plus Environment ,[object Object],[object Object],SET ECHO ON SHOW ECHO echo ON SET  system_variable value
SET  Command Variables ,[object Object],[object Object],[object Object],[object Object],SET HEADING OFF SHOW HEADING HEADING OFF
i SQL*Plus Format Commands ,[object Object],[object Object],[object Object],[object Object]
The  COLUMN  Command ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],COL[UMN] [{ column | alias }   [ option ]]
Using the  COLUMN  Command ,[object Object],COLUMN last_name HEADING 'Employee|Name'  COLUMN salary JUSTIFY LEFT FORMAT $99,990.00 COLUMN manager FORMAT 999999999 NULL 'No manager' COLUMN last_name COLUMN last_name CLEAR ,[object Object],[object Object]
COLUMN  Format Models Result 1234 001234  $1234  L1234  1234.00 1,234 Example 999999  099999  $9999  L9999 9999.99 9,999 Element 9 0 $ L . , Description Single zero-suppression digit Enforces leading zero Floating dollar sign Local currency Position of decimal point Thousand separator
Using the  BREAK  Command ,[object Object],BREAK ON job_id
Using the  TTITLE  and  BTITLE  Commands ,[object Object],[object Object],[object Object],TTI[TLE] [ text |OFF|ON] TTITLE 'Salary|Report' BTITLE 'Confidential'
Using the  TTITLE  and  BTITLE  Commands ,[object Object],[object Object],[object Object],TTI[TLE] [ text |OFF|ON] TTITLE 'Salary|Report' BTITLE 'Confidential'
Creating a Script File  to Run a Report ,[object Object],[object Object],[object Object],[object Object],[object Object]
Creating a Script File  to Run a Report ,[object Object],[object Object],[object Object]
Sample Report …
Sample Report …
Summary ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Practice 7 Overview ,[object Object],[object Object],[object Object]
 
 
 

More Related Content

What's hot

Les02 (restricting and sorting data)
Les02 (restricting and sorting data)Les02 (restricting and sorting data)
Les02 (restricting and sorting data)
Achmad Solichin
 

What's hot (20)

Les02
Les02Les02
Les02
 
Sql operators & functions 3
Sql operators & functions 3Sql operators & functions 3
Sql operators & functions 3
 
Oracle - Program with PL/SQL - Lession 04
Oracle - Program with PL/SQL - Lession 04Oracle - Program with PL/SQL - Lession 04
Oracle - Program with PL/SQL - Lession 04
 
Aggregate Functions,Final
Aggregate Functions,FinalAggregate Functions,Final
Aggregate Functions,Final
 
Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)Les09 (using ddl statements to create and manage tables)
Les09 (using ddl statements to create and manage tables)
 
Les01
Les01Les01
Les01
 
Oracle: Basic SQL
Oracle: Basic SQLOracle: Basic SQL
Oracle: Basic SQL
 
Enterprise Data Validation
Enterprise Data ValidationEnterprise Data Validation
Enterprise Data Validation
 
Les04
Les04Les04
Les04
 
Les04
Les04Les04
Les04
 
Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03Oracle - Program with PL/SQL - Lession 03
Oracle - Program with PL/SQL - Lession 03
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functions
 
Oracle - Program with PL/SQL - Lession 05
Oracle - Program with PL/SQL - Lession 05Oracle - Program with PL/SQL - Lession 05
Oracle - Program with PL/SQL - Lession 05
 
Les02 (restricting and sorting data)
Les02 (restricting and sorting data)Les02 (restricting and sorting data)
Les02 (restricting and sorting data)
 
Structured query language functions
Structured query language functionsStructured query language functions
Structured query language functions
 
Oracle - Program with PL/SQL - Lession 08
Oracle - Program with PL/SQL - Lession 08Oracle - Program with PL/SQL - Lession 08
Oracle - Program with PL/SQL - Lession 08
 
Introduction To Oracle Sql
Introduction To Oracle SqlIntroduction To Oracle Sql
Introduction To Oracle Sql
 
Oracle - Program with PL/SQL - Lession 14
Oracle - Program with PL/SQL - Lession 14Oracle - Program with PL/SQL - Lession 14
Oracle - Program with PL/SQL - Lession 14
 
iOS best practices
iOS best practicesiOS best practices
iOS best practices
 
Beginers guide for oracle sql
Beginers guide for oracle sqlBeginers guide for oracle sql
Beginers guide for oracle sql
 

Viewers also liked (6)

Chapter06 Managing Disks And Data Storage
Chapter06      Managing  Disks And  Data  StorageChapter06      Managing  Disks And  Data  Storage
Chapter06 Managing Disks And Data Storage
 
Less05 asm instance
Less05 asm instanceLess05 asm instance
Less05 asm instance
 
Less17 moving data
Less17 moving dataLess17 moving data
Less17 moving data
 
Less07 storage
Less07 storageLess07 storage
Less07 storage
 
Oracle Upgrade11gr1 Workshop1
Oracle Upgrade11gr1 Workshop1Oracle Upgrade11gr1 Workshop1
Oracle Upgrade11gr1 Workshop1
 
Les 15 perf_sql
Les 15 perf_sqlLes 15 perf_sql
Les 15 perf_sql
 

Similar to Les07

e computer notes - Producing readable output with i sql plus
e computer notes - Producing readable output with i sql pluse computer notes - Producing readable output with i sql plus
e computer notes - Producing readable output with i sql plus
ecomputernotes
 
Les08-Oracle
Les08-OracleLes08-Oracle
Les08-Oracle
suman1248
 
Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)
Achmad Solichin
 
e computer notes - Creating views
e computer notes - Creating viewse computer notes - Creating views
e computer notes - Creating views
ecomputernotes
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
Reka
 

Similar to Les07 (20)

e computer notes - Producing readable output with i sql plus
e computer notes - Producing readable output with i sql pluse computer notes - Producing readable output with i sql plus
e computer notes - Producing readable output with i sql plus
 
Les08-Oracle
Les08-OracleLes08-Oracle
Les08-Oracle
 
Producing Readable Output with iSQL*Plus - Oracle Data Base
Producing Readable Output with iSQL*Plus - Oracle Data BaseProducing Readable Output with iSQL*Plus - Oracle Data Base
Producing Readable Output with iSQL*Plus - Oracle Data Base
 
Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)Les01 (retrieving data using the sql select statement)
Les01 (retrieving data using the sql select statement)
 
Les08[1] Producing Readable Output with SQL*Plus
Les08[1] Producing Readable Output with SQL*PlusLes08[1] Producing Readable Output with SQL*Plus
Les08[1] Producing Readable Output with SQL*Plus
 
Chinabankppt
ChinabankpptChinabankppt
Chinabankppt
 
Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09Oracle - Program with PL/SQL - Lession 09
Oracle - Program with PL/SQL - Lession 09
 
Les08 (manipulating data)
Les08 (manipulating data)Les08 (manipulating data)
Les08 (manipulating data)
 
Oracle: Basic SQL
Oracle: Basic SQLOracle: Basic SQL
Oracle: Basic SQL
 
e computer notes - Creating views
e computer notes - Creating viewse computer notes - Creating views
e computer notes - Creating views
 
Les08
Les08Les08
Les08
 
Sql dml & tcl 2
Sql   dml & tcl 2Sql   dml & tcl 2
Sql dml & tcl 2
 
SQL- Introduction to MySQL
SQL- Introduction to MySQLSQL- Introduction to MySQL
SQL- Introduction to MySQL
 
Oracle - Program with PL/SQL - Lession 01
Oracle - Program with PL/SQL - Lession 01Oracle - Program with PL/SQL - Lession 01
Oracle - Program with PL/SQL - Lession 01
 
Dynamic websites lec3
Dynamic websites lec3Dynamic websites lec3
Dynamic websites lec3
 
SQL
SQLSQL
SQL
 
01 basic orders
01   basic orders01   basic orders
01 basic orders
 
Open Gurukul Language PL/SQL
Open Gurukul Language PL/SQLOpen Gurukul Language PL/SQL
Open Gurukul Language PL/SQL
 
Mysqlppt
MysqlpptMysqlppt
Mysqlppt
 
Oracle sql tuning
Oracle sql tuningOracle sql tuning
Oracle sql tuning
 

More from Vijay Kumar (15)

Les20
Les20Les20
Les20
 
Les19
Les19Les19
Les19
 
Les15
Les15Les15
Les15
 
Les16
Les16Les16
Les16
 
Les14
Les14Les14
Les14
 
Les13
Les13Les13
Les13
 
Les12
Les12Les12
Les12
 
Les10
Les10Les10
Les10
 
Les09
Les09Les09
Les09
 
Les08
Les08Les08
Les08
 
Les06
Les06Les06
Les06
 
Les05
Les05Les05
Les05
 
Les04
Les04Les04
Les04
 
Les03
Les03Les03
Les03
 
Les02
Les02Les02
Les02
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 

Les07

  • 1. Producing Readable Output with i SQL*Plus
  • 2.
  • 3. Substitution Variables I want to query different values. ... salary = ? … … department_id = ? … ... last_name = ? ... User
  • 4.
  • 5.
  • 6. Using the & Substitution Variable 101 1 2
  • 7.
  • 8.
  • 9. Specifying Column Names, Expressions, and Text SELECT employee_id, last_name, job_id, &column_name FROM employees WHERE &condition ORDER BY &order_column ;
  • 10.
  • 11.
  • 12.
  • 13. Using the && Substitution Variable SELECT employee_id, last_name, job_id, &&column_name FROM employees ORDER BY &column_name; Use the double-ampersand ( && ) if you want to reuse the variable value without prompting the user each time. …
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. COLUMN Format Models Result 1234 001234 $1234 L1234 1234.00 1,234 Example 999999 099999 $9999 L9999 9999.99 9,999 Element 9 0 $ L . , Description Single zero-suppression digit Enforces leading zero Floating dollar sign Local currency Position of decimal point Thousand separator
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 28.
  • 29.
  • 30.  
  • 31.  
  • 32.  

Editor's Notes

  1. Schedule: Timing Topic 35 minutes Lecture 35 minutes Practice 70 minutes Total