Hewlett-Packard HP IMAGE/SQL Relational Database Management System Manual
PDF
Belge
Reklam
Reklam
900 Series HP 3000 Computer Systems
Getting Started with
HP IMAGE/SQL
ABCDE
Printed in U.S.A.
Second Edition
December 1994
E1294
Customer Order Number 36385-90008
Company or product names followed by R are U.S. registered
trademarks of the respective company. Company or product names
followed by TM are registered trademarks of the respective company.
Forest & TreesTM is a registered trademark of Trinzic, Incorporated.
R are U.S. registered
Microsoft WindowsTM and Microsoft
trademarks of Microsoft Corporation.
PowerBuilderTM is a registered trademark of Powersoft Corporation.
The information contained in this document is subject to change
without notice.
HEWLETT-PACKARD MAKES NO WARRANTY OF ANY
KIND WITH REGARD TO THIS MATERIAL,INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. Hewlett-Packard shall not be liable for errors
contained herein or for incidental or consequential damages
in connection with the furnishing, performance, or use of this
material.
Hewlett-Packard assumes no responsibility for the use or
reliability of its software on equipment that is not furnished by
Hewlett-Packard.
This document contains proprietary information which is
protected by copyright. All rights are reserved. No part of
this document may be photocopied, reproduced, or translated
to another language without the prior written consent of
Hewlett-Packard Company.
Copyright
c 1993, 1994 by Hewlett-Packard Company
Printing History
The following table lists the printings of this document, together
with the respective release dates for each edition. The software
version indicates the version of the software product at the time
this document was issued. Many product releases do not require
changes to the document. Therefore, do not expect a one-to-one
correspondence between product releases and document editions.
Edition
Date
Software Version
First Edition
Second Edition
June 1993
December 1994
36385-B.F0.20
36385-B.G0.03
iii
This book describes how to start using HP IMAGE/SQL.
Preface
HP IMAGE/SQL is oered on HP 3000 computers using the
MPE/iX operating system. MPE/iX, Multiprogramming Executive
with Integrated POSIX, is the latest in a series of forward-compatible
operating systems for the HP 3000 line of computers. MPE/iX is a
superset of MPE XL. All programs written for MPE XL will run
without change under MPE/iX.
Note
Hereafter in this manual, HP IMAGE/SQL will be referred to as
IMAGE/SQL.
The following briey describes each chapter in this manual:
Chapter 1
Introducing IMAGE/SQL
Introduces IMAGE/SQL.
Chapter 2
Basic Concepts
Presents basic ideas, tasks, and concepts.
Chapter 3
Moving From TurboIMAGE/XL to IMAGE/SQL
For the user coming from the world of
TurboIMAGE/XL to IMAGE/SQL, describes
comparative terminology and discusses steps to
using IMAGE/SQL.
Chapter 4
A Database Example
Presents a simple database example.
Chapter 5
IMAGE/SQL Tasks
Shows these IMAGE/SQL tasks: setting
up a database with ISQL, conguring a
DBEnvironment, attaching a database, detaching
a database, restructuring a database, and
restoring an IMAGE/SQL environment.
Chapter 6
Practicing with IMAGE/SQL Using MusicDBE
Details the steps for creating a TurboIMAGE/XL
database and setting up MusicDBE, the
IMAGE/SQL sample DBEnvironment.
Appendix A
Tools For IMAGE/SQL
Lists a selection of available tools.
Glossary
Glossary of IMAGE/SQL Terms
Gives basic denitions of terms.
iv
Additional
Documentation
Refer to the listed manuals for additional information:
HP IMAGE/SQL Administration Guide (36385-90001)
This guide explains how to administer and maintain IMAGE/SQL.
For this manual, you should be familiar with and have a general
knowledge of relational databases.
TurboIMAGE/XL Database Management System Reference Manual
(30391-90001)
This manual describes the TurboIMAGE/XL Database
Management System for the HP 3000 Series 900 computer. It
is the reference document for anyone designing, creating, and
maintaining a database and for application programmers writing
database access programs.
ISQL Reference Manual for ALLBASE/SQL and IMAGE/SQL
(36216-90096)
This manual describes ISQL (Interactive Structured Query
Language) and how to use it.
ALLBASE/NET User's Guide (36216-90031)
This guide describes ALLBASE/NET, a product that allows
an application on MPE/iX to access an ALLBASE/SQL
DBEnvironment on another MPE/iX system. This guide is
written for the system administrator, programmers, and users of
ALLBASE/SQL DBEnvironments.
ALLBASE/SQL Database Administration Guide (36216-90005)
This manual describes how to design, create, and maintain
ALLBASE/SQL databases on HP 3000 computers. This guide
is written for experienced users of SQL and SQL application
programmers.
ALLBASE/SQL Message Manual (36216-90009)
This manual explains the causes and actions to be taken for
warning and error conditions that occur using the following
components of ALLBASE/SQL: SQL, ISQL, SQLAudit, SQLGEN,
SQLUtil, the preprocessors, SQLMigrate, NET, or NETUtil. This
manual is for database administrators, application programmers,
and others who are using ALLBASE/SQL. This manual assumes
that the user has a basic understanding of databases and
ALLBASE/SQL concepts.
ALLBASE/SQL Performance and Monitoring Guidelines
(36216-90102)
This is a technical manual for database administrators to assist in
monitoring the performance of ALLBASE/SQL applications.
ALLBASE/SQL Reference Manual (36216-90001)
v
This manual presents the syntax and semantics of SQL on
HP 3000 computers. This manual contains basic information
about ALLBASE/SQL, as well as in-depth information
about ALLBASE/SQL data types and statements. The rst
three chapters are for all readers, including new users of
ALLBASE/SQL. The remaining chapters are for experienced SQL
users and SQL application programmers.
HP PC API User's Guide for ALLBASE/SQL and IMAGE/SQL
(36216-90104)
This guide describes HP PC API for ALLBASE/SQL and
IMAGE/SQL, how to install it, and how to maintain it. This
guide is for the system administrator installing HP PC API
for ALLBASE/SQL and IMAGE/SQL and for someone using
application software on the PC client.
Up and Running with ALLBASE/SQL (36389-90011)
This is a getting started reference for ALLBASE/SQL.
vi
Conventions
UPPERCASE
In a syntax statement, commands and keywords are
shown in uppercase characters. The characters must
be entered in the order shown; however, you can
enter the characters in either uppercase or lowercase.
For example:
COMMAND
can be entered as any of the following:
command
italics
Command
COMMAND
In a syntax statement or an example, a word in
italics represents a parameter or argument that you
must replace with the actual value. In the following
example, you must replace FileName with the name
of the le:
COMMAND FileName
punctuation
In a syntax statement, punctuation characters (other
than brackets, braces, vertical bars, and ellipses)
must be entered exactly as shown. In the following
example, the parentheses and colon must be entered:
(FileName):(FileName)
underlining
Within an example that contains interactive dialog,
user input and user responses to prompts are
indicated by underlining. In the following example,
yes is the user's response to the prompt:
Do you want to continue? >> yes
{
}
In a syntax statement, braces enclose required
elements. When several elements are stacked within
braces, you must select one. In the following
example, you must select either ON or OFF:
COMMAND
...
ON
OFF
In an example, horizontal or vertical ellipses indicate
where portions of an example have been omitted.
vii
Conventions
[
]
(continued)
In a syntax statement, brackets enclose optional
elements. In the following example, OPTION can be
omitted:
COMMAND FileName [OPTION]
When several elements are stacked within brackets,
you can select one or none of the elements. In
the following example, you can select OPTION
or Parameter or neither. The elements cannot be
repeated.
COMMAND FileName
[ . .. ]
OPTION
Parameter
In a syntax statement, horizontal ellipses enclosed
in brackets indicate that you can repeatedly select
the element(s) that appear within the immediately
preceding pair of brackets or braces. In the example
below, you can select Parameter zero or more times.
Each instance of Parameter must be preceded by a
comma:
[,Parameter][...]
In the example below, you only use the comma as a
delimiter if Parameter is repeated; no comma is used
before the rst occurrence of Parameter :
[Parameter][,...]
| . .. |
In a syntax statement, horizontal ellipses enclosed in
vertical bars indicate that you can select more than
one element within the immediately preceding pair of
brackets or braces. However, each particular element
can only be selected once. In the following example,
you must select A, AB, BA, or B. The elements
cannot be repeated.
4
5
4CTRL5char
viii
A
| ... |
B
The symbol 4
5 indicates a key on the keyboard.
For example, 4RETURN5 represents the carriage return
key.
4CTRL5char indicates a control character. For
example, 4CTRL5Y means that you press the control
key and the Y key simultaneously.
Contents
1. Introducing IMAGE/SQL
What Is IMAGE/SQL? . . . . . . . . . . . . .
What Are the Components of IMAGE/SQL? . . .
TurboIMAGE/XL . . . . . . . . . . . . . .
ALLBASE/SQL . . . . . . . . . . . . . . .
HP PC API for ALLBASE/SQL and IMAGE/SQL
ALLBASE/NET . . . . . . . . . . . . . . .
IMAGE/SQL Utility . . . . . . . . . . . . .
ISQL . . . . . . . . . . . . . . . . . . . .
SQLGEN . . . . . . . . . . . . . . . . . .
SQLUtil . . . . . . . . . . . . . . . . . . .
Preprocessors . . . . . . . . . . . . . . . .
What Are The Benets of Using IMAGE/SQL? . .
How Do IMAGE/SQL and ALLBASE/SQL Coexist?
2. Basic Concepts
What Is a Database? . . . . . . .
What Is a Relational Database? . .
Rows and Columns . . . . . . .
Sample Database Table . . . . .
Using Several Tables . . . . . .
What Is SQL? . . . . . . . . . .
What Is TurboIMAGE/XL? . . . .
What Is a DBEnvironment? . . . .
The DBECon le . . . . . . . .
DBEFiles . . . . . . . . . . .
DBEFileSets . . . . . . . . . .
Databases . . . . . . . . . . .
Tables . . . . . . . . . . . .
System Catalog . . . . . . . .
Log Files . . . . . . . . . . .
How Do I Create a DBEnvironment?
How Do I Create a Database? . . .
How Do I Access a Database through
How Do I Control Database Access?
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
. . .
SQL?
. . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1-1
1-3
1-3
1-3
1-3
1-3
1-3
1-3
1-4
1-4
1-4
1-5
1-5
2-1
2-2
2-2
2-3
2-4
2-5
2-5
2-6
2-7
2-7
2-7
2-7
2-8
2-8
2-8
2-9
2-9
2-10
2-11
Contents-1
3. Moving from TurboIMAGE/XL to IMAGE/SQL
Basic Structures . . . . . . . . . . . . . . . .
Creating Databases . . . . . . . . . . . . . . .
Root File versus DBECon File and System Catalog
Naming Conventions . . . . . . . . . . . . .
Tables versus Data Sets . . . . . . . . . . . . .
Mapping of Data Types . . . . . . . . . . . . .
Basic Mapping . . . . . . . . . . . . . . . .
Compound Items . . . . . . . . . . . . . . .
Default Values . . . . . . . . . . . . . . . .
Dening Security . . . . . . . . . . . . . . . .
TurboIMAGE/XL Security . . . . . . . . . .
Granting and Revoking IMAGE/SQL Authorities
Dening IMAGE/SQL Groups . . . . . . . . .
Dening Views in IMAGE/SQL . . . . . . . .
Methods of Accessing Databases . . . . . . . . .
Interactive Access . . . . . . . . . . . . . .
Programmatic Access . . . . . . . . . . . . .
Locking Mechanisms . . . . . . . . . . . . .
3-3
3-5
3-6
3-6
3-7
3-7
3-7
3-7
3-7
3-8
3-8
3-8
3-8
3-8
3-9
3-9
3-9
3-10
4. A Database Example
Understanding the Environment . . . .
The Example Application . . . . . . .
Logical Data Entities . . . . . . . . .
Identifying Relationships Between Entities
Dening the Data Sets . . . . . . . .
Dening the Security Scheme . . . . .
Dening the TurboIMAGE/XL Database
Creating the TurboIMAGE/XL Database
4-1
4-2
4-3
4-4
4-6
4-8
4-9
4-12
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5. IMAGE/SQL Tasks
About the Tasks . . . . . . . . . . . . . . . .
Setting Up a Database with ISQL . . . . . . . .
Running ISQL . . . . . . . . . . . . . . . .
Creating a DBEnvironment . . . . . . . . . .
Conguring a DBEnvironment . . . . . . . . . .
Listing the Newly Created Files . . . . . . . .
Attaching a TurboIMAGE/XL Database . . . . .
Detaching a TurboIMAGE/XL Database . . . . .
Displaying IMAGE/SQL Utility Information . . . .
Example 1: Displaying Database Information . .
Example 2: Displaying Database Mapping
Information . . . . . . . . . . . . . . . .
Example 3: Displaying DBEnvironment Information
Example 4: Displaying User Information . . . .
Issuing MPE/iX Commands from the IMAGE/SQL
Utility . . . . . . . . . . . . . . . . . . .
Setting IMAGE/SQL File Equations . . . . . . .
Setting a File Equation for ATCINFO . . . . . .
Setting a File Equation for ATCLOG . . . . . .
ATCINFO Reference . . . . . . . . . . . .
Contents-2
5-1
5-3
5-3
5-4
5-5
5-7
5-9
5-13
5-15
5-16
5-16
5-17
5-17
5-18
5-19
5-19
5-19
5-20
ATCLOG Reference . . . . . . . . .
Logging IMAGE/SQL Utility Commands . .
Using IMAGE/SQL Utility Command Files .
Accessing TurboIMAGE/XL Data with ISQL
Maintaining the ATCINFO File . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5-20
5-21
5-24
5-26
5-27
6. Practicing with IMAGE/SQL Using MusicDBE
Setting Up MUSIC and MusicDBE . . . . . .
Examining The Database . . . . . . . . . .
Examining Table Descriptions . . . . . . .
Examining the Authority Structure . . . . .
Adding Data to the Database . . . . . . . .
Using the INSERT Statement . . . . . . .
Using the LOAD Command . . . . . . . .
The EXTERNAL Option . . . . . . . .
The INTERNAL Option . . . . . . . .
Selecting Data . . . . . . . . . . . . . . .
Modifying Data . . . . . . . . . . . . . .
Deleting Data . . . . . . . . . . . . . . .
Conclusion . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
6-2
6-4
6-5
6-6
6-9
6-9
6-10
6-10
6-11
6-13
6-14
6-16
6-16
A. Tools For IMAGE/SQL
Decision Support Tools . . . . . . . . . .
Executive Information System (EIS) Tools . .
Application Development Tools on the PC . .
Application Development Tools on the Server
.
.
.
.
.
.
.
.
A-2
A-2
A-2
A-2
.
.
.
.
Glossary
Index
Contents-3
Figures
1-1.
2-1.
2-2.
3-1.
3-2.
4-1.
5-1.
5-2.
6-1.
6-2.
6-3.
6-4.
6-5.
6-6.
6-7.
6-8.
6-9.
6-10.
6-11.
6-12.
Overview of IMAGE/SQL . . . . . . . . .
Relational Operations . . . . . . . . . . .
Structure of a DBEnvironment . . . . . . .
TurboIMAGE/XL Architecture . . . . . .
IMAGE/SQL Architecture . . . . . . . . .
Database Design . . . . . . . . . . . . .
IMAGE/SQL Utility Command Prerequisites
ISQL Banner . . . . . . . . . . . . . .
SQLSetup Menu . . . . . . . . . . . . .
Information on Tables and Views . . . . . .
Column Denitions of a Table . . . . . . .
Groups in the System Catalog . . . . . . .
Changes to Levels of Security . . . . . . .
UserID Information . . . . . . . . . . . .
INSERT Command Display . . . . . . . .
Result of the EXTERNAL Option . . . . .
Result of the INTERNAL Option . . . . .
JOINED List . . . . . . . . . . . . . .
Result of the Query . . . . . . . . . . . .
Result of Modifying Data . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
1-2
2-2
2-6
3-3
3-4
4-7
5-2
5-3
6-2
6-4
6-5
6-6
6-8
6-8
6-9
6-11
6-12
6-13
6-14
6-15
.
3-2
.
.
.
3-7
6-3
A-1
Tables
3-1. Comparing IMAGE/SQL and TurboIMAGE/XL
Concepts . . . . . . . . . . . . . . . .
3-2. Mapping of TurboIMAGE/XL and IMAGE/SQL
Data Types . . . . . . . . . . . . . . .
6-1. Menu Options . . . . . . . . . . . . . . .
A-1. Categories of Tools . . . . . . . . . . . . .
Contents-4
1
Introducing IMAGE/SQL
This chapter introduces IMAGE/SQL:
What is IMAGE/SQL?
What are the components of IMAGE/SQL?
What are the benets of using IMAGE/SQL?
How do IMAGE/SQL and ALLBASE/SQL coexist?
What Is
IMAGE/SQL?
IMAGE/SQL is one of Hewlett-Packard's relational database
management systems. IMAGE/SQL provides relational access to
your TurboIMAGE data using the industry-standard Structured
Query Language (SQL). This access method includes full read and
write capability using ANSI standard functionality. Closely tuned to
the architecture of HP computers, IMAGE/SQL gives you exibility
in designing and using SQL database applications on a small or large
scale.
Introducing IMAGE/SQL
1-1
Figure 1-1 shows how IMAGE/SQL, TurboIMAGE/XL, and
ALLBASE/SQL are related.
Figure 1-1. Overview of IMAGE/SQL
1-2
Introducing IMAGE/SQL
IMAGE/SQL includes TurboIMAGE/XL, certain components of
ALLBASE/SQL, and a database administration tool that links them
together. The database administration tool is the IMAGE/SQL
utility. The components of IMAGE/SQL are described below:
What Are the
Components of
IMAGE/SQL?
TurboIMAGE/XL
ALLBASE/SQL
HP PC API for
ALLBASE/SQL and
IMAGE/SQL
ALLBASE/NET
IMAGE/SQL Utility
ISQL
A set of programs and procedures for dening, creating, accessing,
and maintaining TurboIMAGE/XL databases. TurboIMAGE/XL
databases can be accessed using TurboIMAGE/XL procedures,
utilities, and applications. IMAGE/SQL adds the ability to access
TurboIMAGE/XL databases by using the industry-standard SQL
language.
A set of programs and procedures for creating, maintaining, and
accessing relational database environments. IMAGE/SQL includes
the ALLBASE/SQL components needed to provide relational access
to TurboIMAGE/XL databases.
Software that provides a programmatic interface to IMAGE/SQL
for creating Microsoft windows-based client-server applications.
With HP PC API for ALLBASE/SQL and IMAGE/SQL, you use
one of several available 4GL and decision support tools to build
your application, which connects to ALLBASE/SQL over a network
through ALLBASE/NET.
Works with HP PC API for ALLBASE/SQL and IMAGE/SQL in
connecting users with databases over a network.
A database administrator's tool for managing TurboIMAGE/XL
databases in a relational access environment. This tool attaches
and detaches databases to and from DBEnvironments for access via
SQL. Other management functions, such as security and data type
mapping, are accomplished through this utility. Refer to the HP
IMAGE/SQL Administration Guide for details on the IMAGE/SQL
utility.
An interactive command processor that lets you enter SQL
statements at the keyboard and observe query results, messages,
and other information on a video display. SQL is a language|not a
software system. Therefore, you need an interactive way to submit
SQL statements.
ISQL is the main tool used by IMAGE/SQL programmers and
database administrators to create and modify DBEnvironments. It
is also used by anyone who needs to submit queries using the SQL
language. ISQL is especially useful for loading and unloading data.
Introducing IMAGE/SQL
1-3
SQLGEN
SQLUtil
Preprocessors
1-4
Introducing IMAGE/SQL
A database administrator's tool that generates the commands used to
recreate all or part of an existing DBEnvironment. It also generates
LOAD/UNLOAD and UPDATE STATISTICS statements. These
commands are placed in one or more data les called schema les,
which can then be used as ISQL command les to recreate the
DBEnvironment (not the TurboIMAGE/XL database.)
A database administrator's tool for displaying and setting the basic
parameters of a DBEnvironment (explained further in Chapter 2,
\Basic Concepts"), storing and restoring DBEnvironments, setting
the size of system buers, and purging DBEnvironments. The
database administrator (DBA) is the individual who creates and
maintains objects in a DBEnvironment. SQLUtil is seldom needed by
the ordinary user.
Tools that convert source programs containing SQL statements into
source code that can be compiled in a programming language of
your choice. Dierent preprocessors let you code applications in C,
COBOL, FORTRAN, and Pascal.
What Are The
Benefits of Using
IMAGE/SQL?
Using IMAGE/SQL, you benet in the following ways:
By leveraging your investment|
Your existing investment in TurboIMAGE/XL is preserved
while you take advantage of relational technology. You can
develop new applications in SQL to access TurboIMAGE/XL
databases through IMAGE/SQL. At the same time, your current
TurboIMAGE/XL access is completely compatible with the SQL
access to TurboIMAGE/XL. Therefore, you will not have to
convert, recompile, or make changes to your existing applications.
The only dierence is the new application development and
decision support tools available for looking at your data.
By accessing new tools|
Using IMAGE/SQL allows you to use a wide selection of
application development and decision support tools not previously
available to TurboIMAGE/XL users. Hewlett-Packard and
independent software vendors have a wide selection of SQL
client/server tools. These SQL client/server tools allow you to
view data in new ways by combining data from TurboIMAGE/XL,
ALLBASE/SQL, or third-party databases in the same query. See
Appendix A for more information on the available tools.
By beneting from productivity gains|
SQL uses a common interface to access TurboIMAGE/XL,
ALLBASE/SQL, and third-party SQL databases. Productivity
improves when you can use the same interface to access both types
of databases.
How Do IMAGE/SQL
and ALLBASE/SQL
Coexist?
Hewlett-Packard now oers a complete range of data management
choices. TurboIMAGE/XL still provides the highest performance
in the industry for mission-critical OLTP business applications.
ALLBASE/SQL provides the highest SQL performance of any
relational database in the industry and provides support for
distributed database and distributed transaction processing.
IMAGE/SQL provides data access through the many client/server
tools at a small performance premium. Client/server computing
is clearly an emerging trend in information processing and
IMAGE/SQL is now an important element, ensuring the protection
of your information investment.
Together, these database management systems make a powerful
team. ALLBASE/SQL and IMAGE/SQL can be linked together
within a single environment. Your applications, whether host-based
or client/server, can simultaneously access ALLBASE/SQL and
IMAGE/SQL information.
Introducing IMAGE/SQL
1-5
2
Basic Concepts
This chapter familiarizes you with these basic ideas, tasks, and
concepts before venturing on to IMAGE/SQL tasks:
What is a database?
What is a relational database?
What is SQL?
What is TurboIMAGE/XL?
What is a DBEnvironment?
How do I create a DBEnvironment?
How do I create a database?
How do I access a database through SQL?
How do I control database access?
What Is a
Database?
A database is a structured arrangement of data elements designed
for the easy selection of information. Unlike a collection of at les,
a database contains both data and structural information used in
extracting data from the les in which data resides.
Basic Concepts
2-1
What Is a Relational
Database?
A relational database is a collection of data arranged in tables, also
known as relations. Tables are subject to the following relational
operations, each of which lets you retrieve data in a specic way:
Selection, which lets you extract a subset of rows.
Projection, which lets you extract a subset of columns.
Joining, which lets you extract from more than one table at a time.
In practice, these operations frequently appear together. An SQL
statement that uses these operations is known as a query. Three
queries that use the SQL SELECT statement to illustrate selection,
projection, and joining are shown in Figure 2-1.
Figure 2-1. Relational Operations
Rows and Columns
2-2
Basic Concepts
When you look at data in relational terms, you can assume several
things:
Tables are arranged in rows and columns, which are like records
and elds in an ordinary le.
Each column has a specic data type and size.
Each row contains one element for every column.
Sample Database Table
The following is a portion of a database table consisting of names
and account balances for an employee credit union:
Employee Accounts
Last Name First Name Telephone Employee Number Balance
Harrison
Gerald
7233
2432099
142.59
Abelson
Annette
4312
3510044
2345.09
Stanley
Peter
1235
3540011
321.98
Walters
Georgia
2554
9124772
1230.10
Each column can accept data of a specic type and size. Refer to
Chapter 3, \Moving from TurboIMAGE/XL to IMAGE/SQL," for
more details on data types.
Basic Concepts
2-3
Using Several Tables
You can put the same data into several dierent tables, as shown
below:
Table 1. Employees Table
Last Name First Name Employee Number
Harrison
Gerald
2432099
Abelson
Annette
3510044
Stanley
Peter
3540011
Walters
Georgia
9124772
Table 2. Telephone Table
Last Name First Name Telephone
Harrison
Gerald
7233
Abelson
Annette
4312
Stanley
Peter
1235
Walters
Georgia
2554
Table 3. Accounts Table
Employee Number Account Balance
2432099
142.59
3510044
2345.09
3540011
321.98
9124772
1230.10
You decide which arrangements of data work best for you by using
the processes of data analysis and database design.
In data analysis, you investigate the various ways your data can
be used. In database design, you create specic table structures
based on your analysis. The design phase results in a set of table
descriptions, known as a schema, for your database.
2-4
Basic Concepts
What Is SQL?
SQL is the acronym for Structured Query Language, which is dened
by ANSI standards in the United States and by X/OPEN standards
in Europe.
The way into a relational database is through a query language,
which is a set of operators, expressions, and statements that let you
manipulate the database in various ways. You create queries, as
well as other kinds of statements, in IMAGE/SQL by using SQL.
You issue the statements directly through an interactive command
processor (ISQL) or indirectly through an application program.
SQL includes statements that let you do the following:
Create databases
Access databases
Provide security
Promote data integrity
Regulate concurrent access
SQL statements are shown in uppercase letters (for example,
SELECT) in this manual.
What Is
TurboIMAGE/XL?
TurboIMAGE/XL is a database management system that operates
on HP 3000 computer systems. This high performance database
oers intrinsic access through specialized system procedures. This
database engine serves as the storage mechanism for IMAGE/SQL.
Making the transition from TurboIMAGE/XL to IMAGE/SQL is
relatively simple. Chapter 3, \Moving from TurboIMAGE/XL to
IMAGE/SQL," addresses this transition in detail.
Basic Concepts
2-5
What Is a
DBEnvironment?
In IMAGE/SQL, you create one or more databases in a structure
called a DBEnvironment. The structure of a DBEnvironment is
shown in Figure 2-2.
Figure 2-2. Structure of a DBEnvironment
The following objects are the most important parts of the
DBEnvironment:
The DBECon le
DBEFiles
DBEFileSets
Databases
Tables
Authorities
System catalog
Log les
Objects are structures created and stored in an IMAGE/SQL
DBEnvironment. IMAGE/SQL connects the DBEnvironment objects
with the TurboIMAGE/XL database structures. This is discussed in
greater detail in Chapter 5, \IMAGE/SQL Tasks."
To better understand the DBEnvironment and its objects, imagine
that it is like a library that stores books, periodicals, or other
information. Like a library, the DBEnvironment is a physical location
for information, so you need to set aside physical space for it. Also
like a library, the DBEnvironment uses a logical method for storing
and retrieving information.
2-6
Basic Concepts
The DBECon file
DBEFiles
DBEFileSets
Databases
When you create a DBEnvironment, IMAGE/SQL creates a physical
le known as the DBEnvironment Conguration File or DBECon
le. This le contains basic information that is used every time the
DBEnvironment is opened. The DBECon le has the same name as
the DBEnvironment itself. If the DBEnvironment is like a library,
the DBECon le is like a building directory that points to the other
DBEnvironment components.
You must allocate some physical storage space by creating
DBEFiles|operating system les that hold DBEnvironment data.
Like the individual bookcases in a library, they have a specic
capacity. DBEFiles have both physical names (operating system
names) and logical names by which the les are known internally to
the IMAGE/SQL system catalog, to be explained shortly.
DBEFiles are grouped together in logical groupings known as
DBEFileSets. These are something like the dierent subject
categories in a library. You create a DBEFileSet with a logical name
(this corresponds to the subject category name). Then you add
DBEFiles to the DBEFileSet as needed, as you would add bookcases
to the category to add more space. For example, a section may be
labeled \Computer Periodicals" and hold many bookcases with
dierent magazines in them. DBEFileSets do not have a specic
capacity; you can always add more DBEFiles to create more space in
them.
The data in a DBEnvironment is stored in databases, which
are groups of tables having the same owner. The database in a
DBEnvironment is like division ownership of certain books or
periodicals in a library. In a university, some of the periodicals may
belong to a computer science library, others may belong to a medical
library, though these may be housed inside the same building and use
the same card catalog. In such a subdivision of the library, certain
books and periodicals could only be checked out by people belonging
to the appropriate division or having special permission.
When you create an object in the DBEnvironment, you are its owner
by default, and therefore it belongs to your database.
Basic Concepts
2-7
Tables
The most important objects you create are tables. A table is like
a periodical stored in a library, and the rows in the table are like
individual articles in the periodical.
Tables have only logical names; a table name is like the title of the
periodical. When you create a table, you only need to dene its name
and characteristics and associate it with a DBEFileSet. This is like
adding a new periodical to a subject category in the library.
System Catalog
To enable readers to nd issues of ComputerWorld , the librarian puts
an entry in a card catalog that shows where the issues are stored. In
the DBEnvironment, SQLCore inserts an entry in the system catalog
for each database object you create. The system catalog is created at
the time you create a DBEnvironment.
The system catalog is physically located in a DBEFile known as
DBEFILE0. This le contains extra space for the additional entries
that are made by SQLCore each time you create a new object. Like a
good librarian, IMAGE/SQL keeps the system catalog up-to-date for
you, without your being aware of it.
The system catalog is a set of tables for internal use by SQLCore.
These tables are associated with a DBEFileSet known as SYSTEM.
SQLCore uses the system catalog to look up database objects
much as you would use the card catalog in a library to look up the
bookcase and shelf number for a book or periodical.
Log Files
IMAGE/SQL provides logging of all transactions that take place in
the DBEnvironment. Like the library's record of items checked out
and returned, the log le is a record of the rows in database tables
that are added, deleted, or changed. The log makes it possible to
keep data consistent when multiple users are accessing the system,
and it makes recovery possible in the event of a system failure.
Information about the system log is stored in the DBECon le.
Because logging is essentially automatic, it will not be discussed
any further in this manual. For more information, refer to the
chapter \Backup and Recovery" in the ALLBASE/SQL Database
Administration Guide .
2-8
Basic Concepts
How Do I Create a
DBEnvironment?
You use the SQL START DBE NEW statement to create a
DBEnvironment:
START DBE 'DBEnvironmentName' NEW
Once the DBEnvironment exists, you can create databases within it.
The START DBE NEW statement lets you supply options to specify
many of the run-time characteristics of the DBEnvironment. The
simple form of the statement shown above uses default values
for these options. The defaults are described in detail in the
ALLBASE/SQL Database Administration Guide chapter entitled
\DBEnvironment Conguration and Security."
When you create a DBEnvironment, you are granted the broadest
kind of authority|permission in an IMAGE/SQL DBEnvironment|
to create and remove objects. This authority is known as DBA
(database administrator) authority.
How Do I Create a
Database?
With IMAGE/SQL, the underlying database is TurboIMAGE/XL.
You create a TurboIMAGE/XL database using a schema and the
DBSCHEMA and DBUTIL utility programs. Some third-party tools
can also be used to create TurboIMAGE/XL databases. Refer to the
TurboIMAGE/XL Database Management System Reference Manual
for details. Also see Chapter 4, \A Database Example," in this
manual for a database creation example.
Basic Concepts
2-9
How Do I Access a
Database through
SQL?
You use the SQL CONNECT statement to establish a connection to
a DBEnvironment. This statement must be executed by some type of
SQL program, such as:
ISQL
Application programs you create yourself
Third-party applications
Existing programs
During database access, you perform queries or other operations that
manipulate data by inserting, deleting, or modifying rows in tables.
This process is called data manipulation. Here is a simple query
using the SELECT statement, which displays a selection of data from
the Employees table. The asterisk indicates all columns are to be
displayed:
SELECT * FROM Employees;
Below is the query result:
select * from employees;
--------------+-----------+----------LASTNAME
|FIRSTNAME |EMPNUMBER
--------------+-----------+----------Harrison
|Gerald
|
2432099
Abelson
|Annette
|
3510044
Stanley
|Peter
|
3540011
Walters
|Georgia
|
9124772
The query result is also known as a result table.
Other data manipulation statements include the SQL INSERT,
UPDATE, and DELETE statements. These let you add rows to a
table, update specic column values in existing rows, or delete rows.
Examples of data manipulation are shown in Chapter 6, \Practicing
with IMAGE/SQL Using the MusicDBE."
2-10
Basic Concepts
How Do I Control
Database Access?
You use data control language to determine who has access to the
information in a database. This is very important for security. Data
control language confers authorities on specic users to perform
specic tasks. The most powerful authority is DBA authority
(database administrator authority). The DBECreator, that is, the
person who creates a new DBEnvironment, automatically has DBA
authority in that DBEnvironment. Someone with DBA authority can
then use the GRANT statement to give authorities to other users.
The following example grants permission to update the Employees
table to a user known as Harry:
GRANT UPDATE ON Employees to Harry
The controls you dene for database security can be as simple or as
elaborate as you wish.
See Chapter 6, \Practicing with IMAGE/SQL Using MusicDBE," for
more information on database accesses.
Basic Concepts
2-11
3
Moving from TurboIMAGE/XL to IMAGE/SQL
If you are coming to IMAGE/SQL from the world of
TurboIMAGE/XL, this chapter will help you make the transition.
This chapter describes comparative terminology and discusses steps
in using IMAGE/SQL. At the completion of this chapter, you will
have the knowledge of IMAGE/SQL needed to complete the tasks in
Chapters 4, 5, and 6.
The following topics are covered in this chapter:
Basic structures
Creating databases
Tables versus data sets
Mapping of data types
Dening security
Methods of accessing databases
The goal in discussing these topics is not to present a complete
picture of either system, but rather to suggest some points of
correspondence to make learning IMAGE/SQL easier. The discussion
is deliberately oversimplied. For denitions of IMAGE/SQL terms,
refer to Chapter 2, \Basic Concepts," and the Glossary. Complete
information about TurboIMAGE/XL is in the TurboIMAGE/XL
Database Management System Reference Manual.
Moving from TurboIMAGE/XL to IMAGE/SQL
3-1
Although IMAGE/SQL and TurboIMAGE/XL use dierent
terminology, they share several similar concepts. Table 3-1 lists
IMAGE/SQL terms and lists the equivalent TurboIMAGE/XL
concept. The IMAGE/SQL terms listed here are dened in more
detail in the Glossary.
Table 3-1.
Comparing IMAGE/SQL and TurboIMAGE/XL Concepts
IMAGE/SQL Term
DBEnvironment
Collection of databases
Table
Data set
Column
Data item within entry
Row
Record or entry
System catalog
Root le
DBECon le
Root le1
DBEUserID
Password1
DBEFile
DB01, DB02, DB031
1 Shares
3-2
TurboIMAGE/XL Term
some similarities, but dierences do exist.
Moving from TurboIMAGE/XL to IMAGE/SQL
Basic Structures
Figure 3-1 shows the basic architecture of the TurboIMAGE/XL
system.
Figure 3-1. TurboIMAGE/XL Architecture
The TurboIMAGE/XL database manager accesses data in each data
set as needed, based on information given in the root le.
Moving from TurboIMAGE/XL to IMAGE/SQL
3-3
Figure 3-2 shows the IMAGE/SQL architecture.
Figure 3-2. IMAGE/SQL Architecture
3-4
Moving from TurboIMAGE/XL to IMAGE/SQL
Creating Databases
In TurboIMAGE/XL, you create a database using the following
steps:
1. Create a schema. A common way of doing this is to enter the
schema into a text le created with an editor.
2. Run DBSCHEMA to generate a root le from the schema.
3. Run DBUTIL to create data sets based on the root le.
4. Create a DBEnvironment.
With TurboIMAGE/XL, a schema is required to dene a database.
The schema contains denitions of all the data items in your
database and describes all the data sets in the database. It also
species the desired security for the database by dening passwords
for specic users. The schema can also be used to create the same
database structure in dierent groups and accounts or on dierent
systems.
To access a TurboIMAGE/XL database with IMAGE/SQL, you
need a DBEnvironment. You create a DBEnvironment with a
SQL START DBE NEW statement. The statement can be issued
interactively (through ISQL) or through an application program. The
START DBE NEW statement is as follows:
START DBE 'DBEnvironmentName' NEW
The START DBE NEW statement creates a le known as a
DBECon le, which is similar to the root le in TurboIMAGE/XL.
The DBECon le contains information about startup parameters
for the DBEnvironment and its logs. START DBE NEW also
creates a structure within the DBEnvironment known as a system
catalog, which is a set of information about all the databases in the
DBEnvironment.
If you use the START DBE statement and the DBEnvironment
does not exist, the system will ask if you want one automatically
created. See Chapter 5, \IMAGE/SQL Tasks," for more details and
an example.
After the database and DBEnvironment have been created, you must
attach the TurboIMAGE/XL database to the DBEnvironment.
Moving from TurboIMAGE/XL to IMAGE/SQL
3-5
Root File versus
DBECon File and
System Catalog
With TurboIMAGE/XL, the root le, which is generated by
DBSCHEMA from the schema, contains security information and
denitions of all the data sets in the database. The user executing
DBSCHEMA becomes the database creator.
The DBECon le in ALLBASE/SQL is created when you issue the
START DBE NEW statement in ISQL. The DBECon le, which
has the same name as the DBEnvironment, contains the name of
the DBECreator and the names of the logs associated with the
DBEnvironment. The DBECon le also contains startup parameters,
such as SINGLE or MULTI user mode, but does not contain the
names of tables or other database objects; these are stored in the
system catalog.
The system catalog contains structural information about database
objects and tables, much the way the root le does for standard
TurboIMAGE/XL. This catalog serves as an internal schema for
accessing data.
When a TurboIMAGE/XL database is attached to a
DBEnvironment, data set and item denitions are copied into the
system catalog. This provides a mapping to the TurboIMAGE/XL
data from the DBEnvironment. The data is not copied; it remains in
the TurboIMAGE/XL database.
Naming Conventions
3-6
TurboIMAGE/XL data sets and items may contain some characters
that are not allowed in IMAGE/SQL. For example, the hyphen
is not allowed in IMAGE/SQL names. Therefore, hyphens must
be represented in another way in IMAGE/SQL, such as with
an underscore ( ). Specically, the characters not allowed in
IMAGE/SQL names are: + - * / ? ' % &. For more details, refer to
the HP IMAGE/SQL Administration Guide .
Moving from TurboIMAGE/XL to IMAGE/SQL
Tables versus Data
Sets
In TurboIMAGE/XL, the access mechanism is the data set, which
consists of a set of entries containing an ordered series of data items.
A data set is either a detail or a master, and, if it is a master, it is
either manual or automatic.
In SQL, a table is an unordered set of rows containing columns. In
IMAGE/SQL, a table is synonymous with a data set. Tables are not
labeled manual or automatic, master or detail.
Both TurboIMAGE/XL and IMAGE/SQL have data types that
do not map exactly to a type in the other system. However, a
satisfactory mapping with appropriate conversions can easily be done
for most TurboIMAGE/XL data types.
Mapping of Data
Types
Basic Mapping
Table 3-2 shows the mapping of the most common data types from
TurboIMAGE/XL to IMAGE/SQL:
Table 3-2. Mapping of TurboIMAGE/XL and IMAGE/SQL Data Types
TurboIMAGE/XL
Data Type
Description
IMAGE/SQL
Data Type
I,J
SMALLINT
16-bit integer
I2,J2
INTEGER
32-bit integer
K1,K2
INTEGER
Requires conversion from binary to integer
Pn
DECIMAL(n -1,0) Packed decimal
R4
FLOAT
Conversion from HP 3000 real to IEEE real
U(n ), X(n )
CHAR(n )
Byte character string
Zn
DECIMAL(n ,0)
Requires conversion from zoned decimal to packed decimal
Compound Items
Default Values
TurboIMAGE/XL compound items are not compatible with
IMAGE/SQL data types because IMAGE/SQL does not accomodate
arrays. In IMAGE/SQL, you need to create a separate column
description for each member of the compound item.
Default values indicate the absence of a value. IMAGE/SQL assigns
the missing eld an empty string (a blank) for character values or a
zero for numeric values.
TurboIMAGE/XL items are always dened in IMAGE/SQL with the
NOT NULL and default value specication.
Moving from TurboIMAGE/XL to IMAGE/SQL
3-7
Defining Security
TurboIMAGE/XL
Security
Granting and Revoking
IMAGE/SQL Authorities
TurboIMAGE/XL and IMAGE/SQL dier markedly in their
implementation of security systems.
For external security, database users must be valid users in the
account where the root le resides or have access to it through
system security measures. For internal security, passwords are
assigned to numbered classes. These classes can be associated with
read and write permissions to items and data sets. When accessing
a database, you must specify a password that grants you these
permissions. Refer to the TurboIMAGE/XL Database Management
System Reference Manual for further details on security.
Your user identication within the DBEnvironment is the same as
your system logon.
The creator of the DBEnvironment is called the Database Creator
(DBC) and has Database Administrator (DBA) authority. The DBA
has the responsibility to GRANT and REVOKE authorities of other
users. These authorities relate to the DBEnvironment or to specic
tables within it.
Some of these authorities allow users to CONNECT to the
DBEnvironment and SELECT, INSERT, and UPDATE against
tables. If you are the creator of a table, you have OWNER authority
over that table, which lets you perform any operation on it, including
granting authorities to other users.
With IMAGE/SQL, by default, the TurboIMAGE/XL creator (or
someone who knows the maintenance word to the TurboIMAGE/XL
database) and the DBA of the DBEnvironment is set up as the DBC
with DBA authority within the DBEnvironment. Additional users
can be added and authorities granted.
Defining IMAGE/SQL
Groups
Defining Views in
IMAGE/SQL
3-8
In IMAGE/SQL, you can dene authorization groups and then
grant authorities to them; then you can add users to the groups,
at which point they immediately receive the authorities the group
possesses. This makes it possible to create an authorization scheme
that is independent of any list of particular users and passwords.
An authorization group may be a member of another authorization
group.
A dierent approach to security is possible in IMAGE/SQL through
the use of views. For a table that contains some sensitive information
and some widely used information, you can create a view that
contains only the widely-used information, grant appropriate access
on the view to a wide range of users, then restrict the access on the
base table to only a few users.
Moving from TurboIMAGE/XL to IMAGE/SQL
Methods of
Accessing
Databases
Interactive Access
Programmatic Access
TurboIMAGE/XL and IMAGE/SQL both oer a variety of tools for
accessing databases and both provide techniques for concurrency
control, which regulates access by more than one user at a time.
TurboIMAGE/XL interactive access is through Query/3000, which
lets you nd database entries and report on them using the Query
command language. In IMAGE/SQL, the interactive interface is
known as ISQL, which uses Structured Query Language (SQL) to
access the database and display query results.
A major dierence between TurboIMAGE/XL and IMAGE/SQL is
in the programmatic interface. TurboIMAGE/XL provides a set of
intrinsics that you use in application programs to open databases,
obtain locks, retrieve data, unlock data items and data sets, and close
a database.
IMAGE/SQL uses embedded SQL programming. You insert
standard SQL statements in an application program, then you
preprocess the program to convert the SQL statements into valid
procedure calls in the language you are using. The converted code is
compiled and linked with a library of IMAGE/SQL routines. You
can prototype and test your queries in ISQL before using them in
an application, thus saving development time. Embedded SQL also
includes a set of dynamic statements that let your end users perform
queries, inserts, updates, and deletes through your applications.
Moving from TurboIMAGE/XL to IMAGE/SQL
3-9
Locking Mechanisms
In TurboIMAGE/XL, you use the DBLOCK intrinsic in certain
access modes to provide locking at the database level, the data set
level, or the data item level. Locking must be explicitly requested by
the user; it is required for concurrent updates. You can request locks
conditionally in TurboIMAGE/XL, which means that the call returns
if the lock request fails.
In IMAGE/SQL, locking is provided when:
it is implicitly specied when the data is accessed (such as when
inserting, deleting, or updating.) The whole data set is locked until
the end of the transaction. For example,
BEGIN WORK
SELECT * FROM Turbo.Dataset
DELETE FROM Turbo.Dataset
WHERE Mynumber=25
<-----
LOCK begins
<-----
UNLOCK occurs
SELECT * FROM Turbo.Dataset
COMMIT WORK
it is explicitly specied by the LOCK TABLE statement.
Locking is unconditional and applies at the table level; row and
page level locking is not supported. Refer to the ALLBASE/SQL
Reference Manual for more details.
3-10
Moving from TurboIMAGE/XL to IMAGE/SQL
4
A Database Example
This chapter presents a simple database example that will be used in
the remaining chapters of this manual. The areas to be covered are:
Understanding the environment
Describing the example application
Describing the logical data entities
Identifying relationships between entities
Dening the data sets
Dening the security scheme
Dening the TurboIMAGE/XL database
Creating the TurboIMAGE/XL database
After completing this chapter, you will have a TurboIMAGE/XL
database ready to undergo IMAGE/SQL tasks described in Chapter
5, \IMAGE/SQL Tasks."
Understanding the
Environment
The IMAGE/SQL environment requires a TurboIMAGE/XL
database that may or may not have an existing application to
support it. If your site already has TurboIMAGE/XL databases,
your design work is already done for you. To describe the concepts of
IMAGE/SQL, a TurboIMAGE/XL database must be dened.
The application presented in this chapter is a simple demonstration
of some key IMAGE/SQL features. The design is not sophisticated.
Database design is the subject of much theoretical discussion and
debate, but performance and exibility usually surface as desired
results. The database design presented here may not provide either,
but it does demonstrate some key points of IMAGE/SQL.
A Database Example
4-1
The Example
Application
Suppose a radio station wants to have a database of classical music
recordings for use by the program director and announcers. The
station needs this information to plan a schedule of broadcasts, to
maintain a log of what is played, and to publish a monthly listener
guide. Here is some of the information that will be needed:
Album title, price, and duration
Recording company and date recorded
Medium (CD or cassette)
Selection titles and duration
Names of orchestra, conductor, singers, accompanists
Composer's names and other personal information
Miscellaneous comments
Date, time, and announcer for selections played
We will call these items attributes. They tend to fall into dierent
categories. Some pertain to albums, some to specic selections, and
others relate to when the selection is played. Before the database can
be created, the attributes must be organized into logical entities.
4-2
A Database Example
Logical Data Entities
To logically order the above information, each attribute must be
analyzed in terms of how it will be used. These logical groupings of
attributes are called entities.
The program director needs to know what albums are available,
the selections on each, how long each selection is, and some general
information about the style of performance. The announcers need to
know which selections are on which albums, how long each selection
is, and some information about the composers and artists. The
station log will track all music played, which announcer played it,
and when the selection started and nished.
The attributes can be divided into the following four categories of
information as required by the radio station:
Album information
Selection information
Composer information
Station log information
These constitute our four data entities.
Next, you need to identify which attributes belong to which entity.
Below is a table that shows one way of subdividing the attributes
amongst the entities. For each entity, one attribute in the list will
uniquely identify an instance of the entity. This attribute is known as
a key.
Attributes for Four Entities
Album
Entity
Selection
Entity
Composer
Entity
Station Log
Entity
Album Name
Medium
Album Cost
Recording Company
Date Recorded
Manufacturer's Code
Comment
Selection Title
Composer Name
Duration
Performers
Comment
Name
Date of Birth
Birthplace
Comment
Selection Title
Start Time
End Time
Announcer
Comment
As the design evolves, entities become tables and attributes become
columns. Recall that tables and columns are SQL concepts. Using
TurboIMAGE/XL terminology, the entities become data sets and the
attributes become data items. The key, in TurboIMAGE/XL, is also
known as a search item.
Examining the data, you will see some overlapping attributes. These
will help you dene the relationships between the entities.
A Database Example
4-3
Identifying
Relationships
Between Entities
After subdividing the data by entities, the next step of the design is
to identify meaningful relationships between the entities described
so far. For each relationship you identify, an attribute or group of
attributes must support the relationship. This may mean adding one
or more attributes to support the relationship.
What are the relationships among the entities in the sample data?
For the Albums and Selections entities, there is a relationship of
content ; that is, each album contains a specic group of selections.
For the Composers and Selections entities, the relationship is one of
authorship ; each composer has created one or more selections.
For each relationship dened, linking attributes are added to related
entities. In the case of Selections, the link is Selection Name. In
the case of Selections and Composers, the link is Composer Name.
Where the attribute is missing, it must be added to dene the
relationship.
After distributing the attributes, the next step is to identify those
attributes which will serve as keys to any unique occurrence of an
entity. It may be necessary to create attributes to clarify certain
ambiguities. For example, two albums could have the same name.
This situation is claried by creating an AlbumCode attribute
that will serve as the key to that entity. You can now see a set of
relational tables emerging, as follows (* indicates a key column):
Columns and Keys for Four Tables
Albums Table Selections Table Composers Table Station Log Table
*AlbumCode
AlbumTitle
Medium
AlbumCost
RecordingCo
DateRecorded
MfgCode
Comment
*AlbumCode
*SelectionName
*ComposerName
Duration
Performers
*ComposerName
Birth
Death
Birthplace
Comment
*AlbumCode
*SelectionName
StartTime
EndTime
Announcer
Some entities contain a unique occurrence for the key values, other
entities will have multiple occurrences for a key value. For example,
the composer Beethoven will exist once in the Composers entity.
There can be, however, many selections by this composer. Also, a
selection, Beethoven's Fifth Symphony, could be on several albums
performed by dierent orchestras.
4-4
A Database Example
From a relationship point of view, this is called referential integrity,
where an occurrence of information in one entity is required
to support the existence of information in another entity. To
demonstrate referential integrity, suppose the station receives a new
album containing Beethoven's greatest symphonies as performed by
the San Francisco Symphony Orchestra. This album is entered into
the Albums entity. Each selection from the album is added to the
Selections entity, which includes the attribute Composer Name. A
relationship exists between Selections and Composers based upon
this attribute. For the data to be complete, an entry for Beethoven
must be added in the Composers entity. Once this is done, referential
integrity has been established. Without it, the referential model is
incomplete.
A Database Example
4-5
Defining the Data
Sets
Once you have added the necessary key attributes that support
the relationships, you have completed the majority of the work in
designing the TurboIMAGE/XL database. Before the database can
be completed, paths, a distinction of TurboIMAGE/XL, must be
dened.
Paths are xed relationships between entities that provide fast access
to data and dene referential integrity. Relationships are dened by
designating entities as Master Data Sets and Detail Data Sets, and
then linking them with paths.
Note that the Composers and Albums entities each have only one key
item, whereas the other entities have more than one. A Master set,
by denition, has one key item, whereas a Detail set may have up to
sixteen. A Detail set contains one or more entries linked to a Master
entry where the key values agree.
For example, Album Code 0019 is assigned to the Beethoven's hits
album mentioned before. This information is in the Albums entity.
There are two selections on the album:
Beethoven's Fifth Symphony
Beethoven's Ninth Symphony
These entries are in the Selections entity.
If a query is made for Album Code 0019 against Albums, one entry is
returned. There should only ever be one entry returned. If the same
Album Code is requested from Selections, two entries are returned,
equal to the number of selections on the album.
Albums, then, is a candidate for being a Master data set and
Selections will be a Detail data set. Selections also has a second key,
Composer Name, a condition that forces it to be a Detail set.
One other distinction within TurboIMAGE/XL before continuing
with our design: Master sets are either Manual Masters or Automatic
Masters. Each has a single key, but Automatic Masters can contain
no other attributes. Manual Masters can have other attributes per
entry.
4-6
A Database Example
Also, Automatic Master key values are added and deleted
automatically; their function is to provide fast access paths to data.
Manual Master key values and their associated attributes must be
added and deleted explicitly, thereby supporting the referential
integrity concept discussed earlier and providing fast access to data.
The TurboIMAGE/XL database designed so far is shown in
Figure 4-1.
Figure 4-1. Database Design
Composers and Albums are Manual Master data sets, Selections and
Log are Detail data sets. Because Selection Name is a key value in
both Selections and Log, a supporting Automatic Master was created
to supply the keyed access to these two entities.
Before you see the schema to create this database, a nal design
consideration must be addressed: security.
A Database Example
4-7
Defining the
Security Scheme
The radio station manager wants to have complete access to all the
information in the database. Announcers need to read information
about Albums, Selections, Composers, and the Log. The program
director adds information about new albums and decides what will be
played for publication in the monthly listener guide.
A security scheme will allow database accessors to do only what has
been assigned or expected of them and nothing more. The security
can be broken down to these three levels:
Manager
Read and Write all entities
Director
Read all entities, Write all but Log
Announcer
Read all entities, Write Log
To complete this security scheme in TurboIMAGE/XL, you will
dene a password for each of these levels and assign it a numeric
value. For simplicity sake, we will use:
MGR
DIR
ANNCR
10
20
30
Applying these to the data sets results in the following:
Albums
Selections
Composers
Log
Read
Read
Read
Read
10,
10,
10,
10,
20,
20,
20,
20,
30;
30;
30;
30;
Write
Write
Write
Write
10,
10,
10,
10,
20
20
20
30
Each individual will be assigned one of these passwords to be used
when accessing the database. The password will designate the data
that can be accessed and the method of access.
The next section will show you the schema for our now complete
TurboIMAGE/XL database. In that schema, you will see the syntax
for this security schema.
4-8
A Database Example
Defining the
TurboIMAGE/XL
Database
A TurboIMAGE/XL schema is made up of three parts:
Password
Item
Set
The Password Part was discussed in the previous section.
The Item Part contains the list of attributes, called items, in the
database. Only a single denition is required, even if the item is used
in the database in more than one set. Also included in the Item Part
is each item's data type and length. Data types are discussed in the
section, \Mapping of Data Types," in Chapter 3 and will not be
addressed here.
The Set Part describes the entities, the set type, the security, and the
items that make up the entry. Size is also dened, with a capacity
value that indicates the maximum number of entries for that entity.
The database schema presented in this section is included with the
IMAGE/SQL product and is found in SAMPLEDB.SYS. Practice
with this database is in Chapter 6, \Practicing with IMAGE/SQL
Using MusicDBE."
The schema for the sample database is as follows:
Begin data base Music;
Passwords: 10 MGR;
20 DIR;
30 ANNCR;
Items:
AlbumCode,
I2;
AlbumCost,
P8;
AlbumTitle,
X40;
Announcer,
X40;
Birth,
X16;
BirthPlace,
X40;
Comment,
X80;
ComposerName,
X16;
DateRecorded,
X16;
Death,
X16;
EndTime,
X16;
Medium,
X2;
MfgCode,
X40;
Performers,
X40;
RecordingCo,
X10;
SelectionName,
X40;
StartTime,
X16;
Timing,
X16;
A Database Example
4-9
Sets:
Name: Albums, Manual(10,20,30/10,20);
Entry: AlbumCode (2),
AlbumTitle,
Medium,
AlbumCost,
RecordingCo,
DateRecorded,
MfgCode,
Comment;
Capacity: 1000;
Name: Composers, Manual (10,20,30/10,20);
Entry: ComposerName (1),
Birth,
Death,
Birthplace,
Comment;
Capacity: 1000;
Name: Selections-A, Automatic;
Entry: SelectionName(2);
Capacity: 1000;
Name: Selections, Detail (10,20,30/10,20);
Entry: AlbumCode (Albums),
SelectionName (Selections-A),
ComposerName (Composers),
Timing,
Performers,
Comment;
Capacity: 1000;
Name: Log, Detail (10,20,30/10,30);
Entry: AlbumCode (Albums),
SelectionName (Selections-A),
StartTime,
EndTime,
Announcer;
Capacity: 1000;
End.
4-10
A Database Example
The next step is to create a root le for this database with
DBSCHEMA as follows:
:FILE DBSTEXT = MUSICSCH.SAMPLEDB.SYS
:RUN DBSCHEMA.PUB.SYS;PARM=3
The schema is displayed here, followed by this detail:
DATA SET
NAME
TYPE
FLD PT ENTR
CNT CT LGTH
MED CAPACITY
REC
ALBUMS
M 8
2 98
115 1000
COMPOSERS
M 5
1 84
95
1000
SELECTIONS-A
A 1
2 20
37
1000
SELECTIONS
D 6
3 98
110 1000
LOG
D 5
2 58
66
1001
TOTAL DISC SECTORS INCLUDING ROOT: 3664
NUMBER OF ERROR MESSAGES: 0
ITEM NAME COUNT: 18
DATA SET COUNT: 5
ROOT LENGTH: 916
BUFFER LENGTH: 463
BLK
FAC
4
4
10
4
7
BLK DISC
LGTH SPACE
461
381
371
441
463
1008
752
304
1008
576
TRAILER LENGTH: 256
ROOT FILE MUSIC CREATED.
A Database Example
4-11
Creating the
TurboIMAGE/XL
The last step to creating the database is to create the sets. This is
done with DBUTIL:
Database
:RUN DBUTIL.PUB.SYS
HP30391C.04.09 TurboIMAGE/XL:
DBUTIL (C) COPYRIGHT HEWLETT-PACKARD
>>CREATE MUSIC
Database MUSIC has been CREATED.
>>EXIT
Your TurboIMAGE/XL database now exists.
This chapter covers a very small part of creating databases with
the TurboIMAGE/XL Database Management System. For more
details, refer to the TurboIMAGE/XL Database Management System
Reference Manual .
You are now ready to begin the tasks in Chapter 5, \IMAGE/SQL
Tasks," to access this database with SQL.
4-12
A Database Example
5
IMAGE/SQL Tasks
This chapter shows selected IMAGE/SQL tasks. See Chapter 6,
\Practicing with IMAGE/SQL Using MusicDBE," for more examples
using MusicDBE.
This chapter shows the following:
Setting up a database with ISQL
Conguring a DBEnvironment
Attaching a TurboIMAGE/XL database
Detaching a TurboIMAGE/XL database
Displaying IMAGE/SQL utility information
Issuing MPE/iX commands from the IMAGE/SQL utility
Setting IMAGE/SQL le equations
Logging IMAGE/SQL utility commands
Using IMAGE/SQL utility command les
Accessing TurboIMAGE/XL data with ISQL
Maintaining the ATCINFO le
About the Tasks
Where applicable, each task is divided into three parts:
Getting Ready
describes preparatory steps and gives
information you need to know before
performing the task.
Performing the Task describes how to perform the task.
Task Reference
lists information useful when performing
the task and provides cross-references to
related tasks.
To perform most tasks, you must be attached to the
DBEnvironment. Here are some general guidelines:
To issue the SET commands, you must be the creator or supply
the maintenance word of the TurboIMAGE/XL database or
DBEnvironment named in the command.
For most other commands, you must be a DBA of the
DBEnvironment. For commands involving database security, you
must be the Database Creator. The maintenance word is not
sucient.
IMAGE/SQL Tasks
5-1
Figure 5-1 shows the prerequisites needed to issue all IMAGE/SQL
utility commands. For complete IMAGE/SQL utility command
syntax, refer to the HP IMAGE/SQL Administration Guide .
Figure 5-1. IMAGE/SQL Utility Command Prerequisites
5-2
IMAGE/SQL Tasks
This task shows how to set up a new database environment using
the IMAGE/SQL utility and ISQL, the interactive component of
Hewlett-Packard's SQL products.
Setting Up a
Database with ISQL
The steps to create the database environment are:
Running ISQL
Creating a DBEnvironment
The example chosen to illustrate these steps is a database of
information about record albums. This database environment will
be used again in Chapter 6, \Practicing with IMAGE/SQL Using
MusicDBE."
Before you can create a new DBEnvironment, you must run ISQL.
Running ISQL
Performing the Task
Run ISQL by entering the following at your operating system
prompt:
:RUN ISQL.PUB.SYS 4Return5
You will then see the ISQL banner as shown in Figure 5-2 (some
details may be slightly dierent on your system):
d
a
IIIIIIII
II
II
II
II
II
IIIIIIII
SSSSSSSS
SS
SS
SSSSSS
SS
SS
SSSSSSS
QQQQQQQ
QQ
QQ
QQ
QQ
QQ
QQ
QQ Q QQ
QQ
QQ
QQQQQQ QQ
LL
LL
LL
LL
LL
LL
LLLLLLLLL
MON, FEB 8, 1993, 10:51 AM
HP36216-02A.F0.29
Interactive SQL/3000
ALLBASE/SQL
(C)COPYRIGHT HEWLETT-PACKARD CO. 1982,1983,1984,1985,1986,1987,1988,
1989,1990,1991,1992. ALL RIGHTS RESERVED.
c
isql=>
b
Figure 5-2. ISQL Banner
Use a semicolon and press 4Return5 to terminate a command in
ISQL. If you forget to use the semicolon, a continuation prompt
appears:
>
Type a semicolon and press 4Return5, or to terminate, type //.
IMAGE/SQL Tasks
5-3
Leave ISQL by typing the following:
isql=>EXIT; 4Return5
If ISQL asks whether or not you want to commit work, you must
reply either Y or N and press 4Return5. Entering Y makes the work
you have done permanent.
Creating a
DBEnvironment
To create a new DBEnvironment, use the START DBE NEW
command at the ISQL prompt. This is explained in the next task.
Task Reference
For complete information about startup parameters, refer to the
\DBEnvironment Conguration and Security" chapter of the
ALLBASE/SQL Database Administration Guide .
For more information about log les, refer to the \Backup and
Recovery" chapter in the ALLBASE/SQL Database Administration
Guide .
For more information on conguring a DBEnvironment, refer to
the entry for START DBE NEW in the \SQL Statements" chapter
of the ALLBASE/SQL Reference Manual . This entry describes all
the default conguration values used in creating MUSICDBE.
5-4
IMAGE/SQL Tasks
Configuring a
DBEnvironment
This task describes how to congure a DBEnvironment so that you
can access your TurboIMAGE/XL database(s) with IMAGE/SQL
(see Task Reference).
Getting Ready
When all of the TurboIMAGE/XL databases to be attached to the
DBEnvironment are created by the same user in one group and
account, it is convenient to congure the DBEnvironment in this
group and account.
If this is not the case, several other issues should be considered.
The following considerations apply if the TurboIMAGE/XL
database to be attached exists in a dierent group and/or account
than the DBEnvironment:
IMAGE/SQL supports standard MPE/iX security rules. Make
sure correct user, group, and account capabilities are in place
when you plan to access a TurboIMAGE/XL database from a
DBEnvironment in a dierent account than the database.
Make sure maintenance words exist for both database
management systems, because IMAGE/SQL utility
administrators often need to specify DBEnvironment and
TurboIMAGE/XL maintenance words if they are not the creator.
Be sure to grant DBA authority to everyone who will be
performing IMAGE/SQL utility tasks (see Task Reference),
because IMAGE/SQL utility administrators need DBA authority
to perform most IMAGE/SQL utility tasks.
Make sure the TurboIMAGE/XL database and the
DBEnvironment have the same native language support (NLS)
dened for them.
When a DBEnvironment is congured, two les are created:
DBEFILE0 and DBELOG1. IMAGE/SQL requires that these
les be larger than their defaults. Make sure these les are large
enough to accommodate IMAGE/SQL. In the example below, a
le size of 500 pages is used for each of these les, but you may
need to adjust these sizes, depending on the size and number
of TurboIMAGE/XL databases you plan to attach (see Task
Reference).
IMAGE/SQL Tasks
5-5
Performing the Task
Log on in the same group and account as the TurboIMAGE/XL
database(s) and run ISQL. At the ISQL prompt, enter the START
DBE NEW command. For example, to congure a DBEnvironment
named MusicDBE, enter the following:
isql=> START DBE 'MUSICDBE' MULTI NEW
> MAXIMUM TIMEOUT = 10 SECONDS
> DEFAULT TIMEOUT = 5 SECONDS
> DBEFILE0 DBEFILE DBEFILE0 (=DBEFile0Denition
> WITH PAGES = 500,
(= .
.
> NAME = 'MusicF0',
(= .
.
> LOG DBEFILE DBELOG1
(=DBELog0Denition
> WITH PAGES = 500,
(= .
.
> NAME = 'MusicLog';
(= .
.
isql=> EXIT;
:
If you forget the semicolon, ISQL prompts you. At this prompt,
enter a semicolon and ISQL will execute the command. The MULTI
parameter is necessary if you plan on a multiuser IMAGE/SQL
environment.
To avoid deadlock situations when there are more than two
connections, you should either set the MAXIMUM TIMEOUT
and DEFAULT TIMEOUT options with the START DBE NEW
statement or change them with the SQLUtil ALTDBE command.
To set a maintenance word for the newly congured DBEnvironment,
use the SETDBEMAINT command of SQLUtil. This utility prompts
you for necessary information, as in the following example.
:RUN SQLUTIL.PUB.SYS
THU, APR 8, 1993, 10:26 AM
HP36216-02A.F0.52
DBE Utility/3000
ALLBASE/SQL
(C)COPYRIGHT HEWLETT-PACKARD CO. 1982,1983,1984,1985,1986,1987,1988,
1989,1990,1991,1992,1993. ALL RIGHTS RESERVED.
>>SETDBEMAINT
Environment Name: MUSICDBE
Current Maintenance Word:
New Maintenance Word: usr
Retype New Maintenance Word: usr
Maintenance word changed.
>>EXIT
5-6
IMAGE/SQL Tasks
Listing the Newly
Created Files
When you display the les in your current group, note that there are
three newly created les: MUSICDBE, DBEFILE0, and DBELOG1.
The rst le is the DBECon le or DBEnvironment conguration
le. This has the same name you assigned to the DBEnvironment
in the START DBE command. The DBECon le contains startup
parameters for the DBEnvironment.
DBEFILE0 is a le containing the data for the SYSTEM
DBEFileSet, which contains the system catalog. (You'll examine the
system catalog later.)
DBELOG1 is the log le, which records operations that modify the
database.
Once you have congured the DBEnvironment, set the timeout
time, and set a maintenance word for it, you are ready to attach
TurboIMAGE/XL databases to it, as shown in the next task.
Task Reference
No information is given here about considerations that may be
necessary when conguring a DBEnvironment that contains native
ALLBASE/SQL databases. Consult the ALLBASE/SQL Database
Administration Guide for more guidance in this area.
The following summaries of IMAGE/SQL commands will get you
started. Refer to the ALLBASE/SQL Reference Manual for more
information.
The ALLBASE/SQL START DBE NEW statement has the
following syntax:
2
3
START DBE 'DBEnvironmentName' MULTI NEW
3
2
DUAL LOG
6 BUFFER = (DataBuPages,LogBuPages) 7
7
6
7
6 LANG = LanguageName
7|, . . . |
6
7
6 TRANSACTION = MaxTransactions
7
6
4 DBEFile0Denition
5
DBELogDenition
Refer to the Performing the Task example for details of the
syntax for DBEFile0Denition and DBELogDenition .
Use SQLUtil to set a DBEnvironment maintenance word. To
access SQLUtil, issue the following command:
:RUN SQLUTIL.PUB.SYS
IMAGE/SQL Tasks
5-7
The SQLUtil SETDBEMAINT command is used to set a
maintenance word. The syntax for this command is as follows:
>> SETDBEMAINT
DBEnvironment Name: DBEnvironmentName
Current Maintenance Word: OldMaintenanceWord
New Maintenance Word: NewMaintenanceWord
Retype New Maintenance Word: NewMaintenanceWord
>>EXIT
When no current maintenance word exists, enter a carriage return
at the \Current Maintenance Word:" prompt.
5-8
IMAGE/SQL Tasks
This task describes how to attach a TurboIMAGE/XL database.
Attaching a
TurboIMAGE/XL
Database
Note
If you are attaching a database with the same name but in a dierent
group and/or account from a database already attached to the
DBEnvironment, you must specify an alternative owner name at
attach time (see Task Reference). This is because in a mapped table,
by default, the owner name is the database name, and duplicate
table names are not allowed within the same database. In any case,
you cannot attach the same TurboIMAGE/XL database twice to the
same DBEnvironment.
Getting Ready
It is convenient to have the TurboIMAGE/XL database and the
DBEnvironment in the same group and account.
If this is not the case, there are several issues to consider. The
following considerations apply if the TurboIMAGE/XL database(s)
to be attached exist(s) in a dierent group and/or account than the
DBEnvironment:
IMAGE/SQL supports standard MPE/iX security rules. Correct
user, group, and account capabilities must be in place to use
IMAGE/SQL to access a TurboIMAGE/XL database from a
DBEnvironment in a dierent account than the database.
IMAGE/SQL utility administrators often need to specify
DBEnvironment and TurboIMAGE/XL maintenance words as a
part of the SET command if they are not the creator. Because of
this, it is recommended that maintenance words exist for both
database management systems.
IMAGE/SQL utility administrators need DBA authority to
perform most IMAGE/SQL utility tasks. Be sure to grant DBA
authority to everyone who will be performing IMAGE/SQL
utility tasks (see Task Reference).
The TurboIMAGE/XL database and the DBEnvironment must
have the same native language support (NLS) dened for them.
Be sure that all processes accessing the DBEnvironment are
shutdown before using the ATTACH command. The ATTACH
command using the IMAGE/SQL utility requires exclusive access
to the DBEnvironment.
The ATTACH command requires that the appropriate SET
SQLDBE and SET TURBODB commands have been issued. To
check the status of these commands, use the DISPLAY OPTIONS
command:
IMAGE/SQL Tasks
5-9
:RUN IMAGESQL.PUB.SYS
HP36385B X.F0.12
IMAGE/SQL Utility
(C) COPYRIGHT HEWLETT-PACKARD COMPANY 1993
THU, APR 8, 1993, 10:30 AM
>>DISPLAY OPTIONS
Current base
:
Current SQLDBE :
Echo
: ON
Command Logging : ON
Log File
: ATCLOG.PUB.TURBONM
Because there is no current database or DBEnvironment, issue the
SET command as follows:
>>SET SQLDBE MUSICDBE.PUB.TURBONM
>>SET TURBODB MUSIC.PUB.TURBONM
>>
Another DISPLAY OPTIONS command conrms that there is now
a current database and DBEnvironment:
>>DISPLAY OPTIONS
Current base
:
Current SQLDBE :
Echo
:
Command Logging :
Log File
:
5-10
IMAGE/SQL Tasks
MUSIC.PUB.TURBONM
MUSICDBE.PUB.TURBONM
ON
ON
ATCLOG.PUB.TURBONM
Performing the Task
Once you are sure the appropriate SET command have been
specied and that the correct MPE/iX security is in place, issue the
IMAGE/SQL utility ATTACH command.
>>ATTACH
Split 1 compound source fields (ATCWARN 32063).
Mapped 15 source table/source field names (ATCWARN 32062).
Mapped 1 incompatible source types (ATCWARN 32061).
>>
Messages issued at attach time inform you if any mapping has been
done (see Task Reference). The MUSIC database is now a logical
part of the MusicDBE DBEnvironment. Although the data remains
in the TurboIMAGE/XL database, it can now be selected from
mapped tables just as it would be selected from ALLBASE/SQL
tables.
Task Reference
By default, the IMAGE/SQL utility uses the TurboIMAGE/XL
database name as the owner name. You must specify an alternative
owner name if you are attaching a TurboIMAGE/XL database
with the same name as one already attached. To do this, use the
WITH OWNER= parameter of the ATTACH command.
To specify a maintenance word, use the MAINT= parameter of
the SET TURBODB or SET SQLDBE command. Refer to the
HP IMAGE/SQL Administration Guide for details about these
commands and their parameters.
Use the DISPLAY MAP command to see detailed database
mapping information.
When a TurboIMAGE/XL database is attached to a
DBEnvironment, IMAGE/SQL performs the following tasks:
Makes a table entry in the system catalog of the DBEnvironment
for each corresponding source data set.
Creates a column denition for each eld in the source data set.
(The NOT NULL option is used because null values are not
dened in TurboIMAGE/XL.)
Produces default mapping information which maps
TurboIMAGE/XL data sets to SQL tables and stores this
information in the ATCINFO le. Specically, mapping is done
in the following areas:
IMAGE/SQL Tasks
5-11
Data item and data set names
Some characters allowed in TurboIMAGE/XL names
(specically: + 0 * / ? ' % & ) are not valid SQL
names. Therefore, whenever IMAGE/SQL utility encounters
such a character in a TurboIMAGE/XL name, it converts it
to an underscore ( ).
Data types
TurboIMAGE/XL data types are mapped to SQL data
types. When inexact or imprecise mapping is necessary,
an `I' appears in the NOTES section of the DISPLAY
MAP display. When a compound eld is split into separate
mapped columns, an S appears in the NOTES section of the
display.
User security
Initially, only the TurboIMAGE/XL database creator (DBC)
is dened as a user in the DBEnvironment. For other users
to access the attached database, the DBC must add users
with IMAGE/SQL utility's ADD USER command.
Once the database is attached, the DBC must add any additional
IMAGE/SQL users.
It is desirable to update data types and split mapped columns
before IMAGE/SQL users access the attached database. For
details, refer to the HP IMAGE/SQL Administration Guide . This
is because whenever a mapped column is split or updated, any
user-created views containing these mapped columns are dropped.
5-12
IMAGE/SQL Tasks
Detaching a
TurboIMAGE/XL
Database
This task describes how to detach a TurboIMAGE/XL database from
a DBEnvironment.
Getting Ready
Before detaching a TurboIMAGE/XL database, do the following:
Obtain exclusive access to the DBEnvironment.
Make sure the appropriate SET SQLDBE and SET TURBODB
commands have been issued. To check the status of these
commands, use the DISPLAY OPTIONS command:
>>DISPLAY OPTIONS
Current base
:
Current SQLDBE :
Echo
: ON
Command Logging : ON
Log File
: ATCLOG.PUB.TURBONM
>>
If necessary, issue the SET command. For example:
>>SET SQLDBE MUSICDBE.PUB.TURBONM
>>SET TURBODB MUSIC.PUB.TURBONM
>>
Performing the Task
Once you have issued the appropriate SET commands, you are ready
to detach the database from the DBEnvironment. For example:
>>DETACH
>>
This command detaches the MUSIC database from the MusicDBE
DBEnvironment. If MUSIC is the only database attached to
MusicDBE, the ATCINFO le will be deleted. If MusicDBE is the
only DBEnvironment to which MUSIC is attached, the MUSICTC
le will also be deleted.
In addition, all mapped table denitions are removed from the
DBEnvironment system catalog. All IMAGE/SQL views and
user-created views based on IMAGE/SQL tables and views are
dropped.
IMAGE/SQL Tasks
5-13
Task Reference
There are several reasons to detach a TurboIMAGE/XL database
from a DBEnvironment:
If the database is to be restructured. (This includes
restructuring with DBChange and other third-party
restructuring tools.)
If ALLBASE/SQL is to be migrated back to a version that does
not support IMAGE/SQL.
If you wish to reset all mapping information to default values.
All mapped tables, all IMAGE/SQL views based on these tables,
and all user-created views based on IMAGE/SQL views and tables
are dropped when the database is detached.
The ATCINFO le is purged when it no longer contains mapping
information about any databases.
The DBaseName TC le is deleted when the database is no longer
attached to any DBEnvironments.
5-14
IMAGE/SQL Tasks
Displaying
IMAGE/SQL Utility
Information
This task describes how to display IMAGE/SQL information using
several IMAGE/SQL utility commands. These commands include:
DISPLAY OPTIONS Displays the options in eect for your
current IMAGE/SQL utility session.
DISPLAY TURBODB Displays all the TurboIMAGE/XL
databases associated with a specic
DBEnvironment.
DISPLAY MAP
Displays the current data type mapping
information for a specic TurboIMAGE/XL
database.
DISPLAY SQLDBE
Displays all the DBEnvironments associated
with a specic TurboIMAGE/XL database.
DISPLAY USER
Displays the current information about
users in a specic TurboIMAGE/XL
database.
HELP
Provides the syntax of IMAGE/SQL utility
commands.
Getting Ready
The DISPLAY command provide two options: Either issue SET
commands before displaying information, or specify a particular
TurboIMAGE/XL database or DBEnvironment as part of the
DISPLAY command.
For DISPLAY SQLDBE and DISPLAY TURBODB to display
useful information, at least one database should be attached.
For DISPLAY MAP AND DISPLAY USER to display useful
information, a database should be attached.
Performing the Task
Examples using the DISPLAY command are shown on the following
pages.
IMAGE/SQL Tasks
5-15
Example 1: Displaying
Database Information
To see all the TurboIMAGE/XL databases and mapped tables
currently associated with MusicDBE, use the DISPLAY TURBODB
command.
:RUN IMAGESQL.PUB.SYS
>>DISPLAY TURBODB TABLES FOR MUSICDBE.PUB.TURBONM
DBEnvironment
: MUSICDBE.PUB.TURBONM
TURBOIMAGE/XL DATABASE
----------------------
OWNER
-----
MAPPED TABLE
------------
MUSIC.PUB.TURBONM
MUSIC
ALBUMS
COMPOSERS
SELECTIONS_A
SELECTIONS
LOG
Total Databases : 1
>>
Any databases attached to the DBEnvironment and their associated
mapped tables are displayed.
Example 2: Displaying
Database Mapping
Information
The DISPLAY MAP command shows how TurboIMAGE/XL data
sets are mapped to ALLBASE/SQL tables. In the following example,
information about the mapped table ALBUMS is displayed.
>>DISPLAY MAP ALBUMS
ATTACHED BASES
DBEnvironment
Owner Name
: MUSIC.PUB.TURBONM
: MUSICDBE.PUB.TURBONM
: MUSIC
MAPPED(SOURCE)
SOURCE
MAPPED
SOURCE
MAPPED
TABLE
FIELD
COLUMN
TYPE
TYPE
NOTES
------------ ---------------- -------------------- ------- -------------- ----ALBUMS (ALBUMS)
ALBUMCODE
ALBUMTITLE
MEDIUM
ALBUMCOST
RECORDINGCO
DATERECORDED
MFGCODE
COMMENT
5-16
IMAGE/SQL Tasks
ALBUMCODE
ALBUMTITLE
MEDIUM
ALBUMCOST
RECORDINGCO
DATERECORDED
MFGCODE
COMMENT
I2
X40
X2
P8
X10
X16
X40
X80
INTEGER
CHAR(40)
CHAR(2)
DECIMAL(7,0)
CHAR(10)
CHAR(16)
CHAR(40)
CHAR(80)
Example 3: Displaying
DBEnvironment
To see the ALLBASE/SQL DBEnvironment currently associated
with MusicDBE, use the DISPLAY SQLDBE command.
Information
>>DISPLAY SQLDBE
ATTACHED BASES
: MUSIC.PUB.TURBONM
DBENVIRONMENT
------------MUSICDBE.PUB.TURBONM
Example 4: Displaying
User Information
To see the current user information associated with MusicDBE, use
the DISPLAY USER command.
>>DISPLAY USER
ATTACHED BASES
DBEnvironment
: MUSIC.PUB.TURBONM
: MUSICDBE.PUB.TURBONM
USER LOGON
----------
DBOPEN MODE USER PASSWORD
----------- -------------
USER CLASS
----------
MGR@TURBONM
5
64
;
IMAGE/SQL Tasks
5-17
Issuing MPE/iX
Commands from the
IMAGE/SQL Utility
This task describes how to issue MPE/iX commands from the
IMAGE/SQL utility.
Performing the Task
To issue an MPE/iX command, at the IMAGE/SQL utility prompt
enter a colon (:) and the name of the MPE/iX command you wish to
issue.
For example, to issue the LISTF command:
>>:LISTF
FILENAME
ATCINFO
DBUSA03
DBEFILE0
DBUSASCH
DBELOG1
DBUTIL
DBUSA
MUSIC
DBUSA01
MUSICDBE
DBUSA02
MUSICTC
>>
The IMAGE/SQL utility prompt returns after the MPE/iX
command is executed.
5-18
IMAGE/SQL Tasks
Setting IMAGE/SQL
File Equations
Setting a File Equation
for ATCINFO
This task describes how to set IMAGE/SQL utility le equations for
two les: ATCINFO and ATCLOG.
Performing the Task
An ATCINFO le equation can only be set before the le is created
(before any TurboIMAGE/XL databases are attached to the
DBEnvironment; see Task Reference). Only the le name can be
specied. Other parameters of the FILE command will not be valid
at attach time.
For example:
:FILE ATCINFO = SONGSCR
:
Setting a File Equation
for ATCLOG
A le equation for ATCLOG can be issued before beginning an
IMAGE/SQL utility session.
For example:
:FILE ATCLOG = LOGA1; SAVE
:
In the above example, when the logging option is on, IMAGE/SQL
Utility commands are logged to the permanent le, LOGA1.
A le equation for ATCLOG can also be set or reset from within the
IMAGE/SQL utility.
For example:
>>:FILE ATCLOG = LOGA2; SAVE
>>
Now when the logging option is on, IMAGE/SQL utility commands
are logged to the permanent le, LOGA2 (see Task Reference).
IMAGE/SQL Tasks
5-19
Task Reference
ATCINFO Reference
ATCINFO is a permanent privileged le containing mapping
information about data set and eld names, data types, and user
security. Its formal le designator is ATCINFO. The default name
of the ATCINFO le is DBEnvironment-name CR.
One ATCINFO le exists for each DBEnvironment. It is created
in the same group and account as the DBEnvironment and is
considered part of the DBEnvironment.
The ATCINFO le equation can only be used to specify a dierent
le name. It cannot be used to override other ATCINFO le
characteristics.
ATCLOG Reference
ATCLOG is a temporary unnumbered ASCII le to which all
IMAGE/SQL utility commands are written when IMAGE/SQL
utility logging is on. If this le does not already exist, it is created.
If it already exists as a temporary or permanent le, log le records
are appended to it. Its formal le designator is ATCLOG.
When an IMAGE/SQL utility session begins, logging is on and the
ATCLOG le is created (if it does not already exist) and opened in
the user's logon group and account. By default, it is a temporary
le named ATCLOG, but you may wish to set a le equation for
this le.
If you want to save the temporary le, either specify SAVE as a
part of the FILE command or save the le before ending your
current MPE/iX session.
The FILE command can be used to override default ATCLOG le
attributes, such as size and le domain. However, the log le must
remain an unnumbered ASCII le.
5-20
IMAGE/SQL Tasks
Logging IMAGE/SQL
Utility Commands
This task describes how to log IMAGE/SQL utility commands and
how to save frequently used command sequences in dierent log les
so they can easily be reissued in batch or interactive mode.
Performing the Task
By default, IMAGE/SQL utility commands are logged to an ASCII
le, ATCLOG, which you can read and edit. You can change log les
within IMAGE/SQL utility by issuing a le equation for ATCLOG.
For example, to rename and save the IMAGE/SQL utility log le as
a permanent le, set a le equation for the ATCLOG le before the
IMAGE/SQL utility is run:
:FILE ATCLOG = DOATTACH; SAVE
:
When the IMAGE/SQL utility is run, the DISPLAY OPTIONS
command conrms that commands are being logged to DOATTACH.
>>DISPLAY OPTIONS
Current base
Current SQLDBE
Echo
Command Logging
Log File
:
:
: ON
: ON
: DOATTACH.PUB.TURBONM
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
*** Database is not attached.
>>
The MUSIC database is then attached to the MusicDBE
DBEnvironment:
>>SET TURBODB MUSIC.PUB.TURBONM
>>SET SQLDBE MUSICDBE.PUB.TURBONM
>>ATTACH
>>
After the attach, the contents of the log le DOATTACH look like
this:
DISPLAY OPTIONS
SET TURBODB MUSIC.PUB.TURBONM
SET SQLDBE MUSICDBE.PUB.TURBONM
ATTACH
IMAGE/SQL Tasks
5-21
To close this log le and write to a new one, issue another MPE/iX
FILE command from within IMAGE/SQL utility. For example:
>>:FILE ATCLOG=UPDATYPE;SAVE
>>
The DISPLAY OPTIONS command conrms that commands are
now being logged to UPDATYPE:
>>DISPLAY OPTIONS
Set Turbodb
:
Set Sqldbe
:
Echo
:
Command Logging :
Log File
:
MUSIC.PUB.TURBONM
MUSICDBE.PUB.TURBONM
ON
ON
UPDATYPE.PUB.TURBONM
NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN
*** Database is attached.
Any IMAGE/SQL utility commands now issued are written to
UPDATYPE. For example, when the following command is issued,
>> UPDATE TYPE IN ALBUMS.DATERECORDED TO CHAR(20)
Updated information in table ALBUMS.
>>
the log le, UPDATYPE, contains the following commands:
DISPLAY OPTIONS
UPDATE TYPE IN ALBUMS.DATERECORDED TO CHAR(20)
Using this technique, you can create several les containing
often-used IMAGE/SQL utility commands. The commands in these
les can then be executed, using the XEQ command (see Task
Reference).
Log les can be edited with a text editor. (Be sure to keep the edited
le unnumbered or it cannot be used as a command le.)
Note
5-22
IMAGE/SQL Tasks
Many editors automatically insert an end-of-le marker at the end
of the text in an edited le. This prevents the le from having log
records appended to it. For this reason, if the original le is to be
used as a log le, you should keep the edited le under a dierent
name.
Task Reference
The section \Setting IMAGE/SQL File Equations" in this
chapter contains more information about issuing IMAGE/SQL le
equations.
The section \Using IMAGE/SQL Utility Command Files" in this
chapter contains more information about using the IMAGE/SQL
utility XEQ command interactively or in batch to execute
IMAGE/SQL utility commands.
When an IMAGE/SQL utility session begins, logging is on. The
temporary le, ATCLOG, is created (if it does not already exist)
and opened in the user's logon group and account. If the log le
already exists as a temporary or permanent le, log records are
appended to it.
If you want to save the temporary le, either save the le before
ending your current MPE/iX session or specify ;SAVE as a part of
the FILE equation.
The FILE command can be used to override default ATCLOG le
attributes, such as size and le domain. However, the log le must
remain an unnumbered ASCII le.
IMAGE/SQL Tasks
5-23
Using IMAGE/SQL
Utility Command
Files
This task describes how to execute an IMAGE/SQL utility command
le in interactive or batch mode.
Getting Ready
An IMAGE/SQL utility command le can be created with a text
editor or can be produced as part of the logging process (see Task
Reference). If you create or edit this le with an editor, note that it
must be kept unnumbered.
In the following examples, the le UPDATYPE contains the following
commands:
SET TURBODB MUSIC.PUB.TURBONM
SET SQLDBE MUSICDBE.PUB.TURBONM
UPDATE TYPE IN ALBUMS.DATERECORDED to CHAR(20)
EXIT
Note that the commands in this command le assume the
TurboIMAGE/XL database is already attached to the
DBEnvironment.
If you wish to see commands and comments as the command le is
executed, make sure the ECHO option is on (see Task Reference).
Performing the Task
The XEQ command allows you to specify a le containing
IMAGE/SQL utility commands as its parameter. To interactively
execute commands listed in a command le, run the IMAGE/SQL
utility by typing RUN IMAGESQL.PUB.SYS and then issue the
XEQ command. Note that in this example ECHO is o.
:RUN IMAGESQL.PUB.SYS
HP36385 B.F0.10
IMAGE/SQL Utility
(C) COPYRIGHT HEWLETT-PACKARD COMPANY 1992
FRI, DEC 18, 1992, 11:30 AM
>>XEQ UPDATYPE
Updated information in table ALBUMS.
:
The MUSIC database, previously attached to the MusicDBE
DBEnvironment, and data type mapping information has been
updated for the ALBUMS.DATERECORDED column of the
ALBUMS table.
5-24
IMAGE/SQL Tasks
You can also issue XEQ commands in batch mode. The following job
stream le contains XEQ commands that execute the commands in
the UPDATYPE le.
!job JIMAGESQL,USER2/KEVIN.ATC/MGR,PUB/ALL
!comment**************************************************************
!comment*
This job executes an IMAGE/SQL command file.
!comment**************************************************************
!
!tell USER2.ATC; /-->Start JIMAGESQL for MUSIC
!
!run IMAGESQL.PUB.SYS
!
!comment**************************************************************
!comment*
The UPDATYPE command file contains commands that SET
!comment*
the MUSIC database and the MusicDBE DBEnvironment.
!comment*
It then specifies alternative data type mapping for source
!comment*
data set fields and exits the IMAGE/SQL Utility.
!comment**************************************************************
!
XEQ UPDATYPE
!
!tell USER2.ATC; /-->End JIMAGESQL for MUSIC
!
!eoj
Note that in batch mode, if an error occurs, the job terminates. The
remaining commands are ushed.
Task Reference
An IMAGE/SQL command le is an unnumbered le containing a
list of IMAGE/SQL commands. If commands span more than one
line, use an ampersand (&) to continue the command to the next
line.
The section \Logging IMAGE/SQL Utility Commands" shows how
to use the IMAGE/SQL utility logging facility to create and save
les containing often-issued IMAGE/SQL utility commands.
For the syntax of the ECHO command, refer to the HP
IMAGE/SQL Administration Guide .
IMAGE/SQL Tasks
5-25
Accessing
TurboIMAGE/XL
Data with ISQL
This task briey describes how IMAGE/SQL users access
TurboIMAGE/XL data with ISQL.
Getting Ready
To successfully select TurboIMAGE/XL data with ISQL,
IMAGE/SQL users need to know the following:
How to use the IMAGE/SQL interface provided for them. The
examples in this manual use ISQL, which also requires familiarity
with the SQL SELECT statement.
The names of the mapped tables and/or views to which they have
access (see Task Reference).
Which columns map to TurboIMAGE/XL search items. Under
certain circumstances, using these mapped columns when selecting
data can improve performance (see Task Reference).
Which data is of type FLOAT. When selecting this data, users
should specify a range of values rather than a particular number.
This is necessary because some precision is lost when converting to
FLOAT.
Performing the Task
Because data has not yet been added to the MUSIC database, using
a SELECT statement at this point would not demonstrate its use. If
you want to see SELECT statements using the MUSIC database,
see the section \Selecting Data" in Chapter 6, \Practicing with
IMAGE/SQL Using MusicDBE."
Task Reference
The structure of the TurboIMAGE/XL database cannot be
changed with SQL statements. Therefore, SQL statements
that alter the structure of the database are not available to
IMAGE/SQL users.
When users have access to the entire data entry, they can select
data from the table itself. If they do not have access to the
entire data entry, they must select data from a view of the table
created for them by IMAGE/SQL. Table names are of the form
OwnerName.MappedTableName . View names are of the form
OwnerName.MappedTableName VUserClass# .
For examples of using the SELECT statement on the MUSIC
database, refer to Chapter 6, \Practicing with IMAGE/SQL Using
MusicDBE."
For detailed information about using the SELECT statement, refer
to the ALLBASE/SQL Reference Manual .
5-26
IMAGE/SQL Tasks
Maintaining the
This task describes how to maintain the ATCINFO le.
ATCINFO File
Getting Ready
Maintenance for the ATCINFO le (DBEnvironment-name CR) may
be necessary in either of the following situations:
If a crash occurs while the ATCINFO le is being modied. This
may be the case if a crash takes place when the IMAGE/SQL
administrator is in the midst of an IMAGE/SQL utility command
that updates the ATCINFO le. When this occurs, the RECOVER
command can be used to reconstruct the ATCINFO le.
If the ATCINFO le contains too much free space. This may
be the case if multiple databases are attached and then some
are detached from the DBEnvironment. When this occurs, the
RECOVER statment can be used to compact the data in the
ATCINFO le and return the free space to the le system.
Performing the Task
To recover the ATCINFO le associated with the MusicDBE
DBEnvironment, issue the following commands:
:RUN IMAGESQL.PUB.SYS
>>SET SQLDBE MUSICDBE
>>RECOVER
Checking physical file consistency and recovering free space.
Deleting unused mapped table entries.
Checking external cross references.
>>
Task Reference
For more information on the RECOVER command, refer to the HP
IMAGE/SQL Administration Guide .
IMAGE/SQL Tasks
5-27
6
Practicing with IMAGE/SQL Using MusicDBE
IMAGE/SQL software includes scripts and les for creating a sample
database and DBEnvironment. This chapter shows you how to
execute the script and create the TurboIMAGE/XL MUSIC database
and MusicDBE DBEnvironment. From there, you can examine the
database and insert and select data. After completing this chapter,
you should be more comfortable with the IMAGE/SQL environment.
The topics covered in this chapter are:
Setting up MUSIC and MusicDBE
Examining the database
Adding data
Selecting data
Modifying data
Deleting data
Practicing with IMAGE/SQL Using MusicDBE
6-1
This section shows you the steps to set up the database and
DBEnvironment.
Setting Up MUSIC
and MusicDBE
Before beginning, change into the group and account where you
want to create MUSIC and MusicDBE. For clarity, use an empty
group, if possible. This chapter uses the group PUB and the account
ACCOUNT.
A script is provided with the IMAGE/SQL product that simplies
the database creation and purging processes. To execute the script,
type:
:RUN IMSQL.SAMPLEDB.SYS
4Return5
A menu like the one in Figure 6-1 appears on your screen (some
details may dier on your system).
d
Options for Setting Up IMAGE/SQL Sample DBEnvironments
a
===============================================================
Choose one:
1.
2.
3.
4.
5.
6.
7.
0.
Create MUSIC IMAGE database
Display Music schema
Attach Music to MusicDBE
Display schema for MusicDBE
Purge Music
Purge MusicDBE
Help
Exit
===============================================================
c
Enter your choice=>
b
Figure 6-1. SQLSetup Menu
The options are described in Table 6-1.
6-2
Practicing with IMAGE/SQL Using MusicDBE
Table 6-1. Menu Options
Option
Description
1
Creates the TurboIMAGE/XL MUSIC database in your current
group and account.
2
Displays the MUSIC schema.
3
Uses IMAGE/SQL utility to attach MUSIC to MusicDBE.
4
Displays catalog information about MusicDBE.
5
Purges MUSIC. You must be the Creator or System Manager to
use this option.
6
Purges MusicDBE. You must be the DBECreator or System
Manager to use this option.
7
Displays the current help screen.
0
Exists IMSQL.
From the above menu, select Option 1 to create the
TurboIMAGE/XL MUSIC database in your group and account.
Next, select Option 3. This will execute IMAGESQL.PUB.SYS,
set the TURBODB parameter to MUSIC, and set the SQLDBE
parameter to the non-existent MusicDBE. The DBE will be
automatically created for you at this time. This option then attaches
MUSIC to MusicDBE.
When you return to the menu, select Option 0 to exit.
After completing Options 1 and 3, list the les in the current group
and account. You will nd the following les in your group:
FILENAME CODE ------------LOGICAL RECORD----------- ----SPACE---SIZE TYP
EOF
LIMIT R/B SECTORS #X MX
MUSIC
MUSIC01
MUSIC02
MUSIC03
MUSIC04
MUSIC05
MUSICDBE
MUSICDCR
MUSICDFL
MUSICDLG
MUSICTC
PRIV
PRIV
PRIV
PRIV
PRIV
PRIV
PRIV
PRIV
PRIV
PRIV
PRIV
128W
512W
384W
384W
512W
512W
2048W
2048W
2048W
256W
28W
FB
FB
FB
FB
FB
FB
FB
FB
FB
FB
FB
8
250
250
100
250
143
3
128
1000
1000
1
8
250
250
100
250
143
11
131072
1000
1000
1023
1
1
1
1
1
1
1
1
1
1
4
16
1008
752
304
1008
576
48
256
16000
2000
208
1
1
1
1
1
1
1
1
1
1
1
1
4
4
2
4
3
*
*
32
32
*
The les are all PRIV les, which means you cannot purge them
without special system authority. The DBUTIL and SQLUtil utilities
provide this authority.
Practicing with IMAGE/SQL Using MusicDBE
6-3
In this section, you will examine the objects that were created
within MusicDBE|tables, views, and authority structures.
Information about all these objects is in the system catalog, which is
automatically created by IMAGE/SQL when the DBEnvironment is
created and congured.
Examining The
Database
Run ISQL, then connect to MusicDBE using this CONNECT
command:
isql=>CONNECT TO 'musicdbe'; 4Return5
Now examine the system catalog by creating queries on the system
views. Use the following query exactly as shown to look at all the
tables and views created by the attach function. Type the query
exactly as shown because the owner name is case-sensitive.
isql=>SELECT NAME, OWNER, 4Return5
>DBEFILESET, TYPE 4Return5
>FROM SYSTEM.TABLE 4Return5
>WHERE OWNER = 'MUSIC'; 4Return5
d
c
The result table is shown below.
select name, owner, dbefileset, type from system.table where owner = 'MUSIC
--------------------+--------------------+--------------------+-----NAME
|OWNER
|DBEFILESET
|TYPE
--------------------+--------------------+--------------------+-----ALBUMS
|MUSIC
|SYSTEM
|
0
COMPOSERS
|MUSIC
|SYSTEM
|
0
LOG
|MUSIC
|SYSTEM
|
0
SELECTIONS
|MUSIC
|SYSTEM
|
0
SELECTIONS_A
|MUSIC
|SYSTEM
|
0
SELECTIONS_A_V0
|MUSIC
|SYSTEM
|
1
--------------------------------------------------------------------------Number of rows selected is 6
U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>, or e[nd] >e
Figure 6-2. Information on Tables and Views
Each table is listed in the NAME column. The OWNER column
species the database to which the table belongs. If you are not the
table owner (that is, if it is part of the TurboIMAGE/XL database),
you must prex the table name with its owner name whenever you
refer to it. In this example, a reference to the ALBUMS table would
be MUSIC.ALBUMS.
The DBEFILESET column contains the name of the DBEFileSet
an entry has been associated with. IMAGE/SQL tables are always
associated with the SYSTEM DBEFileSet.
The TYPE column indicates whether the entry is a table or a view.
Entries with type 0 are tables and entries with type 1 are views.
6-4
Practicing with IMAGE/SQL Using MusicDBE
a
b
You can see individual table descriptions by using the INFO
command, which returns the column denition of a table. Use the
following command for the Albums table:
Examining Table
Descriptions
isql=>INFO music.albums; 4Return5
d
The output from this ISQL command is shown below:
a
Column Name
Data Type (length)
Nulls Allowed
Language
---------------------------------------------------------------------------ALBUMCODE
Integer
NO
ALBUMTITLE
Char
( 40)
NO
NATIVE-3000
MEDIUM
Char
(
2)
NO
NATIVE-3000
ALBUMCOST
Decimal
(
7,
0) NO
RECORDINGCO
Char
( 10)
NO
NATIVE-3000
DATERECORDED
Char
( 16)
NO
NATIVE-3000
MFGCODE
Char
( 40)
NO
NATIVE-3000
COMMENT
Char
( 80)
NO
NATIVE-3000
c
b
Figure 6-3. Column Definitions of a Table
The Column Name column lists the names of all the columns in the
table.
The Data Type column shows the SQL data type for each column
and its size (in parentheses).
The third column, Nulls Allowed, indicates whether or not null values
are permitted in this column. IMAGE/SQL tables do not allow null
values, so this column will always contain NO.
The Language column indicates which language is applicable for the
column if it is a character type. This corresponds with the Language
value in the MUSIC root le.
Practicing with IMAGE/SQL Using MusicDBE
6-5
An authority structure consists of many elements. Some of these
elements are shown below:
Group denitions
Table authorization for select, insert, update, and delete operations
on tables
Column authorization for permission to update specic columns
Examining the Authority
Structure
Use the following query to examine each authorization group in
MusicDBE and their members:
isql=>SELECT * FROM SYSTEM.GROUP; 4Return5
d
The query result is shown below:
a
select * from system.group;
--------------------+--------------------+--------------------+----------USERID
|GROUPID
|OWNER
|NMEMBERS
--------------------+--------------------+--------------------+----------MUSIC_0
|MUSIC_0
|MGR@ACCOUNT
|
0
MUSIC_64
|MUSIC_64
|MGR@ACCOUNT
|
0
c
--------------------------------------------------------------------------Number of rows selected is 2
U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>, or e[nd] > e
Figure 6-4. Groups in the System Catalog
Figure 6-4 shows two UserID values, MUSIC 0 and MUSIC 64, that
correspond with TurboIMAGE/XL password levels of 0 and 64.
Level 0 is assigned to items and sets that do not have levels assigned
to them. Users accessing the database without a password are given
this level. Level 64 is the creator level. Notice that the OWNER for
both is MGR@ACCOUNT, the database creator.
Passwords in TurboIMAGE/XL are case-sensitive. Also, you need
to allow these users mode 1 access to TurboIMAGE/XL to permit
database updates.
6-6
Practicing with IMAGE/SQL Using MusicDBE
b
The information above is set up by the ATTACH command. There
are, however, three levels of security dened in the TurboIMAGE/XL
database: MGR, DIR, and ANNCR. To use these levels, you must
add additional users with the IMAGE/SQL utility as shown below:
:RUN IMAGESQL.PUB.SYS 4Return5
HP36385B X.F0.13
IMAGE/SQL Utility
(C) COPYRIGHT HEWLETT-PACKARD COMPANY 1993
SAT, JUN
5, 1993, 6:23 PM
>>SET TURBODB music 4Return5
>>SET SQLDBE musicdbe 4Return5
>>UPDATE USER MGR@ACCOUNT TO PASS = MGR, MODE=1 4Return5
Warning: command containing a password has been logged (ATCWARN 32069).
ALLBASE/SQL group MUSIC_10 created.
View MUSIC.ALBUMS_V10 created.
View MUSIC.COMPOSERS_V10 created.
View MUSIC.SELECTIONS_A_V10 created.
View MUSIC.SELECTIONS_V10 created.
View MUSIC.LOG_V10 created.
>>ADD USER DIR@ACCOUNT WITH PASS = DIR, MODE=1 4Return5
Warning: command containing a password has been logged (ATCWARN 32069).
ALLBASE/SQL group MUSIC_20 created.
View MUSIC.ALBUMS_V20 created.
View MUSIC.COMPOSERS_V20 created.
View MUSIC.SELECTIONS_A_V20 created.
View MUSIC.SELECTIONS_V20 created.
View MUSIC.LOG_V20 created.
>>ADD USER ANNCR@ACCOUNT WITH PASS = ANNCR, MODE=1 4Return5
Warning: command containing a password has been logged (ATCWARN 32069).
ALLBASE/SQL group MUSIC_30 created.
View MUSIC.ALBUMS_V30 created.
View MUSIC.COMPOSERS_V30 created.
View MUSIC.SELECTIONS_A_V30 created.
View MUSIC.SELECTIONS_V30 created.
View MUSIC.LOG_V30 created.
Practicing with IMAGE/SQL Using MusicDBE
6-7
You can view these changes and additions with the DISPLAY
USERS command:
>>DISPLAY USERS 4Return5
d
c
ATTACHED BASES
DBEnvironment
a
: MUSIC.PUB.ACCOUNT
: MUSICDBE.PUB.ACCOUNT
USER LOGON
----------
DBOPEN MODE USER PASSWORD
----------- -------------
USER CLASS
----------
MGR@ACCOUNT
DIR@ACCOUNT
ANNCR@ACCOUNT
1
1
1
10
20
30
MGR
DIR
ANNCR
b
Figure 6-5. Changes to Levels of Security
Re-invoke ISQL and enter the following command to look at the
UserID information:
isql=>SELECT * FROM system.group; 4Return5
d
a
select * from system.group;
--------------------+--------------------+--------------------+----------USERID
|GROUPID
|OWNER
|NMEMBERS
--------------------+--------------------+--------------------+----------MUSIC_0
|MUSIC_0
|MGR@ACCOUNT
|
0
MUSIC_64
|MUSIC_64
|MGR@ACCOUNT
|
0
MUSIC_10
|MUSIC_10
|MGR@ACCOUNT
|
0
MUSIC_20
|MUSIC_20
|MGR@ACCOUNT
|
1
DIR@ACCOUNT
|MUSIC_20
|MGR@ACCOUNT
|
0
MUSIC_30
|MUSIC_30
|MGR@ACCOUNT
|
1
ANNCR@ACCOUNT
|MUSIC_30
|MGR@ACCOUNT
|
0
c
--------------------------------------------------------------------------Number of rows selected is 7
Figure 6-6. UserID Information
New UserID values now exist for DIR and ANNCR. However, no
UserID exists for MGR because MGR is the OWNER of these
GroupIDs and UserIDs. Now that all these UserIDs are established,
you can access the database using any of these MPE user logins.
6-8
Practicing with IMAGE/SQL Using MusicDBE
b
The next step is to add data to the database. Because no
applications exist for this database, your choice for adding data is
with the interactive tools that come with the product. For standard
access to TurboIMAGE/XL, your tool is QUERY. For SQL access to
IMAGE/SQL, your tool is ISQL. You can add data using the SQL
INSERT statement or ISQL LOAD command.
Adding Data to the
Database
In Chapter 4, \A Database Example", the concept of referential
integrity was presented. That concept is further demonstrated here.
If you refer to the database design in Chapter 4, selection table
entries are dependent upon corresponding values in the Composers
and Albums tables. To maintain referential integrity, you will add
data in the following order:
1. Composers and Albums
2. Selections
You can use ISQL to CONNECT and then INSERT data into a
table. The following example adds rows to the COMPOSERS table
with the INSERT statement, then displays the table by reading all
the data with the SELECT statement:
Using the INSERT
Statement
:RUN ISQL.PUB.SYS
4Return5
isql=>CONNECT TO 'musicdbe'; 4Return5
isql=>INSERT INTO music.composers 4Return5
>values ('Schubert','1797','1828','Austria','Died at age 31');4Return5
Number of rows processed is 1
isql=>INSERT INTO music.composers 4Return5
>values ('Chopin','1810','1849','Poland','Died at age 39');4Return5
Number of rows processed is 1
isql=>COMMIT WORK; 4Return5
isql=>SELECT * FROM music.composers; 4Return5
d
a
select * from music.composers;
----------------+----------------+----------------+-----------------------COMPOSERNAME
|BIRTH
|DEATH
|BIRTHPLACE
----------------+----------------+----------------+-----------------------Schubert
|1797
|1828
|Austria
Chopin
|1810
|1849
|Poland
c
--------------------------------------------------------------------------Number of rows selected is 2
b
Figure 6-7. INSERT Command Display
Practicing with IMAGE/SQL Using MusicDBE
6-9
The COMMIT WORK statement is necessary because SQL
processes statements in units known as a transaction. When you
issue the rst SQL statement in a sequence, a transaction begins,
and that transaction continues until you do a COMMIT WORK
or ROLLBACK WORK. The use of transactions guarantees the
consistency of data within the DBEnvironment.
Using the LOAD
Command
In addition to the INSERT statement, you can use the LOAD
command to add data with ISQL. The LOAD command has two
options: EXTERNAL and INTERNAL.
The EXTERNAL Option
The EXTERNAL option of the LOAD command includes layout
information for the data items. The following example shows the
EXTERNAL option. The rst number after the column name is the
starting column position; the second number indicates the length of
the eld.
isql=>LOAD FROM EXTERNAL 4Return5
>albums.sampledb.sys TO music.albums 4Return5
>AlbumCode 1 4 4Return5
>AlbumTitle 13 40 4Return5
>Medium 53 2 4Return5
>AlbumCost 55 6 4Return5
>RecordingCo 61 10 4Return5
>DateRecorded 71 10 4Return5
>MfgCode 89 40 4Return5
>Comment 137 80 4Return5
>end; 4Return5
Load depending on value in input record (Y/N)> n 4Return5
Command in progress.
Number of rows read is 9
Number of rows processed is 9
COMMIT WORK to save to DBEnvironment.
isql=>COMMIT WORK; 4Return5
isql=>SELECT * FROM music.albums; 4Return5
6-10
Practicing with IMAGE/SQL Using MusicDBE
d
a
select * from music.albums;
-----------+----------------------------------------+------+------------+-ALBUMCODE |ALBUMTITLE
|MEDIUM|ALBUMCOST
|RE
-----------+----------------------------------------+------+------------+-2002|Famous Bel Canto Arias
|ca
|
22.00|dg
2003|Concertos for Diverse Instruments
|cd
|
19.00|rc
2004|Symphonies and Chamber Works III
|cd
|
29.00|rc
2005|Nielsen Symphonies 4 & 5
|ca
|
13.00|llo
2006|Lenontyne Price: a Christmas Offering |ca
|
13.00|lo
2007|Sergei Rachmaninov Symphony No. 2
|cd
|
19.00|me
2008|Franz Schubert: Lieder
|cd
|
14.00|at
2009|Beethoven Quartets No. 2 and No. 4
|cd
|
18.00|de
2010|Chopin Recital: Ivo Pogorelich
|cd
|
16.00|dg
--------------------------------------------------------------------------Number of rows selected is 9
c
b
Figure 6-8. Result of the EXTERNAL Option
The INTERNAL Option
The INTERNAL option of the LOAD command works with a
special type of le that is generated by the UNLOAD INTERNAL
command. Additional information is placed in the le describing the
le layout. This command is simple to use because of this additional
information. For example:
isql=>LOAD FROM INTERNAL 4Return5
>hits.sampledb.sys to music.selections; 4Return5
Command in progress.
Number of rows read is 18
Number of rows processed is 18
COMMIT WORK to save to DBEnvironment.
isql=>COMMIT WORK; 4Return5
isql=>SELECT * FROM music.selections; 4Return5
Practicing with IMAGE/SQL Using MusicDBE
6-11
d
c
a
select * from music.selections;
-----------+----------------------------------------+----------------+----ALBUMCODE |SELECTIONNAME
|COMPOSERNAME
|TIMIN
-----------+----------------------------------------+----------------+----2008|Der Saenger
|Schubert
|
2008|Fruehlingslied
|Schubert
|
2008|Fruehlingslaube
|Schubert
|
2008|Vor Meiner Wiege
|Schubert
|
2008|Drang in die Ferne
|Schubert
|
2008|Der Musensohn
|Schubert
|
2008|Viola
|Schubert
|
2008|Vergissmeinnicht
|Schubert
|
2010|Klaviersonate Nr. 2 - 1
|Chopin
|
2010|Klaviersonate Nr. 2 - 2
|Chopin
|
2010|Klaviersonate Nr. 2 - 3
|Chopin
|
2010|Klaviersonate Nr. 2 - 4
|Chopin
|
2010|Prelude cis-moll op 45
|Chopin
|
2010|Scherzo cis-moll op 39
|Chopin
|
2010|Nocture Es-dur op 55 No 2
|Chopin
|
2010|Etude F-dur op 10. No 8
|Chopin
|
2010|Etude As-dur op 10. No 10
|Chopin
|
2010|Etude gis-moll op 25. No 6
|Chopin
|
--------------------------------------------------------------------------Number of rows selected is 18
Figure 6-9. Result of the INTERNAL Option
You have now successfully inserted data into COMPOSERS,
ALBUMS, and SELECTIONS tables.
The result of the above SELECT shows selections for Albumcodes
2008 and 2010 corresponding with music by Schubert and Chopin,
as indicated by the ComposerName values. It was possible to add
these selections only because the Albums and Composers tables
already contain these values. This is referential integrity. Referential
integrity exists between these three tables based upon these column
values.
6-12
Practicing with IMAGE/SQL Using MusicDBE
b
You can now select and combine various columns of information
by joining tables based on common column values. For example,
suppose you wanted to see all album titles, selections, composer, and
the medium. This data is found in two tables, but can be joined by
albumcode, as follows:
Selecting Data
isql=>SELECT albumtitle, medium, selectionname, composername4Return5
>FROM music.albums, music.selection 4Return5
>WHERE music.albums.albumcode = music.selections.albumcode4Return5
>AND music.albums.albumcost > 15.00; 4Return5
d
This produces the following list:
a
select albumtitle, medium, selectionname, composername from music.albums
----------------------------------------+------+--------------------------ALBUMTITLE
|MEDIUM|SELECTIONNAME
----------------------------------------+------+--------------------------Chopin Recital: Ivo Pogorelich
|cd
|Klaviersonate Nr. 2 - 3
Chopin Recital: Ivo Pogorelich
|cd
|Klaviersonate Nr. 2 - 4
Chopin Recital: Ivo Pogorelich
|cd
|Prelude cis-moll op 45
Chopin Recital: Ivo Pogorelich
|cd
|Scherzo cis-moll op 39
Chopin Recital: Ivo Pogorelich
|cd
|Etude F-dur op 10. No 8
Chopin Recital: Ivo Pogorelich
|cd
|Nocture Es-dur op 55 No 2
Chopin Recital: Ivo Pogorelich
|cd
|Klaviersonate Nr. 2 - 2
Chopin Recital: Ivo Pogorelich
|cd
|Klaviersonate Nr. 2 - 1
Chopin Recital: Ivo Pogorelich
|cd
|Etude gis-moll op 25. No 6
Chopin Recital: Ivo Pogorelich
|cd
|Etude As-dur op 10. No 10
c
--------------------------------------------------------------------------Number of rows selected is 10
U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>, or e[nd] > e
Figure 6-10. JOINED List
AlbumTitle and Medium come from the Albums table,
SelectionName and ComposerName are from the Selections table.
The WHERE clause denes the join criteria: albumcode is matched
from each table. We have further qualied the query by asking only
for albums costing more than $15.00.
Practicing with IMAGE/SQL Using MusicDBE
6-13
b
The UPDATE command changes column values. A quick look at
some of our albums with the following query shows three albums not
on 'cd':
Modifying Data
isql=>SELECT * FROM music.albums WHERE medium <> 'cd';4Return5
d
a
select * from music.albums where medium 'cd';
-----------+----------------------------------------+------+------------+-ALBUMCODE |ALBUMTITLE
|MEDIUM|ALBUMCOST
|RE
-----------+----------------------------------------+------+------------+-2002|Famous Bel Canto Arias
|ca
|
22.00|dg
2005|Nielsen Symphonies 4 & 5
|ca
|
13.00|lo
2006|Lenontyne Price: a Christmas Offering |ca
|
13.00|lo
c
--------------------------------------------------------------------------Number of rows selected is 3
U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>, or e[nd] > e
Figure 6-11. Result of the Query
6-14
Practicing with IMAGE/SQL Using MusicDBE
b
To change the column values of these albums to 'lp' for 'Long Play'
records, use the following:
isql=>UPDATE music.albums SET medium = 'lp' WHERE medium = 'ca';4Return5
Number of rows processed is 3
isql=>COMMIT WORK; 4Return5
isql=>SELECT * FROM music.albums WHERE medium <>'cd';4Return5
d
a
select * from music.albums where medium <> 'cd';
ALBUMCODE |ALBUMTITLE
|MEDIUM|ALBUMCOST
|RE
-----------+----------------------------------------+------+------------+-2002|Famous Bel Canto Arias
|lp
|
22.00|dg
2005|Nielsen Symphonies 4 & 5
|lp
|
13.00|lo
2006|Lenontyne Price: a Christmas Offering |lp
|
13.00|lo
c
--------------------------------------------------------------------------Number of rows selected is 3
U[p], d[own], l[eft], r[ight], t[op], b[ottom], pr[int] <n>, or e[nd] > e
Figure 6-12. Result of Modifying Data
Practicing with IMAGE/SQL Using MusicDBE
6-15
b
Deleting Data
Like the UPDATE command, the DELETE command is also very
simple to use. The following command deletes entries with the
albumcode of 2002:
isql=>DELETE FROM music.albums WHERE albumcode = 2002; 4Return5
Conclusion
In this chapter, you learned to use these simple SQL statements in an
IMAGE/SQL environment:
INSERT
LOAD
SELECT
UPDATE
DELETE
The INSERT, SELECT, UPDATE, and DELETE statements
have many other options and oer a great deal of exibility in the
IMAGE/SQL environment. Refer to the ALLBASE/SQL Reference
Manual for more information on these statements.
Making TurboIMAGE/XL data work in a relational way is easy
to set up and simple to work with. This new SQL access opens
TurboIMAGE/XL to many, never before available, 4GL SQL tools.
These third-party tools, including many designed specically for the
client/server environment, can now be used with IMAGE/SQL. In
some cases, no knowledge of SQL is required, making these tools even
more easy to use.
6-16
Practicing with IMAGE/SQL Using MusicDBE
A
Tools For IMAGE/SQL
This appendix categorizes the available tools and lists some of the
tools IMAGE/SQL users can use.
Note
This appendix is for your convenience only; Hewlett-Packard does not
endorse any particular product or company.
The tools available to IMAGE/SQL users function primarily in a
client/server environment using Microsoft Windows. Most of the
tools use HP PC API for ALLBASE/SQL and IMAGE/SQL. The
tools fall into three categories, as summarized in Table A-1.
Table A-1. Categories of Tools
Category
Decision Support
Description
These tools support business decisions through
information analysis, reporting, and graphical
representation. These tools also oer data formatting
for importing to spreadsheet products. End-user
knowledge of SQL is not a prerequisite for using these
tools.
Executive Information These tools oer exception management capability,
where information is monitored within user-dened
System (EIS)
limits and exceptions are highlighted with color and
graphics. Other features include trend analysis and
information drill-down (digging out the detailed
elements of summarized information.) Some knowledge
of SQL is necessary.
Application
Development
These tools reside on either the PC or the server. They
provide the ability to create a windows-like interface
that allows programmers fast development of critical
end-user applications. Knowledge of SQL is necessary.
The next sections lists some of the available tools.
Tools For IMAGE/SQL
A-1
Tools
Impromptu by Cognos
NewWave Access by Hewlett-Packard
Q + E by Pioneer Software
Quest by Gupta
Executive
Forest & Trees by Trinzic
Decision Support
Information System
(EIS) Tools
Application
Development Tools
PowerBuilder by Powersoft
SQLWindows by Gupta
on the PC
Application
Development Tools
on the Server
A-2
Tools For IMAGE/SQL
ALLBASE Toolset by Hewlett-Packard
Focus by Information Builders
JAM by JYACC
Powerhouse by Cognos
Speedware by Speedware
Transact by Hewlett-Packard
Uniface by Uniface
Glossary
ATC
The acronym, ATC, stands for ALLBASE/Turbo CONNECT.
The terms Turbo CONNECT and ALLBASE/Turbo CONNECT
are synonymous with IMAGE/SQL. The acronym, ATC, appears
in error messages for IMAGE/SQL (for example, ATCERR or
ATCWARN).
ATCINFO
A permanent privileged le containing mapping information
about data types and user security. By default, it is named
DBEnvironment-name CR. If you want to set a le equation for
this le, you must do so before attaching any TurboIMAGE/XL
databases.
ATCLOG
A temporary unnumbered ASCII le. If IMAGE/SQL utility
logging is on (the default), all IMAGE/SQL utility commands
are written to this le. If it does not already exist, it is created.
If it exists, log records are appended to it. By default, it is name
ATCLOG. However, you can set a le equation to change the
name of this le.
ATCUtil
Another name for the IMAGE/SQL utility program.
Attributes
A characteristic of a data element considered during database
design. As you organize your data, you arrange it into categories
that possess similar attributes. The categories are known as
entities.
Authority
Permission to access specic objects for specic purposes within a
DBEnvironment.
Authorization Group
See Group.
Base Table
Table upon which a view is based.
Glossary-1
Check Constraint
An integrity constraint that enforces a condition that must not be
false for the columns of a table. Any value you attempt to insert
into a column that has a check constraint dened on it must
either satisfy the condition or be NULL.
Class
Special category of IMAGE/SQL owner that is neither a
particular DBEUserID nor a group. You do not explicitly create
a class; you create it implicitly by creating objects owned by it.
A class does not have members like a group. Objects owned by
classes can be dropped or modied only by a DBA. A class does
not have a password associated with it.
Column
Vertical division within a database table. Analogous to an item in
a TurboIMAGE/XL dataset.
Column Authorization
Permission to update a specic column within a table.
Column List
One or more columns specied as part of a query result.
Concurrency
The ability of multiple users to access the same database les
simultaneously. Concurrency is regulated by locking, which
controls the degree of concurrent access permitted|from
exclusive read or write access to shared read with concurrent
updates.
Constraint
A condition placed upon a column or table that requires values in
the column or table to meet certain conditions before a row can
be inserted or deleted. Two types supported by IMAGE/SQL are
unique constraints and referential constraints.
Data Analysis
Study of raw data before building a database. Concerns the kind
of data that is to be stored and how the data is to be used.
Database
A structured arrangement of data elements designed for the
easy selection of information. In IMAGE/SQL, a database is
a collection of tables and views having the same ownership in
a DBEnvironment. A DBEnvironment may contain several
databases.
Database Administrator (DBA)
The individual with DBA authority who creates and maintains
objects in a DBEnvironment. DBA authority permits the use of
certain restricted SQL and SQLUtil commands or options and
also confers co-ownership of all the objects in a DBEnvironment.
Glossary-2
Database Design
The creation of a specic arrangement of data in tables or data
sets with an appropriate security structure.
Data Control Language
The set of SQL statements that control access to data. This
includes the ADD, REMOVE, GRANT, and REVOKE
statements, as well as the statements to create, manage, and drop
authorization groups. Also known as DCL.
Data Manipulation
The process of accessing data within a database.
Data Manipulation Language
The set of SQL statements that access data. This includes the
actions of selecting data, inserting rows, updating columns, and
deleting rows. Also known as DML.
Data Type
A kind of data that can be stored in database tables. Valid
types are CHARACTER, VARCHAR, INTEGER, DECIMAL,
FLOAT, DATE, TIME, DATETIME, INTERVAL, BINARY, and
VARBINARY. LONG varieties of BINARY and VARBINARY are
also available. See Chapter 3 for a maping of these SQL data
types to TurboIMAGE data types.
DBA Authority
The most powerful authority within an IMAGE/SQL
DBEnvironment. Includes the authority to grant or revoke all
authorities for other users. DBA authority implies co-ownership
of all objects within the DBEnvironment. The creator of the
DBEnvironment is automatically a DBA.
DBC (Database Creator)
The creator of the TurboIMAGE/XL database. You must
be either the database creator or give the TurboIMAGE/XL
database maintenance word to attach a database to a
DBEnvironment. Commands that add users, or display or modify
user information can only be executed by the DBC.
DBECon File
DBEnvironment Conguration File. This contains startup
parameters for the DBEnvironment. The contents of this le
are initially determined at the time you issue the START DBE
NEW statement. You can modify some of these parameters using
SQLUtil, and you can override some of them with the START
DBE statement.
DBECreator
The individual who issues the START DBE NEW statement. See
DBC.
Glossary-3
DBEFileSets
Logical grouping of DBEFiles.
DBEnvironment
A collection of les containing one or more databases. Files
include the DBECon le, which holds startup parameters and log
le names; DBEFile0, which contains the system catalog; and log
les. A DBenvironment may also contain additional DBEFiles for
table and index data. The DBEnvironment is the maximum scope
of a transaction within IMAGE/SQL.
DBEFiles
Operating system les that hold DBEnvironment data. DBEFiles
have both physical names (operating system names) and
logical names by which the les are known internally to the
IMAGE/SQL system catalog.
DBEUserID
A login name and account name joined with the character '@'.
One type of owner of database objects.
Embedded SQL Programming
An application program incorporating SQL statements for
programmatic access to IMAGE/SQL databases.
Entities
Basic subdivision of data elements in database design. Each
entity is a thing or event about which information is kept in the
database. For each entity, there is at least one attribute that
uniquely identies a data element as belonging to the entity.
Explicit Locking
Locking of tables in transactions by the use of the LOCK TABLE
statement.
Expression
Species a value. The most common sources of values are
columns in a table or host variables in an application program.
Expressions are used to identify columns or rows or to dene new
values for columns.
Group
Authorization group. Membership in a group is used to confer
common ownership or common authorization for other objects
in the DBE. You create a group explicitly using the CREATE
GROUP statement, then you add users to it. You can then grant
authorizations to the group or revoke authorizations from the
group. You can also use the group name for the ownership of
database objects.
Glossary-4
Logging
The use of log les to record operations that modify database
les.
IMAGE/SQL Database
A TurboIMAGE/XL database attached to an SQL
DBEnvironment.
Implicit Locking
Locking of tables in transactions according to table type and
isolation level. For example, PRIVATE tables are locked
exclusively for all access; PUBLIC tables are locked exclusively
only for write operations.
Integrity Constraint
A constraint placed on the columns of a table to ensure that a
database contains only valid data. Two types are the referential
constraint and the unique constraint .
Isolation Level
The degree of separation enforced between the transactions
of dierent users. There are four levels: Repeatable Read
(RR), Cursor Stability (CS), Read Committed (RC), and Read
Uncommitted (RU). You specify an isolation level in the BEGIN
WORK statement.
ISQL
The interactive interface to Hewlett-Packard's relational database
products. ISQL is the tool you use for queries as well as for
loading and unloading data and other database administration
tasks.
Joining
A query that accesses data from two or more relational tables at a
time. A join column is a column that occurs in both tables of a
join (often it is a key column) and contains similar values in both
tables.
Key
One or more columns on which an index, hash structure, or
integrity constraint are based.
Locking
A technique for concurrency control through which
Hewlett-Packard's relational databases restrict access to data by
one individual when the data is being used by another. Locks are
of three types: shared, exclusive, or shared with intent to become
exclusive. Lock type is determined by the type of table being
accessed and by the kind of operation the user is performing.
Locks are released when a transaction ends with a COMMIT
WORK statement.
See also Explicit Locking and Implicit Locking.
Glossary-5
Logging
The use of log les to record operations that modify database
les. Logging is of two kinds: nonarchive logging , and archive
logging . Both kinds permit you to roll back incomplete
transactions following a system failure. This maintains data
integrity by backing out changes to the database that were not
committed. Only archive logging allows you to roll forward
from an earlier version of a DBEnvironment by reapplying all
committed transactions up to a specic recovery time.
Object
A structure created and stored in a DBEnvironment. The most
common objects are tables, views, and groups.
Owner
A DBEUserID, a group name, or a class name. Ownership
applies to database objects such as tables, views, indexes, and
authorization groups. The owner may drop the object or transfer
it to some other owner.
Predicate
Part of query syntax that species a subset of rows to be returned
in the query result. Predicates are introduced by the keyword
WHERE, so they are sometimes called WHERE clauses.
Predicates let you specify a range of values. The comparison
predicate lets you compare a column value with a constant or
host variable ; the LIKE predicate lets you compare a column
value with a portion of a character string; the BETWEEN
predicate species a range of values for a comparison. Special
predicates of various kinds let you search for rows in more
complex ways, including the use of subqueries.
Preprocessor
Converts programs with embedded SQL statements into modied
source les for input to a compiler in one of several programming
languages: C, COBOL, FORTRAN, and Pascal.
Primary Key
A column in a table dened so as to permit reference by foreign
keys in other tables. A primary key also enforces uniqueness
within the column.
Procedure
A sequence of SQL statements that are stored in a
DBEnvironment and applied as a group either through rules
or through execution by specic users. Together with rules,
procedures let you dene generalized constraints within a
database to implement the relationships in the database design.
Glossary-6
Projection
Relational operation that extracts a subset of columns from one
or more tables.
Query
Request for information from database tables. A typical example
is a SELECT statement.
Query Language
A set of operators, expressions, and commands that let you
manipulate a database. The query language of IMAGE/SQL and
ALLBASE/SQL is SQL.
Query Result
The rows retrieved by a SELECT statement. Query results are
also known as result tables.
Read Committed (RC)
An isolation level that guarantees only that data you read in a
transaction has been committed by some earlier transaction;
that is, it is not currently in the process of update by some other
transaction at the time you are reading it. In practical terms, this
means that another transaction can update or delete the same
row before your transaction is over. However, concurrency is
greatly improved.
Read Uncommitted (RU)
An isolation level that enforces no separation between your
transaction and those of others because no locks are obtained for
reads. This level permits dirty reads; that is, reading data from
the data buers that has not and may never be written to the
database at all.
Referential Integrity
An integrity constraint that enforces a relationship between the
rows of two tables (a referenced table and a referencing table).
Any value you attempt to insert into a table having a referential
constraint (a referencing table) must either be NULL or be the
same as a value in the referenced table.
Relation
See Table.
Relational Operations
Ways of extracting data from relational tables. The three primary
relational operations are selection, projection, and joining.
Relationship
The meaningful interaction of entities in database design.
Relationships may be one-to-one, one-to-many, or many-to-many.
Glossary-7
Repeatable Read (RR)
An isolation level that enforces the highest level of separation
between the transactions of dierent users. This level guarantees
that when you re-read any data you have read previously in the
same transaction, the value seen in the second read will be the
same as the value seen in the rst read. In practical terms, this
means that other users may not update any data you have read at
this isolation level until you COMMIT WORK.
Result Table
See Query Result.
Row
Horizontal division within a database table. Analogous to a
record in a le.
Rule
A database object that ties the execution of a procedure to
specic kinds of data manipulation performed on a database
table. Together with procedures, rules let you dene generalized
constraints within a database to implement the relationships in
the database design.
Schema
A complete SQL database denition.
Also, an ISQL command le containing commands to create a
DBEnvironment and the objects within it.
Also, a TurboIMAGE/XL database denition that is the input to
the TurboIMAGE/XL DBSCHEMA program.
Selection
Relational operation that extracts a subset of rows from one or
more tables.
Serial Scan
A method of reading sequentially from the start of a table until
the row is found. Also called table or relation scan. This is the
default scan method used to access rows in a table when indexes
do not exist.
SQL
See Structured Query Language.
SQLGEN
A utility program for database administrators that generates
the SQL commands necessary to re-create all or part of a
DBEnvironment. The output from SQLGEN is a command le
(sometimes called a schema) that can be used as input to ISQL in
re-creating database objects.
Glossary-8
SQLUtil
A utility program for database administrators that assists
with DBEnvironment maintenance, backup, and recovery.
SQLUtil also lets you modify the startup parameters for a
DBEnvironment.
Structured Query Language
A standard query language syntax dened by ANSI standards
in the United States and X/OPEN standards in Europe. The
relational database query language used by IMAGE/SQL and
ALLBASE/SQL.
Subquery
A query within another query. An example is a subquery
embedded in the predicate of another query. The result of the
inner query is used to evaluate the outer query.
SYSTEM
A DBEFileSet created when you issue the START DBE NEW
statement. The DBEFile known as DBEFile0 is associated
with SYSTEM, which is the DBEFileSet containing the system
catalog. You can add DBEFiles to SYSTEM as you would to any
other DBEFileSet.
Also, a special user associated with the system views in the
system catalog.
System Catalog
A system-maintained database of tables and views owned by the
special user SYSTEM and containing information about all the
objects in the DBEnvironment. Diers from the DBECon le,
which contains startup parameters, not object denitions.
System Table
See System View.
System View
A component view within the system catalog. You can issue
queries on the views in the system catalog just as you would
on ordinary database tables to display information about the
DBEnvironment.
Table
Basic unit of data storage in a relational database. Also known as
a relation. Tables consist of rows and columns. A result table is a
query result displayed in tabular form.
Table Authority
Permission to use specic SQL statements on particular tables.
There are several kinds of TABLE authority: SELECT, INSERT,
DELETE, and UPDATE. SELECT, INSERT, and DELETE let
you operate on rows or sets of rows in a table; UPDATE lets you
modify specic rows or columns in a table.
Glossary-9
Transaction
A unit of work. Also, a unit of DBEnvironment logging and
recovery. A transaction is started with a BEGIN WORK
statement and is ended by a COMMIT WORK statement.
The BEGIN WORK statement may be implicitly issued by
IMAGE/SQL if no other transaction is current when an SQL
statement is executed.
Unique Constraint
An integrity constraint that requires that no two rows in a table
have the same values in a specied column or columns.
View
A table derived by placing a \window" over one or more tables.
The derivation of a view is a SELECT statement. View names
are governed by the same rules as table names.
Glossary-10
Index
A
access
interactive, 3-9
programmatic, 3-9
to a database, 2-10
accounts
attaching from dierent, 5-5
adding data to the sample database, 6-9
ALLBASE/NET
component of IMAGE/SQL, 1-3
ALLBASE/SQL
DBA authority, when to grant, 5-5
DBEFILE0, size considerations, 5-5
DBELOG1, size considerations, 5-5
DBEnvironment, setting a maintenance word, 5-8
dened, 1-3
ATC
dened, Glossary-1
ATCINFO le, 5-19
maintaining, 5-27
reference information for, 5-20
setting a le equation for, 5-19
when purged, 5-14
ATCLOG le, 5-19
reference information for, 5-20
setting a le equation for, 5-19
attaching a TurboIMAGE/XL database
example of, 5-11
getting ready, 5-9
three commands required for, 5-10
when DBEnvironment is in dierent account, 5-9
with same name as one already attached, 5-9
attributes, 4-2
dened, Glossary-1
authority, 2-9, 3-8
dened, Glossary-1
in IMAGE/SQL, 2-11
in the sample DBEnvironment, 6-6
authorization group
dened, Glossary-1
in the sample DBEnvironment MusicDBE, 6-6
automatic master set, 3-7
Index-1
B
C
D
Index-2
base table
dened, Glossary-1
basic mapping, 3-7
batch
using IMAGE/SQL utility command les in, 5-25
benets of IMAGE/SQL, 1-5
CHAR data types, 3-7
check constraint
dened, Glossary-2
class
dened, Glossary-2
column
corresponding TurboIMAGE/XL term, 3-2
dened, Glossary-2
in a relational database table, 2-2
column authorization
dened, Glossary-2
described, 6-6
column list
dened, Glossary-2
command les, 5-24
COMMIT WORK
example, 6-9, 6-10, 6-11
why necessary, 6-10
compound items, 3-7
concurrency
dened, Glossary-2
when accessing, 3-9
conguring a DBEnvironment
DBE le size considerations, 5-5
example of, 5-6
getting ready, 5-5
when TurboIMAGE/XL database is in dierent account, 5-5
CONNECT, 6-4
constraint
dened, Glossary-2
creating
a database, 2-9, 3-5
DBEnvironment, 5-4
data
adding to a database, 6-9
deleting, 6-16
modifying, 6-14
data analysis
basic explanation, 2-4
dened, Glossary-2
database
accessing, 2-10
access in IMAGE/SQL and TurboIMAGE/XL, 3-9
adding data, 6-9
administrator, 3-8
administrator (DBA), dened, Glossary-2
administrator (DBA), explained, 1-4
controlling access, 2-11
creating, 2-9, 3-5
creating a TurboIMAGE/XL, 4-12
creator, 3-8
dened, Glossary-2
design, basic explanation, 2-4
design, dened, Glossary-3
example, 4-1
explained, 2-1, 2-7
in IMAGE/SQL and TurboIMAGE/XL, 3-5
setting up with ISQL, 5-3
data control language
dened, Glossary-3
explained, 2-11
data entities, 4-3
data item
corresponding IMAGE/SQL term, 3-2
data manipulation
dened, Glossary-3
example, 2-10
data manipulation language
dened, Glossary-3
data set
corresponding IMAGE/SQL term, 3-2
dening, 4-6
dierences from IMAGE/SQL table, 3-7
data type
dened, Glossary-3
mapping, 3-7
DB01 le
corresponding IMAGE/SQL term, 3-2
DB02 le
corresponding IMAGE/SQL term, 3-2
DB03 le
corresponding IMAGE/SQL term, 3-2
DBA authority, 3-8
dened, Glossary-3
explained, 2-11
DBaseName TC le
when purged, 5-14
DBC
database creator, Glossary-3
DBC authority, 3-8
DBECon le
corresponding TurboIMAGE/XL term, 3-2
dened, Glossary-3
dierences from TurboIMAGE/XL root le, 3-6
explained, 2-7
name and content, 5-7
DBECreator
dened, Glossary-3
explained, 2-11
DBEFile
corresponding TurboIMAGE/XL term, 3-2
Index-3
explained, 2-7
DBEFile0
DBEFile containing system catalog, 2-8
name and content, 5-7
DBEFileset
explained, 6-4
DBEFileSets
dened, Glossary-4
explained, 2-7
DBEnvironment
basic explanation, 2-9
corresponding TurboIMAGE/XL term, 3-2
creating, 2-9, 5-4
default les in, 5-7
dened, Glossary-4
dierences from TurboIMAGE/XL, 3-5
explained, 2-6
starting, 2-9
DBEnvironment-name CR, 5-20
DBEUserID
corresponding TurboIMAGE/XL term, 3-2
dened, Glossary-4
DBLOCK intrinsic, 3-10
DBSCHEMA, 3-5, 3-6, 4-11
DBUTIL, 3-5, 4-12, 6-3
DECIMAL data types, 3-7
default values, 3-7
DELETE, 2-10, 6-16
deleting
data, 6-16
detaching a TurboIMAGE/XL database
example of, 5-13
getting ready, 5-13
reasons for, 5-14
reference information for, 5-14
detail data sets, 4-6
detail set, 3-7
DISPLAY commands
two options, 5-15
displaying IMAGE/SQL utility information
displaying DBEnvironment information, 5-17
displaying TurboIMAGE/XL database information, 5-15
displaying TurboIMAGE/XL database mapping, 5-16
displaying user information, 5-17
getting ready, 5-15
DISPLAY MAP, 5-15
DISPLAY OPTIONS, 5-15
DISPLAY SQLDBE, 5-15
DISPLAY TURBODB, 5-15
DISPLAY USER, 5-15
Index-4
E
F
G
H
embedded SQL programming, 3-9
dened, Glossary-4
entities, 4-3
dened, Glossary-4
entry
corresponding IMAGE/SQL term, 3-2
environment, 4-1
explicit locking
dened, Glossary-4
expression
dened, Glossary-4
le equations
examples of setting, 5-19
reference information for, 5-20
setting for ATCINFO, 5-19
setting for ATCLOG, 5-19
les
DBECon le, 5-7
DBEFile0, 5-7
default in a DBEnvironment, 5-7
log le, 5-7
FLOAT data types, 3-7
getting ready for
detaching a TurboIMAGE/XL database, 5-13
displaying IMAGE/SQL utility information, 5-15
maintaining the ATCINFO le, 5-27
selecting TurboIMAGE/XL data with ALLBASE/SQL, 5-26
using IMAGE/SQL utility command les, 5-24
getting started with IMAGE/SQL
conguring a DBEnvironment, 5-5
GRANT
authorities, 3-8
statement, 2-11
group
dened, Glossary-4
dening, 3-8
in the sample DBEnvironment MusicDBE, 6-6
HELP, 5-15
HP PC API
component of IMAGE/SQL, 1-3
for ALLBASE/SQL and IMAGE/SQL, 1-3
Index-5
I
Index-6
IMAGE/SQL
and ALLBASE/SQL, 1-5
basic concepts, 2-1
basic structure, 3-4
benets, 1-5
command, 5-24
compared with TurboIMAGE/XL, 3-1
components, 1-3
dening groups, 3-8
dening views, 3-8
environment, 4-1
introduction, 1-1
locking, 3-10
permissions, 2-11
sample DBEnvironment, 6-1
tasks, 5-1
tools, A-1
IMAGE/SQL utility
component of IMAGE/SQL, 1-3
displaying information about, 5-15
example of using in batch mode, 5-25
example of using interactively, 5-24
issuing commands, 5-2
logging commands, 5-21
prerequisites for issuing, 5-2
setting up a database, 5-3
implicit locking
dened, Glossary-5
INFO, 6-5
INSERT, 2-10, 6-9
INTEGER data types, 3-7
integrity constraint
dened, Glossary-5
interactive access to data
in IMAGE/SQL and TurboIMAGE/XL, 3-9
isolation level
dened, Glossary-5
ISQL
accessing TurboIMAGE/XL data, 5-26
component of IMAGE/SQL, 1-3
dened, Glossary-5
how to run, 5-3
setting up a database, 5-3
item part of TurboIMAGE/XL database, 4-9
J
joining
dened, Glossary-5
K
key
dened, Glossary-5
L
M
N
LOAD
description, 6-10
EXTERNAL option, 6-10
INTERNAL option, 6-11
locking
dened, Glossary-5
mechanisms in IMAGE/SQL and TurboIMAGE/XL, 3-10
log le
dened, 2-8
name and content, 5-7
logging
dened, Glossary-5, Glossary-6
explained, 2-8
logging IMAGE/SQL utility commands
example of, 5-21
reference information for, 5-23
logical data entities, 4-3
maintaining the ATCINFO le
example of, 5-27
getting ready, 5-27
reference information for, 5-27
maintenance word
setting a DBEnvironment, 5-8
when needed, 5-5
manual master set, 3-7
mapping of data types, 3-7
master data sets, 4-6
master set, 3-7
modifying data, 6-14
MPE/iX
commands issued from the IMAGE/SQL utility, 5-18
security rules enforced, 5-5
names
dierences between TurboIMAGE/XL and IMAGE/SQL, 3-6
naming conventions, 3-6
NOT NULL, 5-11
null values, 5-11, 6-5
Index-7
O
P
Q
R
Index-8
object
dened, Glossary-6
in an IMAGE/SQL DBEnvironment, 2-6
owner
dened, Glossary-6
password
corresponding IMAGE/SQL term, 3-2
part of TurboIMAGE/XL database, 4-9
PC API
component of IMAGE/SQL, 1-3
permissions in IMAGE/SQL
explained, 2-11
predicate
dened, Glossary-6
preprocessor
component of IMAGE/SQL, 1-4
dened, Glossary-6
prerequisites for issuing IMAGE/SQL utility commands, 5-2
primary key
dened, Glossary-6
PRIV les, 6-3
procedure
dened, Glossary-6
programmatic access to data
in IMAGE/SQL and TurboIMAGE/XL, 3-9
projection
dened, Glossary-7
query
dened, Glossary-7
explained, 2-2
relational operations in, 2-2
result, dened, Glossary-7
Query/3000, 3-9
query language
dened, Glossary-7
explained, 2-5
read committed (RC)
dened, Glossary-7
read uncommitted (RU)
dened, Glossary-7
record
corresponding IMAGE/SQL term, 3-2
reference information
ATCINFO, 5-20
ATCLOG, 5-20
referential integrity
dened, 4-5, Glossary-7
example of, 6-12
maintaining, 6-9
relational database
explained, 2-2
relational operations
dened, Glossary-7
joining, 2-2
projection, 2-2
selection, 2-2
relationship
dened, Glossary-7
relation (table)
dened, Glossary-7
in a relational database, 2-2
repeatable read (RR)
dened, Glossary-8
resetting ATCLOG le equations from within IMAGE/SQL utility, 5-19
result table
dened, Glossary-8
REVOKE authorities, 3-8
ROLLBACK WORK, 6-10
root le, 4-11
corresponding IMAGE/SQL term, 3-2
dierences from IMAGE/SQL DBECon le, 3-6
row
corresponding TurboIMAGE/XL term, 3-2
dened, Glossary-8
in a relational database table, 2-2
rule
dened, Glossary-8
S
schema
dened, Glossary-8
in IMAGE/SQL and TurboIMAGE/XL, 3-5
script for sample database, 6-2
security, 2-11
in IMAGE/SQL and TurboIMAGE/XL, 3-8
scheme, 4-8
SELECT, 2-2, 6-4, 6-13
selecting data, 6-13
selecting TurboIMAGE/XL data with ALLBASE/SQL
example of, 5-26
getting ready, 5-26
reference information for, 5-26
selection
dened, Glossary-8
serial scan
dened, Glossary-8
SET commands
used before displaying IMAGE/SQL utility information, 5-15
set part of TurboIMAGE/XL database, 4-9
setting IMAGE/SQL utility le equations
examples of, 5-19
for ATCINFO, 5-19
for ATCLOG, 5-19
reference information for, 5-20
setting up a database with ISQL, 5-3
Index-9
SMALLINT data types, 3-7
SQL
CONNECT, 2-10
dened, Glossary-8
explained, 2-5
SQLGEN
component of IMAGE/SQL, 1-4
dened, Glossary-8
SQLUtil, 6-3
component of IMAGE/SQL, 1-4
dened, Glossary-9
using to set DBEnvironment maintenance word, 5-8
standards
ANSI and X/OPEN, 2-5
START DBE, 2-9
structured query language
dened, Glossary-9
explained, 2-5
types of statements, 2-5
subquery
dened, Glossary-9
SYSTEM
DBEFileSet containing system catalog, 2-8
dened, Glossary-9
system catalog
corresponding TurboIMAGE/XL term, 3-2
dened, Glossary-9
dierences from TurboIMAGE/XL root le, 3-6
explained, 2-8
system table
dened, Glossary-9
system view
dened, Glossary-9
T
Index-10
table
as database object, 2-8
corresponding TurboIMAGE/XL term, 3-2
dened, Glossary-9
dierences from TurboIMAGE/XL data set, 3-7
in a relational database, 2-2
rows and columns in, 2-2
sample in a relational database, 2-3
using several, 2-4
table authority
dened, Glossary-9
task reference information
conguring a DBEnvironment, 5-7
detaching a TurboIMAGE/XL database, 5-14
logging IMAGE/SQL utility commands, 5-23
maintaining the ATCINFO le, 5-27
selecting TurboIMAGE/XL data with ALLBASE/SQL, 5-26
setting IMAGE/SQL utility le equations, 5-20
using IMAGE/SQL utility command les in batch, 5-25
using IMAGE/SQL utility command les interactively, 5-24
tasks
accessing TurboIMAGE/XL data with ISQL, 5-26
adding data to the sample database, 6-9
attaching a TurboIMAGE/XL database, 5-9
committing work, 6-9
conguring a DBEnvironment, 5-5
creating a DBEnvironment, 5-4
deleting data, 6-16
detaching a TurboIMAGE/XL database, 5-13
displaying IMAGE/SQL utility information, 5-15
displaying TurboIMAGE/XL database information, 5-15
examining authority structure, 6-6
examining table description, 6-5
examining the database, 6-4
issuing MPE/iX commands from IMAGE/SQL utility, 5-18
logging IMAGE/SQL utility commands, 5-21
maintaining the ATCINFO le, 5-27
modifying data, 6-14
rolling back work, 6-10, 6-11
running ISQL, 5-3
selecting data, 6-13
selecting TurboIMAGE/XL data with ALLBASE/SQL, 5-26
setting IMAGE/SQL le equations for ATCINFO, 5-19
setting IMAGE/SQL le equations for ATCLOG, 5-19
setting up a database, 5-3
setting up the sample MUSIC database, 6-2
setting up the sample MusicDBE DBEnvironment, 6-2
using IMAGE/SQL utility command les, 5-24
using the sample DBEnvironment, 6-1
third-party tools, A-1
tools for IMAGE/SQL, A-1
transaction
dened, Glossary-10
ended with COMMIT WORK, 6-10
TurboIMAGE/XL
basic structure, 3-3
compared with IMAGE/SQL, 3-1
creating a database, 4-12
dened, 1-3
dening a database, 4-9
detaching a database, 5-14
explained, 2-5
security, 3-8
transition to IMAGE/SQL, 3-1
U
unique constraint
dened, Glossary-10
UPDATE, 2-10, 6-14
using IMAGE/SQL utility command les
getting ready, 5-24
reference information for, 5-25
Index-11
V
Index-12
view
dened, Glossary-10
dening, 3-8
">
/
İndir
Sadece dostça bir hatırlatma. Belgeyi buradan görüntüleyebilirsiniz. Ancak en önemlisi, yapay zekamız zaten okudu. Karmaşık şeyleri basit terimlerle açıklayabilir, sorularınızı herhangi bir dilde yanıtlayabilir ve en uzun veya en karmaşık belgelerde bile hızlıca gezinmenize yardımcı olabilir.
Reklam