After completing this lesson, you should be able to do the following:
Produce queries that require an input variable
Customize the SQL*Plus environment
Produce more readable output
Create and execute script files
Save customizations
After completing this lesson, you should be able to do the following:
List the capabilities of SQL SELECT statements
Execute a basic SELECT statement
Differentiate between SQL statements and SQL*Plus commands
After completing this lesson, you should be able to do the following:
Recognize the significance of the executable section
Write statements in the executable section
Describe the rules of nested blocks
Execute and test a PL/SQL block
Use coding conventions
After completing this lesson, you should be able to do the following:
Describe various types of functions available in SQL
Use character, number, and date functions in SELECT statements
Describe the use of conversion functions
After completing this lesson, you should be able to do the following:
List the benefits of PL/SQL
Recognize the basic PL/SQL block and its sections
Describe the significance of variables in PL/SQL
Declare PL/SQL variables
Execute a PL/SQL block
After completing this lesson, you should be able to do the following:
Describe some database objects and their uses
Create, maintain, and use sequences
Create and maintain indexes
Create private and public synonyms
After completing this lesson, you should be able to do the following:
Write a cursor that uses parameters
Determine when a FOR UPDATE clause in a cursor is required
Determine when to use the WHERE CURRENT OF clause
Write a cursor that uses a subquery
After completing this lesson, you should be able to do the following:
Describe a view
Create a view
Retrieve data through a view
Alter the definition of a view
Insert, update, and delete data through a view
Drop a view
After completing this lesson, you should be able to do the following:
List the capabilities of SQL SELECT statements
Execute a basic SELECT statement
Differentiate between SQL statements and SQL*Plus commands
After completing this lesson, you should be able to do the following:
Recognize the significance of the executable section
Write statements in the executable section
Describe the rules of nested blocks
Execute and test a PL/SQL block
Use coding conventions
After completing this lesson, you should be able to do the following:
Describe various types of functions available in SQL
Use character, number, and date functions in SELECT statements
Describe the use of conversion functions
After completing this lesson, you should be able to do the following:
List the benefits of PL/SQL
Recognize the basic PL/SQL block and its sections
Describe the significance of variables in PL/SQL
Declare PL/SQL variables
Execute a PL/SQL block
After completing this lesson, you should be able to do the following:
Describe some database objects and their uses
Create, maintain, and use sequences
Create and maintain indexes
Create private and public synonyms
After completing this lesson, you should be able to do the following:
Write a cursor that uses parameters
Determine when a FOR UPDATE clause in a cursor is required
Determine when to use the WHERE CURRENT OF clause
Write a cursor that uses a subquery
After completing this lesson, you should be able to do the following:
Describe a view
Create a view
Retrieve data through a view
Alter the definition of a view
Insert, update, and delete data through a view
Drop a view
After completing this lesson, you should be able to do the following:
Write a multiple-column subquery
Describe and explain the behavior of subqueries when null values are retrieved
Write a subquery in a FROM clause
After completing this lesson, you should be able to do the following:
Describe each DML statement
Insert rows into a table
Update rows in a table
Delete rows from a table
Control transactions
After completing this lesson, you should be able to do the following:
Describe the main database objects
Create tables
Describe the datatypes that can be used when specifying column definition
Alter table definitions
Drop, rename, and truncate tables
After completing this lesson, you should be able to do the following:
Write a successful SELECT statement in PL/SQL
Declare the datatype and size of a PL/SQL variable dynamically
Write DML statements in PL/SQL
Control transactions in PL/SQL
Determine the outcome of SQL DML statements
Les05[1]Aggregating Data Using Group Functionssiavosh kaviani
After completing this lesson, you should be able to do the following:
Identify the available group functions
Describe the use of group functions
Group data using the GROUP BY clause
Include or exclude grouped rows by using the HAVING clause
After completing this lesson, you should be able to do the following:
Create user-defined PL/SQL records
Create a record with the %ROWTYPE attribute
Create a PL/SQL table
Create a PL/SQL table of records
Describe the difference between records, tables, and tables of records
After completing this lesson, you should be able to do the following:
Describe the types of problems that subqueries can solve
Define subqueries
List the types of subqueries
Write single-row and multiple-row subqueries
After completing this lesson, you should be able to do the following:
Distinguish between an implicit and an explicit cursor
Use a PL/SQL record variable
Write a cursor FOR loop
After completing this lesson, you should be able to do the following:
Identify the uses and types of control structures
Construct an IF statement
Construct and identify different loop statements
Use logic tables
Control block flow using nested loops and labels
After completing this lesson, you should be able to do the following:
Define PL/SQL exceptions
Recognize unhandled exceptions
List and use different types of PL/SQL exception handlers
Trap unanticipated errors
Describe the effect of exception propagation in nested blocks
Customize PL/SQL exception messages
Producing Readable Output with iSQL*Plus - Oracle Data BaseSalman Memon
After completing this lesson, you should be able to
do the following:
Produce queries that require a substitution variable
Customize the iSQL*Plus environment
Produce more readable output
Create and execute script files
http://phpexecutor.com
Displaying Data from Multiple Tables - Oracle Data BaseSalman Memon
After completing this lesson, you should be able to
do the following:
Write SELECT statements to access data from more than one table using equality and nonequality joins
View data that generally does not meet a join condition by using outer joins
Join a table to itself by using a self join
http://phpexecutor.com
After completing this lesson, you should be able to
do the following:
List the capabilities of SQL SELECT statements
Execute a basic SELECT statement
Differentiate between SQL statements and iSQL*Plus commands
http://phpexecutor.com
Aggregating Data Using Group FunctionsSalman Memon
After completing this lesson, you should be able to
do the following:
Identify the available group functions
Describe the use of group functions
Group data using the GROUP BY clause
Include or exclude grouped rows by using the HAVING clause
http://phpexecutor.com
After completing this lesson, you should be able
to do the following:
Describe a view
Create, alter the definition of, and drop a view
Retrieve data through a view
Insert, update, and delete data througha view
Create and use an inline view
Perform “Top-N” analysis
http://phpexecutor.com
Creating and Managing Tables -Oracle Data base Salman Memon
After completing this lesson, you should be able to
do the following:
Describe the main database objects
Create tables
Describe the data types that can be used when specifying column definition
Alter table definitions
Drop, rename, and truncate tables
http://phpexecutor.com
After completing this lesson, you should be able to
do the following:
Describe each DML statement
Insert rows into a table
Update rows in a table
Delete rows from a table
Merge rows in a table
Control transactions
http://phpexecutor.com
After completing this lesson, you should be able to do the following:
Write a multiple-column subquery
Describe and explain the behavior of subqueries when null values are retrieved
Write a subquery in a FROM clause
After completing this lesson, you should be able to do the following:
Describe each DML statement
Insert rows into a table
Update rows in a table
Delete rows from a table
Control transactions
After completing this lesson, you should be able to do the following:
Describe the main database objects
Create tables
Describe the datatypes that can be used when specifying column definition
Alter table definitions
Drop, rename, and truncate tables
After completing this lesson, you should be able to do the following:
Write a successful SELECT statement in PL/SQL
Declare the datatype and size of a PL/SQL variable dynamically
Write DML statements in PL/SQL
Control transactions in PL/SQL
Determine the outcome of SQL DML statements
Les05[1]Aggregating Data Using Group Functionssiavosh kaviani
After completing this lesson, you should be able to do the following:
Identify the available group functions
Describe the use of group functions
Group data using the GROUP BY clause
Include or exclude grouped rows by using the HAVING clause
After completing this lesson, you should be able to do the following:
Create user-defined PL/SQL records
Create a record with the %ROWTYPE attribute
Create a PL/SQL table
Create a PL/SQL table of records
Describe the difference between records, tables, and tables of records
After completing this lesson, you should be able to do the following:
Describe the types of problems that subqueries can solve
Define subqueries
List the types of subqueries
Write single-row and multiple-row subqueries
After completing this lesson, you should be able to do the following:
Distinguish between an implicit and an explicit cursor
Use a PL/SQL record variable
Write a cursor FOR loop
After completing this lesson, you should be able to do the following:
Identify the uses and types of control structures
Construct an IF statement
Construct and identify different loop statements
Use logic tables
Control block flow using nested loops and labels
After completing this lesson, you should be able to do the following:
Define PL/SQL exceptions
Recognize unhandled exceptions
List and use different types of PL/SQL exception handlers
Trap unanticipated errors
Describe the effect of exception propagation in nested blocks
Customize PL/SQL exception messages
Producing Readable Output with iSQL*Plus - Oracle Data BaseSalman Memon
After completing this lesson, you should be able to
do the following:
Produce queries that require a substitution variable
Customize the iSQL*Plus environment
Produce more readable output
Create and execute script files
http://phpexecutor.com
Displaying Data from Multiple Tables - Oracle Data BaseSalman Memon
After completing this lesson, you should be able to
do the following:
Write SELECT statements to access data from more than one table using equality and nonequality joins
View data that generally does not meet a join condition by using outer joins
Join a table to itself by using a self join
http://phpexecutor.com
After completing this lesson, you should be able to
do the following:
List the capabilities of SQL SELECT statements
Execute a basic SELECT statement
Differentiate between SQL statements and iSQL*Plus commands
http://phpexecutor.com
Aggregating Data Using Group FunctionsSalman Memon
After completing this lesson, you should be able to
do the following:
Identify the available group functions
Describe the use of group functions
Group data using the GROUP BY clause
Include or exclude grouped rows by using the HAVING clause
http://phpexecutor.com
After completing this lesson, you should be able
to do the following:
Describe a view
Create, alter the definition of, and drop a view
Retrieve data through a view
Insert, update, and delete data througha view
Create and use an inline view
Perform “Top-N” analysis
http://phpexecutor.com
Creating and Managing Tables -Oracle Data base Salman Memon
After completing this lesson, you should be able to
do the following:
Describe the main database objects
Create tables
Describe the data types that can be used when specifying column definition
Alter table definitions
Drop, rename, and truncate tables
http://phpexecutor.com
After completing this lesson, you should be able to
do the following:
Describe each DML statement
Insert rows into a table
Update rows in a table
Delete rows from a table
Merge rows in a table
Control transactions
http://phpexecutor.com
Cursores en Oracle PL/SQL, en esta presentación se encuentra información sobre que son, cuando se debe usar, su creación, invocación y también su eliminación.
Les03 Single Row Functions in Oracle and SQL.pptDrZeeshanBhatti
Functions make the basic query block more powerful and are used to manipulate data values. This is the first of two lessons that explore functions. It focuses on single-row character, number, and date functions, as well as those functions that convert data from one type to another, for example, character data to numeric data.
To extract data from the database, you need to use the structured query language (SQL) SELECT statement. You may need to restrict the columns that are displayed. This lesson describes all the SQL statements needed to perform these actions.You may want to create SELECT statements that can be used more than once. This lesson also covers the iSQL*Plus environment where you execute SQL statements.
Note: iSQL*Plus is new in the Oracle9i product. It is a browser environment where you execute SQL commands. In prior releases of Oracle, SQL*Plus was the default environment where you executed SQL commands. SQL*Plus is still available and is described in Appendix C.
Similar to Les08[1] Producing Readable Output with SQL*Plus (20)
sara-shortCV SARA GHIASI TABRIZI Computer Science PhD Applicationsiavosh kaviani
The objective of my role as a junior researcher in the field of computer science is to engage in rigorous research activities under the guidance of seasoned academics, with the aim of advancing knowledge and
understanding within the discipline. This involves actively participating in research projects, contributing to scholarly publications, and gaining valuable experience in research methodologies and techniques. Ultimately, the goal is to develop a solid foundation in research skills,
deepen comprehension of computer science concepts, and potentially pave the way for future contributions to the academic community.
The Lean Canvas is a strategic management template that helps entrepreneurs to create and validate a business model. It provides a concise way to document and communicate a business idea, focusing on problems, solutions, key metrics, and competitive advantages.
Attaque chimique contre les écolières en Iran version 2.pptxsiavosh kaviani
This presentation is about the chemical attacks to school girls, Iran from September 2022 up to now. I produced this lecture on three language of French, English, and Persian.
SUMMARY
Emotionally intelligent and computer-savvy Administrative Assistant with an Associate’s degree in Business Administration. Strong interpersonal skills and a lifelong focus on supporting others and helping them shine.
German literature graduate with proven communication in English & French, office planning, and email management skills and Microsoft tools. Seeking a position as an administrative assistant, to leverage organizational and research skills to support internal and external communication.
Experienced software developer and business model designer with efficient experience on windows, web-based, mobile applications and a deep knowledge on database design and techniques. I have decent analytical and problem solving skills and I am inclined to work with a team on challenging problems. I always welcome challenges to raise my experience. Designing optimized and efficient solutions for real world problems is my expertise.
Solution-oriented IT software manager With over 30 years of advanced experience in developing, implementing, and supporting sophisticated infrastructure and technical solutions, a lot of industry leaders are highly regarded. Superior expertise with development methodologies, developer supervision, and customer relations. Motivational and effective project manager, providing effective leadership in fast and deadline environments. As you progress through the IT solutions, pursue a history beyond your goals and expectations for quality, timing, and cost. An outside-frame thinker who thrives in collaborative environments, working in business and technical teams to increase profits and reduce costs through continuous improvement and strategic planning of IT infrastructure.
AS my position in CTO position often overlaps with other jobs, in particular, that of the chief information officer (CIO) or chief science officer. Depending on the company's size and focus, it may have some or all of these positions. In some environments, the CTO might oversee infrastructure or act as a strategic planner or customer relations liaison. The position attributes of a CTO vary by organization. As a rule, the CTO reports to the chief executive officer. I have encountered these problems in many of my projects that have been hired by different organizations for similar jobs, and I have gained the ability to deal with those difficulties.
As a senior marketing manager, I do my duties as a mid-to senior-level executive who leads the marketing efforts of an organization. I am responsible for developing and executing marketing strategies that help the company grow and succeed. This might include working with product development teams to ensure that new products or services are ready when they’re needed, coordinating with customer service to make sure customers have a positive experience interacting with the company brand, etc.
Senior Marketing Manager with 20+ years of experience in new era solutions, and Digital marketing environments. Proven record in managing products and service launches that increase brand awareness and sales. Personally recruited and trained 100+ marketing and sales specialists, improving overall sales targets by 24%, and directed the launch of 100 new product lines with huge annual revenue.
SIAVOSH KAVIANI
CE / CS MASTER PROFESSOR
Objective:
Highly motivated and dedicated individual with a doctorate in software Engineering and excellent teaching and research skills and knowledge of educational technologies looking for the position of a professor in Software Engineering courses. A highly enthusiastic online professor with over 25 years of experience teaching Software Eng. Courses Software Eng. (I,II,Advance)/ Advance Software Discourse/Decision support system/IT Strategic management /Database(I,Advance)in digital education technologies with outstanding communication and teaching skills.
A B O U T M E:
Exceptionally seasoned and dedicated Engineering Professor with a strong record in both teaching and administration. Adept at explaining highly complex engineering theories and practices in a clear and accessible manner to a variety of professional and non-professional audiences. Committed to offering interested students my full attention and expertise to help further their academic and professional goals.
Siavosh Kaviani cv francais 2022 version 2.pdfsiavosh kaviani
PROFIL
Un leader innovant et influent avec une expérience éprouvée de succès dans le développement de logiciels créatifs et stratégiques, la gestion de projets et de programmes.
Un communicateur exceptionnel qui se spécialise dans les présentations aux clients, les réunions techniques et l'interaction avec les investisseurs, le personnel et les clients.
Professeur d'université, j'offre dans le développement et la mise en œuvre d'outils, d'applications et de services technologiques dans l'industrie de la haute technologie.
CONTACT
TELEPHONE
06-48-91-52-82
SITE WEB
https://avengering.com/prof-siavosh-kaviani-2/
LINKEDIN
https://ksra.eu
EMAIL:
siavosh@avengering.com
PUBLICATION
Les articles Scientifiques
SEO- REFERENCEMENT
Sujets du site Web
Sujets généraux
Vidéo
PDF & PowerPoint
Siavosh Kaviani
Un leader innovant et influent avec une expérience éprouvée de succès dans le développement de logiciels créatifs et stratégiques, la gestion de projets et de programmes.
Un communicateur exceptionnel qui se spécialise dans les présentations aux clients, les réunions techniques et l'interaction avec les investisseurs, le personnel et les clients.
Le professeur d'université offre une mine de talents dans le développement et la mise en œuvre d'outils, d'applications et de services technologiques dans l'industrie de la haute technologie.
One of the biggest problems for newcomers to Oracle Apex is the lack of a system for assigning roles and accessing application items.
Also, with a little searching in discussion forums, you can see the problems of users in this area.
At Apex, we can create a pre-opportunity system for managing access users. As in asp.net applications, for example, the identity system is provided that the user can personalize it.
To do this, we started designing a comprehensive authentication and access management system that includes the following 6 database entities:
Users: The list of system users includes the following columns
Id, UserName, FirstName, LastName, UserIsEnable
Roles: The list of system roles includes the following columns
ID, Title
, RoleClaims: RoleClaims single-role access table of program items including the following columns
Id, RoleID (FK), COMPONENTID, CanAccess
, UserRoles: The role chart assigned to each user includes the following columns
ID, UserId (fk), RoleId (fk)
UserLogins: User login history includes the following columns
Id, UserId, LogindateTime, Ip, Browser
UserUsedPassword .: Passwords used by the user include the following columns
Id, UserId (FK), Password, CreateDateTime
To describe the function of the designed system, we can provide details with you through text or video or a demo program.
Thanks
After completing this lesson, you should be able to do the following:
Create users
Create roles to ease setup and maintenance of the security model
Use the GRANT and REVOKE statements to grant and revoke object privileges
Creating tables and sequences
Modifying data in the tables
Modifying a table definition
Creating a view
Writing scripts containing SQL and SQL*Plus commands
Generating a simple report
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
1. Copyright س Oracle Corporation, 1999. All rights reserved.
8
Producing Readable Output
with SQL*Plus
2. 8-2 Copyright س Oracle Corporation, 1999. All rights reserved.
Objectives
After completing this lesson, you should
be able to do the following:
• Produce queries that require an input
variable
• Customize the SQL*Plus environment
• Produce more readable output
• Create and execute script files
• Save customizations
3. 8-3 Copyright س Oracle Corporation, 1999. All rights reserved.
Interactive Reports
I want to input query
values at runtime.
...sal = ? …
… deptno = ? …
.. ename = ? ...
User
4. 8-4 Copyright س Oracle Corporation, 1999. All rights reserved.
Substitution Variables
• Use SQL*Plus substitution variables to
temporarily store values.
– Single ampersand (&)
– Double ampersand (&&)
– DEFINE and ACCEPT commands
• Pass variable values between SQL
statements.
• Dynamically alter headers and footers.
5. 8-5 Copyright س Oracle Corporation, 1999. All rights reserved.
Using the & Substitution Variable
Use a variable prefixed with an
ampersand (&) to prompt the user for a
value.
SQL> SELECT empno, ename, sal, deptno
2 FROM emp
3 WHERE empno = &employee_num;
Enter value for employee_num: 7369
EMPNO ENAME SAL DEPTNO
--------- ---------- --------- ---------
7369 SMITH 800 20
6. 8-6 Copyright س Oracle Corporation, 1999. All rights reserved.
Using the SET VERIFY Command
Toggling the display of the text of a
command before and after SQL*Plus
replaces substitution variables with values.
SQL> SET VERIFY ON
SQL> SELECT empno, ename, sal, deptno
2 FROM emp
3 WHERE empno = &employee_num;
Enter value for employee_num: 7369
old 3: WHERE empno = &employee_num
new 3: WHERE empno = 7369
...
7. 8-7 Copyright س Oracle Corporation, 1999. All rights reserved.
Character and Date Values
with Substitution Variables
Use single quotation marks for date and
character values.
SQL> SELECT ename, deptno, sal*12
2 FROM emp
3 WHERE job='&job_title';
Enter value for job_title: ANALYST
ENAME DEPTNO SAL*12
---------- --------- ---------
SCOTT 20 36000
FORD 20 36000
8. 8-8 Copyright س Oracle Corporation, 1999. All rights reserved.
Specifying Column Names,
Expressions, and Text at Runtime
Use substitution variables to supplement
the following:
• WHERE condition
• ORDER BY clause
• Column expression
• Table name
• Entire SELECT statement
9. 8-9 Copyright س Oracle Corporation, 1999. All rights reserved.
Specifying Column Names,
Expressions, and Text at Runtime
SQL> SELECT empno, ename, job, &column_name
2 FROM emp
3 WHERE &condition
4 ORDER BY &order_column;
Enter value for column_name: sal
Enter value for condition: sal>=3000
Enter value for order_column: ename
EMPNO ENAME JOB SAL
--------- ---------- --------- ---------
7902 FORD ANALYST 3000
7839 KING PRESIDENT 5000
7788 SCOTT ANALYST 3000
10. 8-10 Copyright س Oracle Corporation, 1999. All rights reserved.
Using the && Substitution Variable
Use the double-ampersand (&&) if you
want to reuse the variable value without
prompting the user each time.
SQL> SELECT empno, ename, job, &&column_name
2 FROM emp
3 ORDER BY &column_name;
Enter value for column_name: deptno
EMPNO ENAME JOB DEPTNO
--------- ---------- --------- ---------
7839 KING PRESIDENT 10
7782 CLARK MANAGER 10
7934 MILLER CLERK 10
...
14 rows selected.
11. 8-11 Copyright س Oracle Corporation, 1999. All rights reserved.
Defining User Variables
• You can predefine variables using one
of two SQL*Plus commands:
– DEFINE: Create a CHAR datatype
user variable
– ACCEPT: Read user input and store it
in a variable
• If you need to predefine a variable that
includes spaces, you must enclose the
value within single quotation marks
when using the DEFINE command.
12. 8-12 Copyright س Oracle Corporation, 1999. All rights reserved.
The ACCEPT Command
• Creates a customized prompt when
accepting user input
• Explicitly defines a NUMBER or DATE
datatype variable
• Hides user input for security reasons
ACCEPT variable [datatype] [FORMAT format]
[PROMPT text] [HIDE]
13. 8-13 Copyright س Oracle Corporation, 1999. All rights reserved.
Using the ACCEPT Command
ACCEPT dept PROMPT 'Provide the department name: '
SELECT *
FROM dept
WHERE dname = UPPER('&dept')
/
Provide the department name: Sales
DEPTNO DNAME LOC
--------- -------------- -------------
30 SALES CHICAGO
14. 8-14 Copyright س Oracle Corporation, 1999. All rights reserved.
DEFINE and UNDEFINE Commands
• A variable remains defined until you either:
– Use the UNDEFINE command to clear it
– Exit SQL*Plus
• You can verify your changes with the
DEFINE command.
• To define variables for every session,
modify your login.sql file so that the
variables are created at startup.
15. 8-15 Copyright س Oracle Corporation, 1999. All rights reserved.
Using the DEFINE Command
• Create a variable to hold the department
name.
DEFINE DEPTNAME = "sales" (CHAR)
• Use the variable as you would any other
variable.
SQL> DEFINE deptname = sales
SQL> DEFINE deptname
SQL> SELECT *
2 FROM dept
3 WHERE dname = UPPER('&deptname');
16. 8-16 Copyright س Oracle Corporation, 1999. All rights reserved.
Customizing the SQL*Plus
Environment
• Use SET commands to control current
session.
• Verify what you have set by using the
SHOW command.
SQL> SET ECHO ON
SQL> SHOW ECHO
echo ON
SET system_variable value
18. 8-18 Copyright س Oracle Corporation, 1999. All rights reserved.
Saving Customizations
in the login.sql File
• The login.sql file contains standard
SET and other SQL*Plus commands
that are implemented at login.
• You can modify login.sql to contain
additional SET commands.
19. 8-19 Copyright س Oracle Corporation, 1999. All rights reserved.
SQL*Plus Format Commands
• COLUMN [column option]
• TTITLE [text | OFF | ON]
• BTITLE [text | OFF | ON]
• BREAK [ON report_element]
20. 8-20 Copyright س Oracle Corporation, 1999. All rights reserved.
The COLUMN Command
Controls display of a column
• CLE[AR]: Clears any column formats
• FOR[MAT] format: Changes the display
of the column using a format model
• HEA[DING] text: Sets the column
heading
• JUS[TIFY] {align}: Aligns the column
heading to be left, center, or right
COL[UMN] [{column|alias} [option]]
21. 8-21 Copyright س Oracle Corporation, 1999. All rights reserved.
Using the COLUMN Command
• Create column headings.
• Display the current setting for the ENAME
column.
• Clear settings for the ENAME column.
COLUMN ename HEADING 'Employee|Name' FORMAT A15
COLUMN sal JUSTIFY LEFT FORMAT $99,990.00
COLUMN mgr FORMAT 999999999 NULL 'No manager'
COLUMN ename
COLUMN ename CLEAR
22. 8-22 Copyright س Oracle Corporation, 1999. All rights reserved.
COLUMN Format Models
Result
N/A
1234
01234
$1234
L1234
1234.00
1,234
Example
N/A
999999
099999
$9999
L9999
9999.99
9,999
Element
An
9
0
$
L
.
,
Description
Sets a display width of n
Single zero-suppression
digit
Enforces leading zero
Floating dollar sign
Local currency
Position of decimal point
Thousand separator
23. 8-23 Copyright س Oracle Corporation, 1999. All rights reserved.
Using the BREAK Command
Suppresses duplicates and sections rows
• To suppress duplicates
SQL> BREAK ON ename ON job
SQL> BREAK ON ename SKIP 4 ON job SKIP 2
• To section out rows at break values
24. 8-24 Copyright س Oracle Corporation, 1999. All rights reserved.
Using the TTITLE and BTITLE
Commands
• Display headers and footers.
TTI[TLE] [text|OFF|ON]
SQL> TTITLE 'Salary|Report'
• Set the report header.
• Set the report footer.
SQL> BTITLE 'Confidential'
25. 8-25 Copyright س Oracle Corporation, 1999. All rights reserved.
Creating a Script File
to Run a Report
1. Create the SQL SELECT statement.
2. Save the SELECT statement to a script
file.
3. Load the script file into an editor.
4. Add formatting commands before the
SELECT statement.
5. Verify that the termination character
follows the SELECT statement.
26. 8-26 Copyright س Oracle Corporation, 1999. All rights reserved.
Creating a Script File
to Run a Report
6. Clear formatting commands after the
SELECT statement.
7. Save the script file.
8. Enter “START filename” to run the
script.
27. 8-27 Copyright س Oracle Corporation, 1999. All rights reserved.
Sample Report
Fri Oct 24 page 1
Employee
Report
Job
Category Employee Salary
----------------------- ----------------------- -----------------
CLERK ADAMS $1,100.00
JAMES $950.00
MILLER $1,300.00
SMITH $800.00
MANAGER BLAKE $2,850.00
CLARK $2,450.00
JONES $2,975.00
SALESMAN ALLEN $1,600.00
MARTIN $1,250.00
TURNER $1,500.00
WARD $1,250.00
Confidential
28. 8-28 Copyright س Oracle Corporation, 1999. All rights reserved.
Summary
• Use SQL*Plus substitution variables to
temporarily store values.
• Use SET commands to control current
SQL*Plus environment.
• Use the COLUMN command to control
the display of a column.
• Use the BREAK command to suppress
duplicates and section rows.
• Use TTITLE and BTITLE to display
headers and footers.
29. 8-29 Copyright س Oracle Corporation, 1999. All rights reserved.
Practice Overview
• Creating a query to display values using
substitution variables
• Starting a command file containing
variables
• Using the ACCEPT command