Beruflich Dokumente
Kultur Dokumente
3
DataBase Query Language Guide
This
menu
tree
shows
QBE-Quick
Reports,
Form
Definition
Relationships,
Definition,
Form
Definition
Menu
1.
Define a Form
2.
3.
Define Relationships
4.
Delete a Form
5.
Reorganize a Form
and
Menu
and System
Volume
2.
Volume
3.
Records Menu
Please select a form.
Enter a number from
2:
NONE
SYSTEM
STORES
3:
CALL LIST
0;
1:
4:
5:
1.
Form
Definition
to
PRODUCTS
EMPLOYEES
and
Relationships
3.
Record Entry
QBE-Quick Reports
4.
DQL Advanced
5.
Menu
6.
Database Maintenance
System Administration
2.
7.
Processing
Definition
The
DataEase Menu
Definition
Form
Displays
Maintenance Menu
3.
Database Status
Backup Database
Restore Database
4.
DOS
5.
Lock Database
6.
Unlock Database
2.
Functions
To
register,
simply
fill
is
limited to
is
to
6PM
Monday
EST. Please
have your DataEase serial number ready when you call. This number
located on your system diskette and on the DataEase Sign On screen.
is
IBM
is
Machines
Corporation.
in the
(printed in
DataEase documentation:
III
PLUS.
MicroPro
International:
WordStar
No
DataBase
g^^-mx^v'^.^-^.^'j^^^
?-^'
-.'.
s^^^
j-s-jj,
'
:.
,v.:--'.i^y^x<mre -
REFERENCE MANUAL
Volume 3
DataBase Query Language
Guide
=^
DataBase
>^^F
INTERNATIONAL
mi
U A
A E A
N C E
MANUAL
Table of Contents
1
Introduction to
INTERACTIVE
EDIT
MODE
1-1
MODE
1-2
WHAT'S A QUERY?
SAMPLE QUERY AND REPORT OUTPUT
DQL PROCEDURES
Types of Procedures
RUN PROCEDURE
START NEW PROCEDURE
DEFINE DATA-ENTRY FORM
How
to
a Data-entry
1-5
1-6
Running Procedures
Is
1-4
1-5
First
TYPOGRAPHICAL CONVENTIONS
What
1-3
1-3
1-2
1-3
Conditional Processing
What To Read
1-2
Form?
2-3
2-5
2-6
2-7
2-7
2-8
2-9
2-10
2-12
DEFINE QUERY
The DataEase Query Language
Interactive
Mode
Edit
Low
2-14
2-15
Changing Modes
High Level and
2-13
2-14
2-15
Level
Mode
Modify Query
2-18
2-19
2-20
2-21
LOAD PROCEDURE
DELETE PROCEDURE
PRINT PROCEDURE DEFINITION
2-24
2-22
2-26
2-27
Volume
TABLE OF CONTENTS
3
Define Query:
A Low
Level Example
Define Query:
A High
Level
3-2
3-2
3-3
Example
PROCEDURE
Query
4-1
4-3
4-3
PROCEDURE
Query
2:
CALCULATE DISCOUNT
for Mail
4-3
4-7
4-8
4-9
4-9
4-17
4-18
4-19
4-21
4-21
4-22
Summary
4-24
(Putting
It
All Together)
DEFINE FORMAT
5-3
5-5
Columnar Format
5-8
5-8
5-14
5-16
Template Format
5-17
5-20
5-25
Export Formats
5-27
CUSTOM FORMAT
Formatting
5-40
Commands
Commands
Required Formatting
The
.call
Volume
Command
Commands
5-42
5-44
5-49
5-53
5-56
ii
5-58
Keys
5-58
5-60
Saving a Format
5-64
Printer Control
Commands
5-65
5-70
5-70
5-71
5-75
Saving/Modifying
5-79
Examples
5-80
DQL Lexicon
INTRODUCTION
DQL LEXICON TYPOGRAPHICAL CONVENTIONS
6-2
Syntax Diagrams
6-2
Margin Notes
6-2
Typesize
Database Forms Used
iii
6-1
6-2
in the
Examples
6-2
Punctuation Symbols
6-3
Math Symbols
6-3
Wildcard Symbols
6-3
Comparison Symbols
6-3
Volume
TABLE OF CONTENTS
List of Figures
Introduction to
Figure
1-1
- Query
Order and
1-2
Running Procedures
Figure 2-1
2-1
Figure
2-7
Figure
Figure
Define Query:
2-15
2-28
Figure 3-1
3-1
Figure 3-2
3-2
Figure
Figure
Define Query:
Figure 4-1
Figure 4-2
Figure 4-3
4-2
4-13
4-17
Figure 5-1
Figure 5-2
Figure 5-3
Custom Format
Figure 5-4
Figure 5-5
Figure 5-6
Figure 5-7
Figure 5-8
3-8
3-13
Basic Format
5-2
5-7
5-40
5-43
5-49
5-60
5-61
5-70
DQL Lexicon
Figure 6-1
Figure 6-2
Figure 6-3
Figure 6-4
Volume
6-148
6-160
6-164
6-185
iv
Chapter
Introduction to
DQL Advanced
Processing
(DQL) extends
the data
lets
In
you:
Use
the
and retrieve
Chapter 3
to
gain a basic
new user, we
recommend thai you first
read this Introduction and
If you're a
in related
forms.
into a single
among
form
to another,
INTERACTIVE
to pass values
new
procedures.
DQL
in
multiple forms.
MODE
Mode, DataEase
prompts you at each step, lists all valid responses, and prevents
you from making syntax errors or spelling mistakes. Because all
and an
1-1
minimum
of training.
Volume
EDIT
As you
the rapid
power
command-driven
In Edit
users.
alternative
Mode you
DQL
enter
statements directly,
WHAT'S A QUERY?
A
query
is
Ask
Add,
in
DataBase how to
query can:
modify data
DataBase how
query
is
tell
a database.
the group of
to process data.
its
report output.
Query
for
A query can
ask a question,
add. delete, or modify data,
and/or call other procedures
and external programs. The
printed output generated hy a
query is called a report.
STATE REPORT
Report Output
STATES;
Alabama
records
STATE NAME
list
In
Order
end
Alaska
Arizona
Arkansas
California
Colorado
Connecticut
Delaware
Florida
Georgia
Wyoming
Figure 1-1
Query
Order
Volume
1-2
Query - this
Format -
tells
this tells
DataEase how
is
Data-entry
needed
tells
DataEase where
to send
to process.
information to be used
in
procedure.
Types
of
Procedures
Processing procedure
list,
is
A Control
number of other
procedures together (like the macros used in many of today's
programs). This makes it possible to automate the whole series of
transactions that occur in accounting, billing, inventory control,
order-processing, and retail point-of-sale systems where data
is
Conditional Processing
DQL
1-3
(e.g., if
today
is
the database).
Volume
INTRODUCTION
TO DQL
ADVANCED PROCESSING
Commands enter,
to create a
delete, modify,
and
DQL Procedure
list
is
Operators
refine
commands; they
DataBase how to
by the query's
process records, what
formatting commands,
symbols, and values.
tell
commands
Trigonometric.
Keywords signal
temporary and
performing conditional actions, or retrieving values from a
Data-entry form.
Symbols
clarify, divide,
specified in a query.
volume.
Volume
1-4
3
is
Chapter
2.
is
organized
in five
Running Procedures
how
this Introduction,
sections as follows:
to create or
modify a
DQL
Chapter
Define Query:
3.
A Low
Level Interactive
Mode
that
Level Example
how
to create a
a simple,
is
query
in
Low
related forms.
5.
that
to control the
Chapter
6.
The
DQL
Lexicon
is
a dictionary-style reference
What To Read
you're a
new
feature of the
alphabetical
first.
First
we recommend
If
user,
that
that the
DQL
vocabulary
in the
in
process
^^"'
"'"'''''
''"'"''^
'"'''''"
"'"''
DatuEase Tutoncl.
DQL
1-5
Volumes
INTRODUCTION
TO DQL
ADVANCED PROCESSING
TYPOGRAPHICAL CONVENTIONS
In
the Text
The
narrative text
printed in
Roman
UPPERCASE
is
printed in
type).
type
Roman
is
in
of
DQL terms
BALANCE).
customers" names).
in
Helvetica type as
shown
below:
Report Output
Query
for
STATES
list
Alabama
Alaska
records
STATE NAME
in
Arizona
order
Arkansas
end
Wyoming
The notes
DQL syntax,
On
menu
the Screen
In Interactive
When you
indenting automatically.
spacing
if
you
like.
You can
Volume
is
correct.
1-6
3
Chapter 2
and
Defining, Modifying,
Running Procedures
hen you select
(Option 4)
DQL
menu.
Procedures
Z.
Run Procedure
Start Neu Procedure
3.
1.
^iijam-niaar
Define Fornat
Define Print Style
7. Saue Procedure
8. Load Procedure
9. Delete Procedure
10. Print Procedure Definition
5.
6.
^=
ESC
[]
^ij
to [E
Bi
F9 3
lili
\:iMtMll
C:\DEASE\TUTORIftL\
Figure 2-
The
DQL menu
is
--
gjg]
Database
The
4/17/89
10:12 an
DQL Menu
DataBase Query Language. It's the primary tool that let's you
define, modify, save, and run (execute) DQL procedures.
DQL menu
QBE
The
is
similar to the
1
2-1
The
procedure.
Volume
QBE
the
DQL menu
has no
just
far
one of the
is
more
different information
each
a procedure.
For example, if you have a procedure that lists all the employees in
your company, you can define a Data-entry form with just one field
called DEPARTMENT. Then, just before running the procedure, you
can enter the name of any department on the Data-entry form.
When you run the procedure, DataEase lists only the employees for
the specified department.
is
lets
executed. This
Using this technique you can easily generate a separate report for
each department in the company simply by entering the name of
each department, one-at-a-time, on the Data-entry form.
Although you define and save a Data-entry form like a regular
Record Entry form, the information entered on a Data-entry form is
only used to process the current procedure - it's never stored in the
in
DQL Le.xicon.
database. Think of
specific data
runs,
The query
is
do with
communicate these
in
What form
Which
What
Volume
It is
DQL vocabulary
that data.
tell
where
to find
composed of
and syntax to
any information
The query
is
the set of
2-2
Run Procedure
2.
database.
Start
Start
New
New Procedure
Procedure removes a previously loaded procedure from
this option when you want to create a new procedure,
memory. Use
or you want to
remove
memory.
3.
used
at the start
of a particular procedure.
in just like a
Data-entry form
It's
is
most often
4.
menu
Define Query
management
operations.
When you
select Define
Query, you can use either Interactive Mode or Edit Mode to define
the query. Once you have defined and saved the query as part of a
procedure, this
5.
menu
Define Format
using field
names
as
line,
2-3
Volume
6.
lets
7.
Save Procedure
Save Procedure
lets
When you
the database.
name
8.
(saving both).
Load Procedure
Load Procedure
memory
list
of
lets
to either
all
9.
its
name
or the
list.
Delete Procedure
Delete Procedure
lets
DataEase displays a
list
all
(erase) a procedure.
name
or the corresponding
verify that
from the
you want
number from
to delete the
the
list.
You
procedure before
it
its
are asked to
is
removed
disk.
10. Print
Procedure Definition
procedure.
.
It
\..
if
NOTE:
one
refer to
Volume
2-4
Execute a Procedure
DataEase displays a
for
you
to select the
When you
list
of
all
j
Procedure
executes
Run
the
in
memory.
to run.
select
in the
all
database
to run:
the
in a
window menu on
DQL
of the screen.
When you
press
RETURN,
how
the procedure
the explanation of
how
to use
For
When
want
the procedure
procedure before
to abort the
NOTE:
You can
select
hy typing
typing the
the
PROCEDURE NAME
finished, the
is
its
the following
DQL
DQL menu
it
is
reappears. If you
ESC.
finished, press
hii>hlight cursor,
or
typing
match. Press
RETURN
to select the
highlighted
item.
2-5
Volume
New Procedure
How to
Start a
New Procedure
computer's
memory
Once
different procedure.
the
in
Start
memorv.
procedure.
When you
select Start
New
message:
New
in the
Procedure Started
Data-entry
Form
option
to define a Data-entry
is
in
memory
(if
highlighted.
You can
that
you
want.
NOTE:
You must
New
Procedure option
Volume
command.
2-6
Is
a Data-entry
is
Form
Form?
form
is
report format.
procedure.
commands
You can
a
you
is
rorn:
62
F4iiii;nia EsciaBii
Figure 2-2
Fzama F3Bin
When
in
State:
Data-entry
STATE
Hue
it
Form Used
lists
in the
2-7
Volume
How To
To
Form
DQL
menu. DataBase
Form
Form
asks:
form.
After running the procedure, display data-entry form again?
Answer no
if
once
each time).
If
Answer yes
if
NOTE:
Volume
DQL
Lexicon.
2-8
Form
Indexed
Unique
Sequenced
Data-entry form
exactly like a
is
defined
Record Entry
form.
fields
fields
fields
Virtual fields
Fields
Subforms
form
is
exactly the
text,
You can
Definition
and Relationships,
for
to
define a form.
2-9
Volume
Form
When
Data
Variables used
Data used
Data
to
to
be entered or modified
in
in
be processed by a query, a
computations
conditional processing
in
Lookup formula
to automatically
transfer information
form and
insert
it
to
in the
Data-entry form.
holds the sales tax rate for each state and a Data-entry form. Then,
when you
enter the state to process, the sales tax rate for this state
is
executed.
you
tell
DataEase
in
Query
on the
CUSTOMERS
list
with state
data-entry state
records
tells
DataEase to
specified in the
Volume
list
STATE
field
who
2-10
tlie
Data-entry
Form
start of a
in
query.
The
DQL
input
input information.
lets the
database.
Data Input
Method
input
methods are
to
DQL
DQL Lexicon.
it.
When you
is
SAVE
to
saved on disk
it
is
only saved
is
in the
however,
is
never
computer's temporary
start
new
The Data-entry form
definition can he saved on
When
never saved.
is
run,
it
is
was
just used
Volume
to recall
only the
2-12
Form.
When you
is
Form changes
first
DQL menu
Modify Data-entry
view or change the
to
is
asks:
If
Answer no
to
Answer no
When
the Data-entry
form
is
it
just the
Remember, however,
if you
add or delete fields on the Data-entry form, you must also modify
the query to reflect those changes.
2-13
Volume
commands
that let
in
tell
live in Connecticut?), or
it
total
procedures.
DQL procedures.
(e.g.,
a powerful group of
DataEase how to
your database. These questions
and
is
often a
list
New
all
is
called a report.
A more
Advanced Processing capabilities
might be a set of instructions that tells DataEase: when the user
named Carol signs on to the database named DAILY after 5:00
But DataEase can do more than answer tough questions!
sophisticated use of the
DQL
P.M., run the procedure that posts the day's transactions into
several related database forms, print the corresponding invoices and
list
be reordered.
DQL Output
Many DQL procedures
when you
records command, DataEase
list
list
of records selected
Some
modifies records
in the
is tiot
visible.
A query
may
or
may
that
not
display the modified result. There are also procedures that do not
DQL
output that
is
saved
in a
disk
file
Volume
1-2-3.
2-14
Mode
When you
select
Interactive
Mode.
lists all
it
commands
or values
//(
Interactive
Mode.
DQL
programming
details.
Processing procedure
This is
City
State
Spouse 3: Street
for CUSTOMERS
uith CURRENT Balance
sea
list records
4:
Figure 2-3
Changing
5:
[^^1
Interactive
b:
Zip
MODE IliUJJ-.IJIUia
Mode
Screen
Move
l\/lodes
in addition to Interactive
that lets
To
Edit
2-15
Mode
left
to Interactive
Mode
into Edit
the cursor
up or toward
left
into Edit
Mode. Press Fl
INTERACTIVE to change
from Edit Mode to Interactive
Mode.
To switch from
INTERACTIVE.
Mode,
press Fl
Volume
0:
NONE
field
listed.
name
CUSTOMER NAME
2:
it
line
MORE
F1
menu
displays a
of
list
all
of
all the field names defined in your database form (e.g., CUSTOMER
NAME, ADDRESS, STATE, ZIP). If there are too many choices to fit
on one
line, press
window on
When you
Fl
MORE
is
automatically
How To Bypass
Interactive
Mode
l\1enus
In
many
menu
is
TAB
to
list
Many prompts
of valid
NONE. If you
to select NONE.
0:
menu
cause a series
of menus to appear. If the
choice you want is not on the
first menu, you can skip to the
next menu by pressing TAB.
Some prompts
When
menu
item.
To bypass such
TAB.
Volume
TAB
NONE).
(instead of 0)
For
is
treated as a
this reason,
we
to
2-16
DQL Commands in
Interactive
Mode
TAB
until the
menu
is
required, instead
When
typing
commands
unless prompted to
do
selection in Interactive
type
so;
spelled.
2-17
Volume
Mode
Interactive
is
lets
procedures. Press F9
Low Level
LEVEL
to
into
management
Mode is divided
Low Level and High
Level. Press F9 LEVEL to
Interactive
to the other.
level to
another.
you
lets
retrieve information
the
let
DQL
relational operators.
Low
Level also
DQL relational
The
operators
in the database.
High Level gives you access to the full power of the DataEase
Query Language, including mathematical operations, 58 built-in
functions, and procedural and non-procedural
commands
transactions.
that let
In
High
Low Level
questions
you
link together
procedures
processing, billing,
applications.
When you
select Define
automatically enters
Query on
Low
DQL
for
want
command
in the
the
DQL menu,
Level Interactive
upper
left
comer of
command and
DataEase
Mode and
displays the
the screen.
restart the
If
you
query in High
Press
upper
left
Edit Mode
2.
Press F7
3.
Press
4.
Press Fl
F9
into
DEL
LEVEL
comer of
Mode
to switch into
INTERACTIVE
command.
High Level.
to return to Interactive
Mode.
Volume
2-18
Mode
When you
select
DQL
menu, DataBase
automatically enters Edit Mode. In Edit Mode, you type the query
directly
menu
choices.
Edit
Mode
can be
much
DQL
to do.
Mode
move
the cursor
around the screen and type specific DQL statements more rapidly
than selecting choices from the Interactive Mode menus. For this
reason, many experienced users work mainly in Edit Mode and
switch to Interactive
Mode
form and
to quickly select
field
names
Interactive
Mode.
if
To
Mode,
first select
DQL
syntax, press Fl
Mode and
Mode
INTERACTIVE
tlie
tlie left
cursor up or toward
comments, or copy
blocks of text. If you make an error or want to change a query
while working in Interactive Mode, just move the cursor up or left
to switch into Edit Mode. In Edit Mode you can backspace, type
over mistakes, add comments, and use the function keys F3 CUT,
F5 COPY, F6 PASTE, F7 DEL LINE, and F8 INS LINE exactly as
you do in Form Definition. To return to Interactive Mode, press
Fl INTERACTIVE, and the prompting resumes immediately.
Edit
Move
is
in
explanation
comments
to
oflww
to
add
a query.
Syntax Errors
DataBase helps you create queries by preventing you from saving a
query that contains a syntax error. DataBase checks the entire
query and places the cursor on the first syntax error it detects. All
syntax errors must be corrected before a query can be saved.
DataEase automatically
switches to Interactive Mode
and positions the cursor on the
first error.
2-19
Volume
in Edit
Mode
After you define a query. Option 4 on the DQL menu changes from
Define Query to Modify Query. When you select Modify Queiy,
DataEase begins in Edit Mode when the query displays on the
screen.
In Edit
Mode you
can
When you
SAVE
using the
alter text.
to save the
Another
to
it
lets
you copy
is
displayed, use F5
Do you want
to
or part of an
all
COPY to copy
all
new query
While the
or part of
it,
first
or
query
or as an addition to another
and then
existing query.
DataEase prompts:
Paste Block
in
another Query?
or
OR
Save Procedure and save the existing query under a new
name. This lets you keep the original procedure intact as well
as use the new ly named copy as the starting point for defining a
Select
new
Volume
procedure.
2-20
How to
To
Switch Modes
Mode
to Edit
left
When you
Mode
the
Mode,
the
When you
to Interactive
Move
the cursor
up or toward
left
into Edit
Mode. Press Fl
INTERACTIVE to change
from Edit Mode to Interactive
Mode.
Mode, press Fl
query.
2-21
Volume
N N
N G
PROCEDURES
Save Procedure
Saving a Query
In
Memory
While you are working on a query, you can press F2 SAVE to save
what you have entered up till now. The following actions take place:
DataEase scans the query
If there are
2.
to Interactive
first
error
it
If there are
3.
any errors
you
to
be sure
in the quer\'.
Mode w ith
it
is
Press F2
in
SAVE to save
a query
memory.
correct.
DataEase returns
on the
detects.
no
errors,
DataEase returns
Level.
at the
In
to the
DQL
additional input.
When you
answer the
In
Low
last
appropriate prompt.
you press
TAB
to
be
listed?
(or select
NONE), DataEase
automatically scans
the query.
In
High Level
Interactive
or no more actions
if
you press
TAB
(or select
NONE), DataEase
automatically scans
(in
High
Level).
the query.
Volume
i.il
To permanently save
(option 7) on the
On
Disk
the query
DQL
RETURN
When you
select
Save Procedure,
if
the procedure
was previously
you answer
yes,
DataEase asks:
If
is
you answer no, DataEase saves the modified procedure under the
name. The original procedure is deleted.
original
NOTE: When
'23
Volume 3
into
Memory
into
""'^
memory.
To
menu. DataEase
8)
on the
''"'
computer's memory.
DQL
asks:
to load:
DQL menu.
The
DQL menu
options that
begin with the word Define are changed from Define to Modify
for each part of the procedure that was previously defined (i.e..
Data-entry Form, Query, Format, Print Style).
Once
a procedure
is
menu
this
DQL
DataEase asks:
Procedure?
Answer yes
to convert the
you answer no
DQL
QBE
DQL menu,
Style.
Volume
to this question,
2-24
Many
powerful
DQL features,
DQL Procedure
capabilities.
In addition,
DataBase
lets
it
is
into a
DQL
use the procedure just like a procedure created with the Define
Query option on
To
the
DQL
DQL
Procedure, either:
DQL menu
and
OR
With a Quick Report
in
memory,
QBE
Quick Reports.
specify the
menu.
DQL key.
press the F9
to the question:
DQL
automatically he converted
into a DQL Procedure with a
sin,^le keystroke. This is a
good way to learn how to use
the DQL - convert a simple
Quick Report into a DQL
Procedure and then view the
query.
Procedure?
The
NOTE: When
is
forfeited.
DQL
To
DQL
retain
Procedure
DQL
hack
3, for
2-25
into a
to
,
change
Chapter
Volume
To permanently remove
first select
Delete Procedure (option 9) on the DQL menu and then select the
procedure you want to delete from the windovv menu. DataEase
asks:
When you
be deleted:
to
DataEase prompts:
to delete it?
you answer no. the request is cancelled. If you answer yes. the
is permanently removed from the database and cannot be
procedure
recovered.
Volume
2-26
summary of the
procedure that's currently in
memory, inchuUng the query,
the Data-entry form, the
prints a
2.
if
one
is
procedure.
3.
copy of
80-column
4.
the format as
it
printer.
The
Name, Type,
removed when
To
the output
is
displayed.
procedure currently
you
in
DQL
memory, select
menu. When
to
An example
is
shown
in
NOTE: The
and
there
is
no correctly
2-27
Volume
Procedure Definition
Procedure Definition
Example
QUERY
for
CUSTOMERS
list
records
FIRST
NAME
LAST NAME
ADDRESS
CITY
STATE
ZIP
end
FORMAT
10
20
30
40
50
60
70
80
+ + +. +- +. +. + -+- + + + + +-+- +-
.Items
Name
Address
.end
+ + + + ++++ +- +- +- +- +- +- +-
10
20
30
FIELD DESCRIPTIONS
Mo
40
50
60
70
80
Chapter 3
Define Query:
A Low
Level Example
how to create a query in Low Level
Mode, we have defined two forms named
o demonstrate
I
Interactive
CUSTOMERS
and
INVOICES
as
shown
in
CUSTOMER
# field.
in this
field:
CUSTOMERS
INVOICES
Starling on this
page
is
Field
Names
Field
Names
a query
\ INVOICE #
CUSTOMER NAME
r ADDRESS
1.
DATE
o.
CITY
^.
CUSTOMER*
".
STATE
".
PART#
..
ZIP
ACCOUNT BALANCE
CUSTOMER #
,.
8.
Primary Form
in
Interactive
Low Level
Mode.
DESCRIPTION
QUANTITY
COST EACH
ORDER TOTAL
Secondary Form
If you
want
to perform the
you have to first
define the forms and fields.
For information on how to
create forms, see Volume I
Chapter 2. Form Definition
keystrokes,
Figure 3-
The
CUSTOMERS
to the
INVOICES
CUSTOMERS
- Low
form
form, there
INVOICES form
(all
CUSTOMERS
the
INVOICES form
CUSTOMERS
3-1
is
may
be
many
same CUSTOMER
#).
form. This
related to
means
there
may
be
many
and Relationships.
in the
records in
in the
form.
Volume
DEFINE QUERY:
we want
in alphabetical order.
The
CUSTOMERS
INVOICES
form.
To
is
we have
stored in the
to create a
query
alphabetized).
DATE OF PURCHASE
Jensen, Dave
Fisher, Jay
Cooper, Mary
Davis,
Pam
Ivers, Clark
Adams, Sam
Baker, Fred
Evans, Rick
Hill,
$210.00
S195.00
12/30/89
12/20/89
12/10/89
12/24/89
12/22/89
12/18/89
12/15/89
12/27/89
12/31/89
12/19/89
Gomez, Louis
Brenda
Figure 3-2
ACCOUNT BALANCE
;;350.00
S725.00
S175.00
;;675.oo
S595.00
;;240.oo
S865.00
S525.00
we want to generate,
who purchased something in
we want to know the date of each
but
it
it
was.
add selection
who owe
criteria to
more than
customers
$500.
Volume
We
tell
us
Selection criteria
DataEase
tell
to select
some
3-2
records in the
500
we must
What form
Which
form
ACCOUNT BALANCE
in the
What
that
field.
tell
DataBase
we want
example,
to
list
report).
always the
first
word
in a
Low
Level query.
all
record
is
DataBase
the actions are performed for the first record, the next
and
read,
continues until
Now,
tells
all
let's
all
all
The menu
1
On
name
SYSTEM 2: CUSTOMERS
NOTE: These
3;
INVOICES
4:
menu choices
F1
MORE
Low
Level
INVENTORY
example. The
that
if you
appear
additional prompts
in this first
are defining a
3-3
line reads:
Select form
Low
many
and commands.
Volume
DEFINE QUERY:
The form you select from this first menu is the Primary form for
the query. The Primary form should be the form that holds the key
data you want to view or manipulate.
for
later in this
the
is
form
CUSTOMERS.
is
the form
want
to the
form name
You can
to
you
view or manipulate.
reads:
CUSTOMERS
Any record
selection criteria?
NONE
with
You
DataBase
tell
inserting the
that
that
you want
keyword with
you want
in the
to select only
query.
by
the
CUSTOMERS
CUSTOMERS
to
with
0:
NONE
Now
field
name
CUSTOMER NAME
DataBase
is
ADDRESS 3:
customers
2:
who owe
us
We
CITY
name of
4:
STATE
the field on
want DataBase
5:
In
ZIP F1
MORE
which the
DQL,
this criterion is
Volume
3-4
> 500
To
Fl
MORE
Now
select
form.
CUSTOMERS
for
with
Now
CUSTOMERS
reads:
account balance
DataEase prompts:
4:
<=
5:
6:
between
7:
not
DQL
Comparison Operators:
>
The query
reads:
CUSTOMERS
for
with
account balance
>
We
want
hit
TAB
statements or punctuation to
the query. When typing a
CUSTOMERS
with
3-5
the Spacebar.
reads:
Volume
DEFINE QUERY:
Next, DataBase asks
if
you want
to specify
criteria:
Any more
0:
NONE
and
criteria?
2: or
0:
NONE
listed.
selection criteria,
name
field
CUSTOMER NAME
2:
5:
ZIP F1
MORE
CUSTOMERS
ACCOUNT BALANCE > 500
with
list
it
automatically places a
semicolon at the end of the for
statement and inserts the list
records command on the next
line in the query.
records
The semicolon
is
DQL
it marks
end of the for statement
which specifies the queiy's
Primary form. You must insert
a semicolon at the end of the
for statement and after each
synta.x requirement:
NONE,
DataBase automatically
added a semicolon (;) after the account balance value and inserted
the phrase list records on the following line. The list records
command
is
you cannot
enter, delete, or
modify records
in
the
list
The
list
items
command
records
we want
alphabetical
to
list
report output
is
appear
list
the
to
we want an
CUSTOMERS
with
Since
the field
tells
records
CUSTOMER NAME
tells
Volume
3-6
NONE
in
order
in
2: in
listed.
groups or
reverse
3: in
in
a specific order?
groups
4: in
their records
in
order
(putting
Adams ahead
in reverse sorts in
of Coolidge).
names arranged
in
listed together as a
group with
all
the
Republican presidents).
in
you generate
The query
for
presidents.
lets
total
lowest choice
number
to
reads:
CUSTOMERS
with
records
CUSTOMER NAME
3-7
groups and
The
in
order
Volume
DEFINE
Although
in this
E R
'I-
to sort our
customers
example, we want
their
names
to
we
in alphabetical order,
STATE
groups
in
CUSTOMER NAME
When combining
sorting
state
If.
in
for
and also
sort
use:
in
Order
commands
in
groups
a portion of
Query
CUSTOMER NAME
in
order
Query
STATE
in
groups
CUSTOMER NAME
in
order
Report Outputs
Alabama
Adams, Sam
Adams, Sam
Baker, Fred
Cooper, Mary
Davis,
Ivers,
Pam
Evans, Rick
Fisher, Jay
Gomez, Louis
Hill,
Brenda
Ivers,
Clark
Gomez, Louis
Jensen, Dave
Fiaure 3-3
Volume
Clark
Alaska
Cooper, Mary
Jensen, Dave
Arizona
Baker, Fred
Evans, Rick
Fisher, Jay
Sort
Commands
3-8
Returning
for
to our
CUSTOMERS
with
records
CUSTOMER NAME
in
order
DataBase prompts:
to
be
listed?
0:NONE
1:
you
the in
If
your query
is
more
(semicolon).
semicolon
to
is
list
items.
DataBase
report.
field
is
We
now
want
not in the
//(
tell
listed.
name
we want
asking
to
list
if
the
CUSTOMERS
form
(it's in
the
INVOICES
form).
3-9
INVOICES
form.
Volume
DEFINE QUERY:
To
the
INVOICES
fields, press
we have
to tell
DataEase
to use
TAB
menu and
the next.
DataEase
Beneath
this
menu
of seven operators.
The
DQL Relational
Operators
0:
NONE
all 2:
any
3:
count of
4:
highest of
5:
lowest of 6:
sum
of F1
highest
MORE
in the
(all.
of,
DQL Lexicon.
to retrieve
is
the
for
So, to
tell
customer,
is
the highest
DataEase
number
to find the
first select
in the
for each
The query
reads:
for
CUSTOMERS
with
records
CUSTOMER NAME
in
Order
highest of
This
tells
Read
all
DataEase:
Volume
3-10
NONE
1:
forms
in the
database:
INVOICES
select
CUSTOMERS
ACCOUNT BALANCE > 500
with
list
records
NONE
with
NONE
Now
INVOICE #
DataEase
is
INVOICES form
field
3-11
name
is
2:
'"
^'^'^^''
^p'"!^.Z
Z'l"'
Primary form.
DataEase prompts:
DATE
listed.
3:
CUSTOMER
4:
PART #
F1
MORE
added
to the
query which
now
Select date.
The
reads:
Volume
DEFINE QUERY:
for
CUSTOMERS
with
records
we want
if
by the values
in
Select records
We
want
in
to list the
groups or
TAB
to
bypass the
a specific order?
TAB
in
to
be
menu
to skip this
menu. Keep
listed?
We
customer, so select
Since
we bypassed
(semicolon).
Select
field
from the
INVOICES
CUSTOMERS
form again:
further choices
form, the
Note that
name
5:ZIP F1
MORE
insert
have
it
in the report:
you
separately.
press Fl
MORE
and
TAB
Volume
select
in
to
account balance
answer
be
to
again.
each prompt
until
you reach:
listed?
3-12
press
TAB
Low
Level
Interactive Query,
listed
looks like
this.
for
'Z:2,^i^-ns:ns a period,
scans the query for syntax
errors, saves the query in
CUSTOMERS
with
to
records
the DQL menu. Option 4 has been changed from Define Query
Modify Query. You can now define a custom report format
On
to
in
Chapter
shown
5), the
in
Report Output
CUSTOMER NAME
Adams, Sam
Cooper, Mary
12/15/89
12/24/89
12/31/89
12/19/89
12/18/89
Evans, Rick
Hill,
ACCOUNT BALANCE
Brenda
Ivers, Clark
$595.00
S725.00
S865.00
!;525.00
$675.00
As you
NOTE: DataEase
time.
If you
want
to
in
memory
at
^13
DQL
menu.
Volume
Low
Level queries
let
you
retrieve information
from
database.
procedures:
list,
and modify
output, but
it
itself
in
many operations
shown on DataEase menus such as Record Entry, Run
Procedure, Backup Database, Install an Application, etc.
In addition, a Control procedure can invoke
COMMANDS
(see
list at right).
Processing
Commands (numbered
in a
Control
procedure.
Procedural
Commands (numbered
procedure.
Control
Commands (numbered
NOTE:
in
in a
of commands available.
Control
a Processing procedure.
Window Menu
Of High Level
List
Commands
DEFINE QUERY:
In this example, we'll create a
new
like the
preceding
Low
new
automate
its
from the
Down
East database.
Post Orders
POST ORDERS
ORDER ENTRY
INVENTORY
Query
form.
The query
for the
Orders Procedure
POST ORDERS
procedure
shown below:
is
ORDER ENTRY
POSTED = NO
for
with
if
CUSTOMER
# = blank then
in CUSTOMERS
ORDER ENTRY
enter a record
copy
ail
from
end
for
LINE ITEMS
modify records
in
INVENTORY
end
examine
let's
for
this
forms. The
POSTED
a time:
ORDER ENTRY
POSTED = NO
with
because
at
is
the
we want
ORDER ENTRY
form
two other
ORDER ENTRY
The next
line in the
if
^3
query reads:
CUSTOMER
= blank then
Volume
DEFINE QUERY:
The
first
CUSTOMERS
to
form.
Since a customer
is
CUSTOMER
new customer.
order from a
CUSTOMERS
The
form. This
known
is
to enter a
new
record in
as a conditional action.
if
records that meet the specified condition (only the records that have
a blank value in the
customer
# field).
blank
the query
tell
DataEase what
to
do
is
means "no
value".
in CUSTOMERS
ORDER ENTRY
enter a record
copy
all
from
If a
The
first line is
new
record in the
DataEase to enter a
form. The second line tells
very straightforward.
CUSTOMERS
It
tells
to enter in the
new
CUSTOMERS
= blank",
zero.
record.
For a new customer, the operator manually enters all the customer
information in the ORDER ENTRY form when the order is
received. This line tells DataEase to copy that information into
the CUSTOMERS form. The CUSTOMERS form automatically
derives a customer # for the new record using a sequence from
Field Derivation Formula.
The copy
from command
all
is
period.
In addition, an
preceding
if
end command
is
it
is
the
initiated by
on
followed by a
command.
In
a statement:
the query.
ORDER ENTRY
with posted = NO
for
if
CUSTOMER
# = blank
copy
all
from
then
CUSTOMERS
ORDER ENTRY
enter a record
in
end
Volume
4-4
form
post
(if
from
first
(ORDER
It
tells
CUSTOMER
ORDER
DataEase which
ENTRY), what records to
records from
to select
command.
is
(CUSTOMERS).
The second
semicolon
only required
afar command if it
refers to the query's Primary
after
First, let's
look
at this section
of the query as a
unit.
form.
for
LINE ITEMS
modify records
in
INVENTORY
end
Now,
let's
for
look
at this part
at
a time.
LINE ITEMS
Low
want
to select records
The next
line in the
modify records
This line
ITEMS
is
query reads:
straightforward.
in
INVENTORY
It
tells
DataEase
lines of the
to use these
INVENTORY
LINE
form.
query read:
These two
lines tell
INVENTORY
4-5
form:
tells
DataEase
to
Volume
DEFINE QUERY:
subtract the value in the
INVENTORY
INVENTORY
The second
commands:
for
in
is
was ordered.
that
LINE ITEMS
modify records
INVENTORY
in
end
To
DQL
satisfy the
end command
after the
first
first
the
modify records
end commands
procedure reads:
initiated
CUSTOMER
all
from
in CUSTOMERS
ORDER ENTRY
first for
command. For
end
for
= blank then
enter a record
copy
means
ORDER ENTRY
with POSTED = NO
for
if
in
the query.
POST ORDERS
for the
LINE ITEMS
modify records
in
volume.
INVENTORY
end
This
fulfills the
The
first
The second
ORDER
CUSTOMERS
fomi.
LINE ITEMS
INVENTORY
form by
Volume
4-6
this
to
menu.
DataBase prompts:
Please enter the procedure name:
In response, type:
POST ORDERS
dist;
1.
later
execute
it
by
and then
OR
2.
OR
3.
Specify the
command
name of
the procedure in a
run procedure
custom menu.
Next, we'll create a procedure that determines the discount given to
who places an order from the Down East Christmas
each customer
catalog.
4-7
Volume
DEFINE QLERY;
PROCEDURE 2:
Calculate Discount
the
is
based on the
Down
East
Compan\
the
amount ordered
The
The
total dollar
total dollar
the
totals is
determined,
we
The query
DataBase
1.
for the
to
do
all
them.
to derive
must
tell
an expression
used
during the processing of a
of the following:
total,
one
total,
and one
calculating the
sum
to store
each
to store
total.
2.
is
customer's discount
variable
ORDER ENTRY
records
each customer.
3.
amount
to
be
4.
the
sum of
all
LINE ITEMS
the orders
records, calculating
since
Modify
5.
the
ORDER ENTRY
customer's discount
Volume
in the
discount
field.
4-8
The
full
Procedure
reads as
follows:
define
define
define
for
ORDER ENTRY
POSTED = NO
with
QTY ORDERED)
:=
sum
of
'
sum
of
qty ordered)
0.10
0.15
0.20
end
modify records
discount
:=
temp discount
end
When
at the start.
if
in a
This makes
necessary, and
using variables
it
also
it
start
with a for
command.
makes
Volume
DEFINE QUERY:
Now,
The
let's
look
hne
first
at this
in the
..
a time.
and
This
first line
name
define
type.
The
This
tells
DataEase
to create a
command
always followed by a
period, not a semicolon.
is
variable.
variable (Christmas
must be enclosed
in
quotes
when
).
it is
The name of a
first
is
variable
specified
in a query.
The
The
A period.
a period.
first
define
define
define
The next
the
to select in
Primary form:
for
ORDER ENTRY
posted = NO
with
As
Volume
4-10
Christmas order
total for
DataBase how
to calculate the
we want
to
only placed
QTY ORDERED)
First, the
:=
when
sum
of
LINE ITEMS
(unit
cost
in
it is first
is
quotes
defined.
No
DQL assign
command:
:=
This statement
sum
of
LINE ITEMS
(unit
LINE ITBMS
tells
the
qty ordered)
sum of the
cost of
all
used
is
assign a value to a
temporary or global variable.
Like the define command, the
assign command must specify
the variable's name and is
followed by a period, not a
semicolon.
to
to
the
In other words, as
DQL sum
cost
each
ORDBR ENTRY
record
is
processed, the
tells
on a related form.
ORDER ENTRY
posted = NO
with
math
in
parentheses to
the
cost
sum
:=
QTY ORDERED)
of
clarifif
Volume
DEFINE QUERY:
The next
DataBase
ANNUAL
Taking
to calculate the
we want
annual
to assign to the
variable).
this section a step at a time,
:=
we
sum
of
begin with:
"YTD"
This statement
equal to the
DataBase automatically
assignment
operator symbol (:=) after the
name of the variable. This
operator tells DataBase that
the value of the variable is
determined by the expression
given to the right of the
symbol (it functions like an
equal sign).
inserts the
tells
sum of
criteria:
with (DATE
between 01/01/88
customer
to
#)
enclosed
in
parentheses.
criteria tell
command.
This
new group of
ORDER ENTRY
records
is
related to the
An ad-hoc
relationship is a
relationship that's created
Form
Definition).
Relationships form.
During a query, whenever you want to change the criteria that are
used to select records from a form, you must create a new
relationship. When you change selection criteria, you must assign
each distinct group of records a unique name using the DQL
named
create an ad-hoc
that relationship a
differentiate
it
name
to
from other
from
operator.
When you
relationship,
is
used
to
in
quotes when
it is
no
Volume
4-12
section reads:
As we explained
group
ITEMS
orders
is
In effect.
DataEase
LINE
stores
Predefined
Relat ionsh ip
fld-Hoc
Relationship
Predefined
Relat ionsh p
i
Of Annual
Variable
ORDER ENTRY
POSTED = NO
with
QTY ordered)
:=
sum
of
customer
sum
4-13
of
ORDER ENTRY
customer
*
#)
qty ordered)
Volume
DEFINE QUERY:
In the next part of the query
purchase
we
we want DataBase
command
This process
is
similar to the
if
POST ORDERS
in the
procedure:
if
CUSTOMER
# = blank then
enter a record
in
CUSTOMERS
we want DataEase
shown below:
if
if
ANNUAL
>1
to
:=
to
(10%)
if
:=
(20%)
0.10
0.15
0.20
'
end
In effect, the case
commands.
enclosed
in
It
command w orks
consists of the
The object
is
As
in the if
is
command,
is
first
- DataEase
a closing
If
end command.
It
may
command.
Volume
4-14
annual
stored in the
take
is
variable.
to
in the
Now.
let's
look again
at the
case in question:
0.10
0.15
others
assign
temp discount
:=
temp Christmas
0.20
end
The
first
value statement
purchases
20%
To
generate the net total for each Christmas order invoice, we must
subtract each customer's discount from his order total. But so far
final part
customer, so
in this
we can
modify records
DISCOUNT
:=
temp discount
end
These three
unposted
ORDER ENTRY
ORDER ENTRY
4-15
form.
Volume
DEFINE QUERY;
The completed query
for the
reads as follows:
define
define
define
for
ORDER ENTRY
posted = NO
with
qty ordered)
:=
sum
of
sum
LINE ITEMS
of
(unit
cost
qty ordered)
0.10
0.15
0.20
end
modify records
discount
:=
temp discount
If no form
snd
If
name
is
specified in
in
SAVE. Then
procedure, enter
Volume
CALCULATE DISCOUNT.
4-16
3: Print
Invoices
Figure 4-3.
DOUN EfiST
Rockport,
(see) 485
DEFINE QUERY:
Query
To
Procedure
shown
in
ORDER ENTRY
POSTED = NO
with
list
records
ORDER
DATE
groups
# in
CUSTOMER
NAME
ADDRESS
CITY
STATE
ZIP
DISCOUNT
LINE ITEMS PART #
all LINE ITEMS description
all LINE ITEMS UNIT COST
all LINE ITEMS oty ordered
all LINE ITEMS (unit cost * oty ordered)
sum of LINE ITEMS (unit cost * oty ordered)
sum of LINE ITEMS (unit cost * oty ordered)
- discount
;
all
procedure to do one
POSTED
more
field
from
NO
to
last
YES. This
is
in the
modify records
posted
:=
YES
end
Volumes
4-18
let's
for
review
this
line
by
line.
ORDER ENTRY
ENTRY
query
form - the
ORDER
form.
with
POSTED =
NO
The
records
command
appear
records
in the output.
order
This
tells
order
groups
in
DataBase
to
group
LINE ITEMS
DATE
CUSTOMER
NAME
ADDRESS
CITY
STATE
ZIP
DISCOUNT
Here,
we
on the
ORDER ENTRY
4-19
Volume
DEFINE QUERY:
all
all
all
all
ITEMS part #
ITEMS description
ITEMS unit cost
ITEMS oty ordered
LINE
LINE
LINE
LINE
Each of these four lines specifies a field on the LINE ITEMS form.
The relational operator all tells DataEase to find every LINE
ITEMS record that has the same order # as the ORDER ENTRY
record that's currently being processed
ITEMS
(it
LINE
oty ordered)
tells
Total
Column on
sum
This line
of
tells
LINE ITEMS
This information
is
displayed
in the
Line
the invoice.
*
qty ordered)
is
displayed as the
sum
-
This line
list
qty ordered)
tells
DataEase
to calculate the
same sum
in the
as the previous
ORDER ENTRY
discount
field
from
this
the invoice.
modify records
POSTED
end
The
is
;=
YES
Volume
DataEase: as each
4-20
Mail Order
and
menu
However, they
let
you
run reports,
etc.
DataEase
to:
championed.
processing capabilities.
Link
Pass values
Now,
actions,
among
we'll demonstrate
procedures.
how
the
Down
East
Company can
link the
whole process
for entering
query that
procedure.
The query
Query
for Mail
ten lines:
is enclosed in
a record entry
command. A period is
quotes
end
4-21
in
form name.
The procedure name
used
text constant
is
enclosed
in
{like
any
a query)
quotes in a run
in
procedure command.
A period is inserted after
specifying the procedure name.
Volume 3
DEFINE
QLER\-:
with the
starts
command w hich
if
sets
up a
conditional action:
if
This
DataBase
tells
commands
else
to
execute
all
the actions
is
between the
before
if
and the
December
25th.
date
is
command.
first
"ORDER ENTRY"
The record entry command lets you enter records from within
procedure. The entered data can then be processed by other
procedures specified
command
This
specified form.
tells
in the
Control procedure.
DataBase
In this case
it
to
displays the
The
run procedure
"POST ORDERS"
When
record
the
the
command
POST ORDERS
in the
LINE ITEMS
QTY ON HAND
The
automatically
is
run.
it
Control procedure.
procedure
CUSTOMERS
in the
for each
is
posted
in
fields in the
INVENTORY
form.
Volume
4-22
command
This
"CALCULATE DISCOUNT"
executes the
The
1 )
run procedure
"PRINT INVOICES"
ITEMS
form and
in the
amount.
The
The
else
command
current date
is
tells
on or
after
December
to
command.
perform
if
the
25th.
else
end
The next
command
marks. In
DataEase
DQL
tells
each vertical
line
tells
to display
The last line in the Control procedure contains the end command.
marks the end of the actions initiated by the if command. The
Control procedure does not require a second end command, as
there
4-23
is
no other command
in the
It
Volume
DEFINE QUERY:
Summary
(Putting
In this example,
menu and
the
All
when you
specify the
MAIL ORDER
displays the
It
Together)
select
MAIL ORDER
the
DQL
ORDER ENTRY
form.
You
in
When you
it
When
is
the procedure
was
originally called.
Volume
4-24
Chapter 5
Define Format/Print Style:
formats that
let
own custom
reports.
In addition,
DQL
you
fomiatting
DQL
procedure output.
For more precise control of your output. DataEase also provides the
DQL output command. The output command can be used
anywhere in a query to specify the exact location of the output. For
more information on the output command, see the DQL Lexicon at
the back of this volume.
information.
DataEase what
tells
it
field values
and
how to physically
DataEase how to arrange
doesn't specify
The forrtial
tells
statistics to
the output
produce form
Defining the format is complementary to Form
Definition. In Form Definition you define the format for data
to
letters,
DataEase what
required for a
report. The format tells
DataEase how to lay out thai
query
tells
information
is
data.
reports, etc.
how
the data
is
to be
output.
DataEase
how to layout the information requested in the query. There
are eight Formatting Commands: .header, .footer, .group
header, .items, .group trailer, .end, .page, and .call. All
formatting
commands
that tell
5-1
store
Commands. Format
Te.xt.
and
Output Fields.
Volume
DEFINE FORMA
Format Text:
T/P
Format
text
Fields: Locations
is
where the
field values
To
in the
move
report output.
Then press
RETURN
displays, or press
press
Note
formatting commands),
command must
begin
iiol
in
column
header
Marketing Departnent
.footer
*-
.group header
Departnent Total
Grand Total
Figure 5-1
Volume
- Sample
itens
.group trailer
.end
Page Z
Commands
5-2
tells
you how
to select, create,
It
produces (as
it
first.
how
It
may
They
in
are followed by
to create a
custom format or
your
own custom
reports.
PREDEFINED FORMATS
DataEase provides several predefined formals which you can use to
save time. These system-defined formats can be used "as is" or can
be edited to reflect personal tastes. In general, many users find that
the best
way
to
format a report
is
it
with
CUSTOM FORMATS
you can create a custom format
Alternatively,
that lets
you design
report to your
enter
output.
Adding form
a centered
text
to designing a
title at
you type
you position
a field
it
the
it
title text at
the
to appear.
to
appear by
5-3
Volume
for a procedure,
columnar
DataEase
format.
The columnar
format displays each record on a separate line with fields laid out
one beside another in vertical columns. If you have specified
grouping
in the
DataEase automatically
creates a columnar format
you don't select a different
format option.
if
additional information
it
SAVING A FORMAT
To
SAVE.
To
on
Select
the
DQL
DQL menu
to
save a
disk.
MODIFYING A FORMAT
Once you have saved a format, the Define Format option on the
DQL menu changes to Modify Format. You can modify a format
at
to
If the
procedure
is
not
select
Option
5,
Modify Format.
existing format?
Answer yes
If
When you
QBE
Volume
5-4
line
2:
The
3:
4:
field
field
with
Table View).
to
on each
line.
as the
5:
to
6:
lets
this format.
to
your
own
specifications.
7:
8:
The mailing
labels format
is
ASCIL
9:
you select any format except custom. DataEase prompts you for
any additional information it requires and then displays the report
If
format. You can use the format "as is" or edit it (except the Lotus
export format, which cannot be edited). To use the unmodified
format, press P2 SAVE. To display the report in the chosen
format, select
format
is
described in detail
in the
end of
this
1)
on the
DQL
menu. Each
described in an
addendum
volume.
5-5
at
How to
The format
fields in
particular topic.
2.
Format from
Reports menu.
Select Define
DataBase
lists
the
3.
Answer
to format.
Quick
list.
from format
4.
edit the
format
cannot be edited.
5.
Add
it
to appear.
You
can add
titles,
draw
6.
Add
want the
field to
When
you want
to insert
text, just as
you can
in the format.
7.
8.
When
the format
is
on
disk,
(or
Volume
format
To
QBE
SAVE
to
DQL menu
5-6
How to
To
illustrate the
the query, format, and output for a procedure that Hsts the state.
CUSTOMERS
Query
form.
each customer
in
If the
Field
Name
DataBase
splits the
is
as the
column headings
in the
splits the
or
Report Width
In a
columnar
column
a width equal to the Field Length, and then totals the width of all
the columns plus a varying number of spaces to determine the line
length required for the report.
You need
this
much
space on a line
Minimum
where nnn
length
is
is
a columnar report
is
nnn
less than
minimum
If the
minimum
asks you to specify the width you want for the report and evenly
Volume
5-8
(cont.)
Name
NAME
Field
Length
(cont.)
Automatic Spacing
you specify a report width longer than the minimum required line
DataBase tries to evenly increase the spaces in the line. For
example, if you specify a line length of 150 characters, DataBase
If
length,
spaces
line.
at
The
20 spaces between
fields (4
system-defined spacing
is
used.
Volumes
is
maximum
and
5-10
(cont.)
This page contains the default columnar format and part of the
report output for a query that asks DataBase to Hst the
CUSTOMERS
records,
ACCOUNT balance
Query
each customer.
Group
If
Statistics
Statistics
DataBase
prompts:
Trailers?
Group headers
in the
query
is
The
automatically included
field
in the
specified statistics.
You can
to generate a
grand totals by
command. This position
trailer
also generate
DataBase
list
trailers for
grand
total rather
tells
group.
Using the example on the previous page, we can group the records
by STATE and generate statistical totals for each state with the
following query:
Query
for
CUSTOMERS
list
records
end
Format
ACCOUNT BALANCE
LAST NAME
STATE
.group header
.items
.group
trailer
State Total
.end
Grand
Volume
Total
5-12
.group header
Statistics (cont.)
The .group
text
Report Output
LAST NAME
STATE
ACCOUNT BALANCE
CT
Brown
$250.00
Davis
State Total
;;3oo.oo
McDonald
$425.00
$425.00
$550.00
FL
State Total
NJ
Adams
$595.00
$525.00
$1,120.00
Hill
State Total
NY
Anderson
Cooper
Evans
$350.00
S725.00
;;865.00
;;675.oo
Ivers
Jenkins
State Total
$140.00
$2,755.00
Grand Total
In addition to
Grand Total
command.
5-13
group
statistic
$4,840.00
which appears
format includes a
Volume
DEFINE FORMA
T/P
Format Types
Field per Line
Format
The
field
When you
select field
per
line.
line
is
inserted
between records.
For example, suppose you want to include all the following fields
from an INVENTORY form in the report output. The query looks
as follows:
Query
for
INVENTORY
list
records
PART NUMBER
DESCRIPTION
STORAGE LOCATION
;
VENDOR CODE
VENDOR NAME
COST PER UNIT
QUANTITY ON HAND
REORDER LEVEL
LEAD TIME
REORDER AMOUNT
end
Format
.items
PART NUMBER
DESCRIPTION
STORAGE LOCATION
VENDOR CODE
VENDOR NAME
COST PER UNIT
QUANTITY ON HAND
REORDER LEVEL
LEAD TIME
REORDER AMOUNT
.end
Volumes
5-14
Format
(cont.)
Report Output
PART NUMBER
When you
form.
select the
format with the same lasout as the Record Entr\' form. DataEase
automatically uses
specify
list
all fields
fields if
to include
ZIP
CODE
in
Query
for
CUSTOMERS
records
FULL NAME
list
ADDRESS
CITY
STATE
ZIP
end
Format
.items nosplit
FULL NAME
ADDRESS
CITY
STATE
.end
Report Output
full NAME John Adams
ADDRESS
8 Smallwood Drive
CITY
Longbranch state NJ
zip
07740
NY
zip
11725
zip
06851
FULL NAME
ADDRESS
CITY
Lvnn Anderson
30 Bainbridge Ave
Commack
Volume 3
state
5-16
among
is
You
Form
first in
Definition.
is
Define a template
just like
compatible with as
many
When you
Name
select template.
of the
Template
RETURN.
DOS
file:
If
By
field
you
order 2: By
select
By
template fields
letter)
and
DataEase asks:
field
name
matched
to the
If you
matched to the template
fields by Field Name (name in the output is matched to the name
field on the template, state is matched to the state field, etc.).
select
By
field
NOTE: If the
in the
name,
template
is in
is
C:\DEASE\TPLATES.
DataEase does not
5-17
let
This
is
you enter a
where
DOS PATH.
Volume
To maximize
in
Field
Names
#.
Names
to
make
it
template field
(e.g., a
INVOICE
PART
#.
flexibility,
template Field
CUSTOMER
(cont.)
#,
easier to
etC).
Query
for
CUSTOMERS
records
FULL NAME
list
ADDRESS
CITY
STATE
ZIP
end
In this example,
if
we
we
tell
is
DataEase
to
in the
template.
tell
information
Name
Format
.items
NAME
address
STATE
CITY
ZIP
.end
The
Volume
5-18
(cont.)
Report Output
NAME
ADDRESS
CITY
NAME
ADDRESS
CITY
NAME
ADDRESS
CITY
The dotted
format
text.
John Adams
8 Smallwood Drive
Longbranch
state NJ
zip
Lynn Anderson
30 Bainbridge Ave.
Commack
state
zip
11725
zip
06851
NY
Pat Brown
25 Evergreen Circle
Norwalk
STATE CT
line
(...)
It is
that
typed
07740
is
command.
5-19
Volume
from a
DQL
in
assume we want
BALANCE
to
produce a chart
that
state.
Query
CUSTOMERS
for
list
records
STATE
in
groups
ACCOUNT BALANCE
sum
end
When you
select the
Format
ACCOUNT
STATE
.items
.end
.call
GrafTalk /D
This format
is
%r %e
explained as follows:
The
.call
to invoke
command
GrafTalk
at the
at the
tells
DataEase
by the query
The /D parameter
tells
The
The
(DAT extension).
Volume
5-20
When
can
1.
the
screen,
you
edit the
first
name
as
letter.
2.
3.
separated by
line
two or more
spaces.
The
example, whether
it
is
bar chart or a pie chart and whether it should display on the screen
or be drawn on a plotter. Refer to the Graffalk manuals for
information on
NOTE:
how
to create charts.
DQL
.DBG
in GrafTalk before
Procedure. Be sure to give the
name as
e.xtension.
5-21
Volume
from
if
it
is
different
When
the procedure
is
run.
.call
command,
is
DataBase.
To modify
in
it
is
the
procedure
is
run.
any way
report.
to reflect the
changes to the
chart.
this
How to
The
When
1.
2.
3.
DQL
7.
farther,
when
names
Volume
it
new
data.
5-22
4.
5.
New
memory
Select Option
1,
you
6.
If the Print
SAVE. Do
DataEase.
7.
In a
8.
go
You do
Be
name
sure to answer
no
to the
when
save
the procedure
data'.'
From now
on.
when you
is
run.
question, since
chart.
You
will not
5-23
Volume
1.
Any changes
you make
that
to the data in
automatically reflected in the chart the next time you run the
procedure.
12. If
you want
to
make changes
chart in GrafTalk.
restore the chart,
Use
to the chart,
you must
edit the
Chart option
to
DQL
Procedure.
Do
not change
this
Volume
5-24
The mailing
It
can also
line.
records.
When you
select
How many
labels across?
(in a horizontal
per label?
in the
widest
field.
SAVE
When
you've
come
widest field
is
this:
Query
for
CUSTOMERS
records
FULL NAME
list
ADDRESS
CITY
state;
;
ZIP
end
5-25
Volume
ST'tLE:
Format Types
Mailing Labels Format
Format
.items across 3 wide
25
.end
To
1
move
line,
on the format
and specify
Report Output
John Adams
Lynn Anderson
30 Bainbridge Ave.
Commack, NY 11725
8 Smallwood Drive
Longbranch, NJ 07740
on continuous form
page length as on
shown
It
may
format, adding
Volume
field;
labels,
3) cut
and
Pat Brown
25 Evergreen Circle
Norwalk. CT 06851
be sure to
end of this
e.xtra
5-26
program.
It is
often used to
When you
What
select export,
is
DataBase asks:
Mail-merge
2:
MultiMate
3:
WordPerfect
4:
GrafTalk
5:
Lotus 1-2-3
Symphony.
6;
Variable Length
records.
7:
Fixed Length
8:
DIF
5-27
name
is
on the
Print Style
specified.
Volume
DEFINE FORMAT/PRINT
ST'iLE:
Export Format
Mail-merge
form
in
that
can be
the addressee
letters).
carriage return
is
comma
is
line.
used
Mail-merge communications
format.
Number
Names
enclosed
Names
are also
in quotes).
in
Query
for
CUSTOMERS
records
FULL NAME
list
ADDRESS
CITY
STATE
ZIP
end
Format
FULL NAME
.items
_M
ADDRESS
",.,-,,"
,
CITY
",
,
-*
STATE
_ll
"-.r^"
,
ZIP
.end
Report Output
"FULL NAME", "ADDRESS", "CITY", "STATE", "ZIP"
"John Adams", "8 Smallwood Drive", "Lorigbranch", "NJ", 07740
"Lynn Anderson", "30 Bainbndge Ave.", "Commack", "NY", 11725
"Pat Brown", "25 Evergreen Circle". "Norwalk", "CT", 06851
Volume
5-28
"
MultiMate.
documents.
a separate
in the
fields
in
Query
for
CUSTOMERS
records
FULL NAME
list
ADDRESS
CITY
STATE
ZIP
end
Format
.items
l-FULL NAMEI-
l-ADDRESSIl-CITYI-
_L
.end
.call
MMERGE
-q
%m %e
5-29
Volume
MuhiMate
formatting
commands
(|-)
are inserted
field
record symbol.
The
.call
named
command
calls a special
MultiMate format.
After DataBase generates the format:
SAVB
1.
Press F2
2.
DQL menu.
3.
When
is
displayed, select
4.
the output
file,
DOS
C:\MM\MAILLIST.DOC
When you
select
Run Procedure,
is
automatically
is
The maximum
Field
Volume
that
can be converted
at
one
width
Names of more
than
is
156 characters.
is
64 per record.
2 characters
may be truncated.
5-30
end of each
Field
can be
field.
file that
Names
are omitted.
as follows:
Query
for
CUSTOMERS
records
FULL NAME
list
ADDRESS
CITY
STATE
ZIP
end
Format
.items
^@[120A]i
.end
In this format, the
@[120A]
that
is
DataEase
each field value.
the WordPerfect "end
inserted by
Code C^R)
C^E) Merge Code,
after
of record" code.
5-31
Volume
(cont.)
F2
Press
SAVE
2.
DQL
3.
When
is
menu.
displayed, select
4.
DOS
the output
file,
full
When you
number of records or
Volume
5-32
that
in
When you
you want
yes, the
select the
record
first
in the
Names
output
file
in the
format.
If
you
Names
Names
file,
of the
file
DataEase
created by DataEase.
you
DOS name
If
if
select
Names
file,
The
first
For example, suppose you want to produce a chart that shows the
account balance information for each customer. The query looks as
follows:
Query
for
CUSTOMERS
list
records
CUSTOMER #
ACCOUNT BALANCE
;
end
Format
CUST
ACCT BAL
.Items
.end
NOTE: When
5-33
and acct
bal.
Volume
3
I
Report Output
ACCT BAL
CUST #
2235
4009
3525
6420
1248
5512
7860
1514
0900
6002
595.00
350.00
250.00
725.00
300.00
865.00
525.00
675.00
140.00
425.00
first
Name
as
2.
3.
separated by
line
two or more
spaces.
the .items
Volume
5-34
When you
select the
Symphony.
To
create the
appropriate
file
.WKS
.WKl
.WRK
for Lotus
When
the
the Lotus
columnar format
file,
the data
is
arranged
column containing a
and 3
Symphony
field.
in the
source data
file,
in a
row
in the
with each
is
compatible with
all
The format
Format
.export Lotus 1-2-3
in
mind when
field layout
and you
2.
The Lotus
it
3.
1-2-3 output
is
not in
ASCII
format. Sending
You cannot
totals, or
any type of
DQL
statistical
group
operator in a
Lotus export.
5-35
Volume
file that
If not,
separate records, and use any character that does not appear in the
Names
as the
first line
if
you want
to include
of the output.
as follows:
Query
for
CUSTOMERS
records
FULL NAME
list
ADDRESS
CITY
STATE
ZIP
end
Format
FULL NAME-ADDRESS-CITY-STATE- ZIP
.
items
.end
Volume
5-36
Report Output
FULL NAME-ADDRESS-CITY-STATE-ZIP
When
choosini; field
and
the data will incorrectly interpret the characters in the data as field
or record separators.
backslash.
When
choosing
field
you use any character other than a carriage return as the record
separator, enter that character at the end of the format line followed
by a backslash. For example, if the
sign is used as the record
separator, it is inserted at the end of the format line followed by a
If
5-37
Volume
many programs,
read by
but
it
creates an
ASCII
can be
no other
file that
if
read, hut
ASCII
is
file
the
same
length, the
Fixed Length
data.
to include
CODE
in
Query
for
CUSTOMERS
records
FULL NAME
list
ADDRESS
city
state
ZIP
end
Format
.items
-\
.end
DataBase automatically
end of
the format line to suppress the carriage return. This character does
Report Output
John Adams
Lynn Anderson
Pat Brown
NOTE:
8 Smallwood Drive
30 Bainbridge Ave.
25 Evergreen Circle
Longbranch NJ
Commack
Norwaik
07740
NY 11725
CT 06851
it
can lead
to
For
data import
this reason,
we
Volume
is
acceptable.
5-38
When you
select the
DIF
v\
ant
to:
Include
If
field
you answer
names
yes.
in
the format
Names
DIF
5-39
Volume
lets
When you
reason,
we recommend
header
footer
itens
.end
ftdd
F4
F5
ESC
Fia
Figure 5-3
Volume
5-40
(cont.)
Specifying Fields
in
Custom Format
When you
in the
can he specified in
the report format without
statistics
is
grouping, or
may
assisted by
menus
to select Field
Names from
if
you use
appearing
in the query.
this
second method.
To
to
to 16
move
scrolls
Column
NOTE:
4000
1.
to
5-41
to
chosen direction.
Volume
Commands
Commands
report format, but they are not displayed in the report output.
Each Formatting
placed
in
Command
Column
When you
is
at the left
column of
Commands (cont.)
at the
top and/or
When
all
as an
the records
The
DQL
Formatting
Commands
.call
can be used
command.
in
any combination
command, an .end
itens
FULL NftME
ADDRESS
CITY
end
Figure 5-4
5-43
Basic Format
Volume 3
Commands
and
are .items
and .end.
command
.end
it
known
.items
of the report.
the .items
command and
Command
is
printed once
for each record processed by the query. The Items Area usually
contains all the fields and form text you want repeated for each
record.
ne.xt
Command is
specifies the
If
a .page
command
End Area,
For example,
is
is
you request a
is
Information in this
printed once at the end
sum
for a
placed after
all
output lines
in the
in the
area
command,
.end
End Area.
generated.
placed
if
If
a .call
it
command
is
when
used,
Report
it
the
must be
last line in
the format.
Volume
5-44
Commands (cont.)
To
Query
for
CUSTOMERS
list
records
STATE
last name
;
account balance
end
Format
STATE
LAST NAME
ACCOUNT BALANCE
.Items
.end
Report Output
STATE
LAST NAME
ACCOUNT BALANCE
NJ
Adams
NY
CT
NY
CT
$595.00
Anderson
Brown
Cooper
S350 00
Davis
$300.00
;;250.00
1725.00
!
Volume
Commands (cont.)
Remember that anything between the .items command line and the
command line displays once for each record processed by the
query. For example, if we edit the format adding a dotted line in
next
Format
STATE
LAST NAME
.items
.end
The
Report Output
STATE
ACCOUNT BALANCE
Required Formatting
There are two options you can add to an .items command to control
how the information in the Items Area of the format appears in the
output:
The .items
The
nosplit
.items nosplit
Command
command
tells
DataBase not
When
to split information
lines left
M Command
in vertical
command
lets
in the
Items Area
output lines.
you
is
record every
wide
prints
When you
use this
M characters.
You
N wide M
option, DataBase
new
mailing labels.
specified
first.
If
plus).
command on
the
wide
options must appear after
same line in the format. These two
Command
trailer
output).
5-47
Volume
you
Command Options
.items across
Command
per row and each label (including the space between the labels) is
option in
30 characters wide, you could insert the across N wide
Format
.items across 2 wide
30
.end
The
starting in
column
might look
like this,
Report Output
John Adams
8 Smallwood Drive
Longbranch, NJ 07740
Lynn Anderson
30 Bainbridge Ave.
Commack, NY 11725
Pat Brown
25 Evergreen Circle
Norwalk, CT 06851
64 Lake Street
Alameda, CA 94501
NOTE: The
Paul Carter
is
designed to
and
Volume
wide
M values.
5-48
are .group
header and
Commands
trailer.
when
Commands
control
in the
in the
the information
trailer
query.
specified in groups or in
groups with group totals.
output.
The Group Level Commands are always used in pairs. There must
be one .group header and one .group trailer in the report format
for each li.st field specified in groups or in groups with
group-totals
should he used
command
in a report
command.
If
.group header
.group header B
.items
.group
.group
trailer
trailer
.end
Figure 5-5
5-49
Pairing
Volume
.group header
Command
information placed
is
in a
known
command and
as a
the next
prints
Any
Command
information placed
in
is
known
Group
Group
as a
Trailer
once
the start
command and
Group
Area
at
Trailer Area.
once at the
must be placed
prints
level statistics
Command is
Trailer Area.
in
in the
format.
in
may want
more
the
ACCOUNT BALANCE field valuc to appear in the .items area, the group
of the account balance field to appear in the .group trailer
area, and the overall account balance total to appear at the end of
total
the report.
NOTE:
Header or Group
in the
Group
on a separate page.
Volume
5-50
(cont.)
The example on
CUSTOMERS
form.
Group
Query
for
CUSTOMERS
list
records
end
Format
LAST NAME
STATE
ACCOUNT BALANCE
.group header
.items
.group
trailer
State Total
.end
Grand
Total
$^^m
The .group
In addition to
group
totals, this
5-5
in the report
command.
Volume
(cont.)
Report Output
STATE
CT
LAST NAME
ACCOUNT BALANCE
advance
to a
new
page.
tell
DataBase what
when
The Page Level Formatting Commands
at the
to
commands appears on
new pa^e.
start printing
group
to begin printing
in the
Group
Trailer Area.
If you place the .page command at the end of the Report End Area.
DataBase advances to the top of a new page when the report
completes printing. If it is placed first or last in the Items Area,
each record is printed on a new page (placing it between fields
The .header
[N]
split).
Any number
of .page
commands
Command
command
Command
the .header
known
command and
is
as the
the report.
5-53
Volume
(cont.)
Format
For example, the following format:
DATE
LOCATION
DATE
LOCATION
.header 2
CITY
(cont.)
.footer
.end
in which the report title (DataBase Training
Course Schedule) appears only on the first page and the column
produces a report
heading information
every page.
(cit^',
at the
top of
Page
Volume
2).
5-54
The
The
.footer [N]
.footer
(cont.)
Command
command
is
placed
is
in the
command
in a
format,
the .footer
known
command in
a format.
command and
page.
of a multi-page report.
If
specifies
information to he printed at
required.
Command
.footer
to
appear
until a certain
the .footer
called
placed
summary
in the
5-55
Volume
.call
Command
The
call
The
The
called
program must be
in the
same
your
directory as DataBase, or
.call
command
is
to the
the
DataBase
shown below:
The
.call
.call
at the
end of a DataBase
report.
PROGRAM
(the
DOS
program
to store
The
The
procedure. This
the called
There
is
Volume
is
program
an example of the
completed.
.call
command on
5-56
.call
Command
(cont.)
list
records
named on
.call
it
to
command
in the
Report).
file
tells
the
query (or
the query
list
is
fields in the
Quick
GrafTalk /D
%e %r
NOTE: A
procedure containing a
.call
command cannot be
in
5-57
list.
Volume
When you
Keys
in defining
and move
text in
Form
Definition.
Function Key
F2
Use
SAVE
F3CUT
F5
Removes
COPY
Copies
F6 PASTE
F7
in the
computer's memory.
Command menus.
DELLN
F8 INSLN
rests.
rests.
SH-F9 PRINT
FIO FIELD
Adds
NOTE: When
Formatting
Commands must
is
currently positioned.
mind
that all
Volume
5-58
You can
The
report
boundary
titles,
lines,
Format
press F8
your
set.
access to the
ASCII
to create a
number of
around
2,
all
Form
5-59
Volume
2.
Chapter
Definition
Volume
How To Add
You
or Modify Fields
in a
To
you want
to modify),
form. Just place the cursor where you want to add the field (or
where
field
you want from the menu by highlighting it, then press RETURN.
The field (represented by a shaded rectangular area) is immediately
inserted at the cursor position in the format on the screen.
BOK^SSQ^
^aBSSS^MSHE
header
HasSOMESMSBMia^SSr
Mane ^^^^^^^^^^^^^^^^^^^^^^^^^^|
(for neu field, leave blank and press RETURN)
footer
itens
Field Type
end
Suppress Spaces
r&iannnMBff; F7nraron
Figure 5-6
you are modifying a field, when you position the cursor in the
and press FIO FIELD the current field definition is displayed
on the Report Field Definition screen. If the field you specify is a
Number field, DataBase asks which type it is. If you want to
change the number's appearance in the report, you can change the
type in the format (for example, from Floating Point to Fixed Point
or Integer). This change affects only the current report, not the
If
field
Volume
5-60
If
you want
add a
to
skip the
menu
window
inset in the
field tliat
(cont.)
that
DataBase
Suppress Spaces
Sgjgj Fhjp
Figure 5-7
qp
F7|q5pp[g
l^"tBFP|il
in
Window
In the
field
4000 characters
in length.
You cannot
use the
Formula up
all operator,
to
or any
You can
use
When
the
entered
DQL Procedure
in this
items specified
window
in the
In certain cases, if
DataEa,se
field
may
Quick Report)
you misidentify
named SHIP TO
is
query.
a field in a report field formula,
5-61
(or
is
field.
For example,
TO ADDRESS
if
the
in a
TO
field.
Volume
(cont.)
You might do
this to
avoid truncating an
Number fields.
yes. the output
want
If you
is
answer
modified as
is no
on the Field Definitions.
field definition.
if you
you specified more than one statistic for the field in the query,
DataEase also asks what statistical value should be output in this
position in the format. If you want the field value itself to appear,
specify item; if you want the total of the field values (such as for a
group total or grand total), specify sum, and so on.
If
Depending on
additional questions
when you
to three
format.
If
Number
you specify a
field,
RETURN
commas
If
in the output.
which commas
DataEase asks:
Answer yes
You might
if
Number
RETURN
field,
DataEase asks:
decimal point, or
(percentages,
Volume
if
is
etc.).
5-62
(cont.)
Suppressing Spaces
For any type of
field.
DataBase asks:
Suppress Spaces?
Press
RETURN
spaces
in the output.
Answer yes
if
If
you answer
yes, all
on the same
line
move
DataBase asks
lets
last
first
a corresponding
number of spaces
to
For example,
if
Answer
yes:
John
Answer
no:
John
if you
want
to
field:
Adams
Adams
format has a line with just fields (no form text) and all fields
are set to Suppress Spaces, the line does not print if all the fields
If the
for
any record are blank. Instead, the line is moved to the end of
This feature can be very helpful if you are printing
format earlier
5-63
in this chapter,
Volume
all
you want
to
Volume
5-64
Commands
When you
enclose
report.
precede
In addition to the
any control
you want
string
specif)' the
it
in t>rackets
with an
control
you must
and
@ sign.
precede
it
with an
@ sign,
DataEase does not check these strings for validity or check the
results in any way. Consult your printer manuals for information
on control strings accepted by your printer.
The
The
@ command
italics,
lets
placed anywhere
in a
in boldface,
The
@ can be
Command. The
character must be immediately
followed by a special character or character group representing the
Formatting
printer function
The
you want
Entry form
is
highlight
report information in boldface,
italics, or any special feature
your printer supports.
its
do not advance
to use.
The
The
(i.e.,
not displayed
text that
in
appears
in
is
format).
example,
if
command
@u command
is
used.
For
during
Record Entry, when the record entry format is used, that text will
be underlined. See the section on Field Highlighting in Volume 2,
Chapter 2, Form Definition, for more information. If the report is
depends on the printer defined on the Print
is designated on the Print Style screen, the
printer control codes generated by the
commands are written in
the disk file as printer codes. If there is no printer designated on
sent to disk, the output
NOTE: If you
want an
output, enter
format.
5-65
Volume
Command
Volume
2,
Chapter
4,
System
Command
Commands
control the
character width in a report.
Print Effect
cl
First
setting in
printer definition.
c2
Second CPI
c3
c4
For example,
CPI and
if
is
command
@c3This
in printer definition.
in printer definition.
the default
following
text will
10 (the
first
in the report
specified),
if
format:
2,
Chapter
4,
inch.
5-67
Volume
Command
Print Effect
11
First
Commands
interline
control the
spacing
in
a report.
setting in printer
definition.
12
Second LPI
13
14
in printer definition.
in printer definition.
2,
Chapter
4.
Volume
5-68
A L
Editing Formats
Page Size
Page Size
DataBase creates and transmits printer control
use of the special
strings based
on your
However, it
does not adjust page breaks to take into account the spacing
changes made by
formatting commands.
more
Similar problems
if
may occur
sizes in the
in
left at
providing
middle of a
line.
5-69
Volume
The
is
a special
DataBase System
form
that is
size,
and
When you
Definition record.
For more
Chapter
4.
Volume
2.
System
Administration.
1:
Screen
Printer
DiEk
PRINT STVLE SPECIFICflTION
flllou Style nodif ication at run-tine
Report Destination: ^^^^|
If disk Output, Filenane:
Z:
J:
Nou press DEFAULT UIEU to get default ualues for the renaining fields.
Printer Nane
Pause after each page 7
IF PRINTER NAME IS
SPECIFIED flBOUE
^m
Text
^H
^^M
^^|
TVPE STYLE
Characters Per Inch
Highlights 1
-Footer-
Figure 5-8
NOTE: If you
output
Volume
inches)
Starting position
ftrea
F4'aaiBiaiR]
C flRRIflGE (in
HHJ
5-70
The
Each destination
is
defined as follows:
copy output.
at
5-7!
is
Volume
If
F2
SAVE
When
is
questions to answer.
SAVE to save the
Press F2
is
Screen
no
destination.
it
report.
scroll
To
Key
Scrolls
PgDn
PgUp
Next Screen
Previous Screen
Start of the Report
Next Screen if you haven't viewed the
HOME
END
Report yet
OR
have viewed so
CTRL^
CTRL^
->
<-
Reports with
Two
If a report is usually
need
far
be printed,
to
Destinations
fill
SAVE.
modification
at
If
may
occasionally
you also
run-time,
when
tell
it
DataEase
the report
is
be printed,
to Screen before
to allow style
may
occasionally need to be
exported, don't specify any printer values (they cause problems for
the target program).
report
VIEW
is
Volume
When
the
DEFAULT
5-72
you select Disk as the report destination you must also tell
DataEase the name of the file and the directory where you want
If
to
If
in the field
letter.
For
example, either
C:\WP\ADDRESS.DTA
or
A:PRINTOUT.DOC
is
acceptable.
NOTE: If you
Printer
Name,
and include a
will eventually
DataEase
he printed rather
planning
to
it,
5-73
Volume
If
you
the
the Printer
First,
printer that
you want to
use.
name and
4,
System
DEFAULT VIEW.
See Volume 2.
System Administration, for more information on printer
Chapter
To
definitions.
When prompted
response
When
is
the report
on
specified
the
Alternatively,
Local
2,
for the
name of
is
most flexible
symbol in this field.
is
Network
1 or
Network
printer
number (Local
2) as listed
1,
on the System
Configuration form.
When
the report
is
run,
Volume
when
it
5-74
The prompt on
you answer yes, DataEase displays the Print Style screen each
time you run the procedure, so you can modify the current
If
specifications.
If you answered yes to this question, but you now want to run the
procedure without changing the Print Style, just press F2 SAVE
when
is
displayed.
DataEase
unmodified procedure.
last
After running a procedure, you can recall the last used Print Style
Specification immediately by pressing F5 DEFAULT FORM. If
you only want to view certain fields, you can recall each field
individually by moving the cursor into the field and pressing
F6 DEFAULT FIELD. However, once you exit the procedure or
load a new procedure, you can only access the Print Style
Specification that was saved with the procedure.
5-75
Volume
DEFAULT VIEW
is
disi<.
if
with
after
asks:
each page?
Answer yes
envelopes.
Answer no
The next
if
from the
Width
values in inches
if
they
defaults.
NOTE: These
to disk; tfiey
Volume
Imve no
ejfect
and reports
specify
in inches.
sent
on a screen report.
5-76
The
Margins
Left:
2.
text.
3.
Top
to
the paper
and
.header
line
\\\q first
ignored.
command
is
of the header.
You must
If there is
in the
no
include a
at
4.
Header
to Text:
the header
5.
line of text.
no
If there is
ignored.
last line
no
footer, this
a .footer
the
6.
margin
command
is
in the
ignored.
You must
at
If there
include
and
Xhs.
of the footer.
first line
last line
If there is
no
of
footer,
are
left
indicating a value of 0.
the Print Style Screen
affects
5-11
is
blank as a default
Volume
The
Control
commands
in the
format.
The
defined as follows:
1.
If
lets
DataBase
this
value should
The value
Definition form.
2.
this value
should be
6.
for
printing.
Definition form.
3.
Highlights:
You can
The
highlights
Special Effects.
The
entire report
is
1:
2;
highlighted as specified
are:
Bold
Underline
3: Italicize
4:
5:
Special 1
Special 2
12: Special 9
Volume
2,
Chapter
5-78
or
Print specification
Do you want
If
to
is
DataEase prompts:
incomplete
Modification
at
to save it in the
computer's memory. To
permanently save the Print
Style on disk, select Option 7.
Save Procedure, on the DQL
at run-time?
is
Data
The
required
cursor
F2
in this field is
in the first
SAVE
incomplete
again.
to the question:
report.
You can
F2
SAVE
When you
finish
whenever
DQL menu
by
and overwriting
5-79
Volume
P RINT
ST YLE SPECIFICftTION
Allou Style Modification at run-tine
^^^^^
Report Destination:
If disk Output.
Filename!
-.v
r enaining
fields.
Text
Area
^^M
^^H
^^H
TYPE STYLE
Characters Per Inch
Highlights 1
-FooterS
all
it
will
is
P RINT ST YLE
Report Destination:
If disk Output.
^^^^Q
SPECIFICATION
Allou Style Modification at run-tine
Filenane:
Nou press DEFAULT UIEU to get default u alues for the r enaining fields.
Printer Nane
Pause after each page 7
3
IF PRINTER NAME
IS
SPECIFIED ABOUE
-Header4
Text
Area
-Footer5
Volume
5-80
Printer Destination:
Page Length
as 0.
labels, specify
v alues
IF PRINTER NAME
for the
r enaining
IS SPECIFIED ABOUE
fields.
<
Text
Area
^^m
^^H
^^^
TYPE STYLE
Characters Per Inch
Highlights 1
-Footer
5
Printer Destination:
To
^ Fhiaiawwa^^
Fsmagf
DataEase stops
after
envelope.
P RINT
Report Destination;
If disk Output.
ST YLE SPECIFICATION
Allou Style Modification at run-tine
|2QQ
Filenane:
IF
r enaining
fields.
Headei
4
Text
Area
5 -XI
HJH
^^H
^^H
4.
6.
Header to Text
Text to Footer
Volume
P RINT
Report Destination;
If disk Outp
ST YLE SPECIFICATION
Allou Style Modification at run-tine
[^Q^^|
CSCUSTOMERS
Nou press DFFrtlH.T UIEU to get default
Pniitfr Nane
Pause after each page 7
^^
IF PRINTER NAME
r et-ta
ining fields.
SPECIFIED ABOUE
IS
Area
&
Footer
^^H
^^H
TYPE STYLE
Characters Per
Highlights 1
nch
ni.u/J*lldi
the report
on disk for
later printing,
all
related
be printed
later
using the
letter.
The
This output
Nou press DEFAULT I'lEU to get default ualues for the renaining fields.
U:Kml>\UZStmm
Printer Nane
Pause after each page ?
3
IF
-Headei
4
Teyt
Area
8
-Footer
5
in inches!
PAGE SIZE AND P OSITION ON C ARRIAGE
Length 3^^| Uidth ^^^| Starting position |
C
^^H
^^H
^^|
IGURE ON LEFT
Z. Right
4.
6.
Header to Text
Text to Footer
TVPE STVLE
Characters Per Inch
Highlights 1
u^mssasEiim
Volume
5-82
Chapter 6
DQL Lexicon
INTRODUCTION
DQL
Lexicon
is
Keyword: The
Type:
term or symbol as
it
appears
DQL
in the
DQL.
Purpose: An overview
Syntax:
in
syntax format
is
itself,
used
in a
next page.
Returns:
is
returned by a function or
operator.
Usage:
in
general
LAN:
the term
LAN
(Local Area
Network).
Example: One
or
more examples
that
query
is
in
complete
example of
See Also: A
When
is
generally included.
all
in the
terms of the
preceding
example.
6-1
Volume
DQL
LEXICON
Syntax Diagrams
In the syntax diagrams, items enclosed in brackets
If
may
or
may
not be
I,
either
may
any
FORMNAME or a RELATIONSHIP in
the query
can be included or
not. If selection criteria are included in the statement, the criteria must be
enclosed in parentheses. A FIELDNAME rtntst be included at the end of
the statement followed by a semicolon.
statement.
DQL
with) are
terms.
FIELDNAME)
Margin Notes
The notes
restrictions,
may
rest
of the
margin notes
Typesize
The
is
the
INVOICES
Volume
in
the Examples
6-2
you want
query
to retrieve.
Form
when you
The symbols
listed
DQL
math
DQL
in
Advanced Processing
Punctuation Symbols
Punctuation Symbols
(semicolon)
(colon)
(period)
(parentheses)
"
(quotation marks)
"
--
(dash)
Math Symbols
Math Symbols
Math symbols
values.
+ (plus)
-
Wildcard Symbols
Wildcard symbols are used to specify unknown characters
(minus)
(multiplication)
(division)
in selection
Wildcard Symbols
Comparison Symbols
Comparison Symbols are used to compare one value to another. The
Assignment Operator symbol is used to assign a value to a field or
(asterisk)
(question mark)
(tilde)
variable.
For a full explanation of any of the DQL symbols, see the entry in the
Lexicon. The symbols are presented first, beginning on the next page.
Comparison Symbols
< (less than)
<=
(less than
or equal to)
(equals)
Assignment
Operator
6-3
Volume
DQL LEXICON
(cont.)
See Also: +,
Keyword:
/(division)
Type:
Arithmetic Symbol
Purpose: The
The
Syntax:
Returns:
symbol
Example:
to divide
Value
by Value
2.
VALUE
DataBase
tells
VALUE
numeric value.
When
monthly rent
:=
annual rent
10
12
12,
and after
the
division
svmhol.
Q
Keyword:
* (multiplication)
Type:
Arithmetic Symbol
Purpose: The
Value
Syntax:
Returns:
Example:
6-5
symbol
2.
value
The
*
tells
result
value
is
by
See Also: +,
-, /
numeric value.
wages
:=
hourly wage
Volume
DQL LEXICON
Symbols
(cont.)
Q
Keyword:
* (wildcard)
Type:
Purpose: The
for
string.
It
unspecified
number of
characters
in
an alphanumeric
in a string to
show
that an
omitted.
in
selection context.
Example
for
CUSTOMERS
with last
records
LAST NAME in order
name =
"
*son"
list
end
This query tells DataBase: List the records for customers whose last name
ends with the letters son. The report output for this query, arranged in
alphabetical order by LAST name, might look as follows:
LAST NAME
Anderson
Bateson
Davidson
Hanson
Robertson
Example
2: for
CUSTOMERS
with last
records
last name in order
name =
"'s?n"
list
end
DataBase: List the customers whose last name ends with
and /;. with an unknown value between them. The report
output for this query might look as follows:
This query
tells
the letters s
Andersen
Anderson
Bateson
Davidson
Hansen
Hanson
Robertson
Volume
6-6
(cont.)
See Also:
Keyword:
? (wildcarci)
Type:
Purpose: The
unspecified character
in
is
used
an alphanumeric
string.
It
one
can,
Example
1: for
in
CUSTOMERS
with last
records
LAST NAME in order
FIRST NAME
name
= "Anders?n"
list
end
DataBase: List the records for customers named Andersen
lists customers named Andersan. Andersin. or
Andersitn, if any exist). The output for this query, arranged in
alphabetical orcler by LAST NAME, might look as follows:
This query
or
tells
Anderson
(it
LAST NAME
also
*,
DQL LEXICON
Symbols
(cont.)
See Also:
Keyword:
- (tilde)
Type:
character
is
^.
it
locates
all
the records
making
used
See Volume
Example:
for
1.
Chapter
CUSTOMERS
list
2.
Record Entry,
with LAST
NAME =
for
?).
more information.
-Foster"
records
LAST NAME
FIRST
NAME
in
order
end
This quer\- tells DataEase: List the records for customers whose
sounds like Foster. The report output for this query, arranged in
alphabetical order by LAST NAME, might look as follows:
LAST NAME
last
name
*.
(cont.)
Keyword:
Type:
Punctuation Symbol
(colon)
Purpose: A colon
is
statistical
inserted
operators
report output.
Syntax:
VALUE
Example:
for
statistical
operators
CUSTOMERS
list
records
item
sum
end
This query tells DataBase: List the CUSTOMERS records showing each
customer's LAST NAME, ACCOUNT BALANCE, and the total of all the
ACCOUNT BALANCE values at the end of the report. The report output for
this query, artanged in alphabetical order by LAST NAME, might look as
follows:
LAST NAME
Adams
ACCOUNT BALANCE
Statistical Operators).
DQL LEXICON
Symbols
(cont.)
a
Keyword:
Type:
Punctuation Symbol
...
(parentheses)
Purpose: Parentheses
and
is
especially important
Example:
for
CUSTOMERS
records
LAST NAME in order
list
ACCOUNT BALANCE
STATE
end
With
the parentheses as
shown,
this
New York
or
query
New
tells
DataBase
Jersey whose
to
list all
ACCOUNT
BALANCE is greater than 500. The report output from this query,
arranged alphabetically by LAST NAME, might look as follows:
LAST NAME
Adams
ACCOUNT BALANCE
STATE
the
(cont.)
D
Keyword:
Type:
See Also:
(period)
(semicolon)
Punctuation Symbol
Purpose: A
may
or
may
not be
Any
1.
Any
2.
3.
you must
DQL
Control
command.
In a
and
after
The
last
each action
item
in
in a
case,
if,
or while
for
CUSTOMERS
command
command.
list
Example:
command.
records
LAST NAME in order
list
ACCOUNT BALANCE
STATE
end
This query
tells
LAST NAME
DQL LEXICON
Symbols
(cont.)
0]
See Also:
Keyword:
Type:
Punctuation Symbol
Purpose:
semicolon
is
The semicolon
always used
in a
after a for
query action.
command
that
and
after
command.
Syntax:
Example:
for
CUSTOMERS
with
records
LAST NAME in Order
list
ACCOUNT BALANCE
STATE
end
LAST NAME
Adams
(period)
(semicolon)
as follows;
ACCOUNT BALANCE
STATE
Symbols
.A
.Ji
S E
REFERENCE
Type:
Punctuation Symbol
(quotation marks)
command and
define
when
IS first
It
to
to
enclose the
name of
a variable in a
"TEXT
CONSTANT
define
named
with
for
CUSTOMERS
list
with state
"NY"
records;
STATE
name
operator.
'
sum
end
This query tells DataEase: For customers who live in New York,
list each customer's last n,ame. accolnt b.al.ance, and state.
The report output, arranged in alphabetical order by LAST NA.ME,
miaht look as follows:
LAST NAME
.A
\ t AL
"..."
Example:
(cont.)
Keyword:
Syntax:
.'^
named
DQL LEXICON
Symbols
S
Keyword:
:=
Type:
Operator Symbol
operator symbol
of a variable or field
fieldname
Syntax:
address
:=
is
is
alue
assigned or modified.
assigned value
VARIABLE NAME
Example
(Assignment Operator)
:=
ASSIGNED VALUE
data-entry
address
Example
2:
:=
Volumes
6-14
DATA
Symbols
ASF.
R E F
R E N C E
F.
MAN
L:
AL
(cont.)
a
AIsd: <=, =, >, >=
between, not
.Sec
Keyword:
Type:
(less than)
another.
is les.s
Syntax:
Example:
symbol
is
used
to
left
of the
to
s\ inbol
value
for
It
<
value
CUSTOMERS
with
This query statement selects CUSTOMERS records that have a value less
than 500 in the ACCOUNT BALANCE field.
Keyword: <=
Type:
(less than or
equal
to)
value to another.
symbol
is
It
symbol
is
>,
>=
symbol.
Syntax:
Example:
value
for
<= value 2
CUSTOMERS
witfi
ACCOUNT balance
6-15
500
a
value less
Volume
DQL LEXICON
Symbols
(cont.)
B
Keyword: =
(equals)
Type:
Purpose: The -
(equals)
another.
It
symbol
is
to
symbol
is
VALUE
Syntax:
Example:
for
VALUE 2
CUSTOMERS
with
B
Keyword: >
Type:
(greater than)
(greater than)
another.
It
symbol
is
used
to
VALUE
Syntax:
Example:
for
>
VALUE
CUSTOMERS
with
Volume
6-16
DATABASE REFERENCE
DQL LEXICON
abs
Keyword: abs
(absolute value)
See Also:
Type:
Math Function
ceil, floor,
mod,
random
Syntax:
abs(NUMERIC VALUE)
Returns:
Usage:
numeric value.
a
numeric value.
0.
Examples: abs(-453)
Returns:
453
abs(4.53)
Returns: 4.53
Volume
6-18
acos (arccosine)
Type:
Trigonometric Function
between
and
7t.
acos(NUMERIC VALUE)
Returns:
Usage:
The
numeric value.
valid range of the input value
value
unless
Example:
is
it
it
may
is -1
to
1.
If the input
acos(0.5)
Returns: 1,047195755
acos(-0.8)
Returns: 2.49809154
6-19
Volume
DQL LEXICON
Ad-hoc Relationship
Keyword: Ad-hoc
Relationship
any, count of,
lowest of, mean of,
named. Relationships
See Also:
Type:
Concept
highest
sum
Purpose: Like
a predefined relationship, an
relationship between
relationship
two
ad-hoc relationship
is
of,
all,
of,
an ad-hoc
is
An
Definition process.
ad-hoc relationship
lets
Form
you
easily
However, because
An
it
ad-hoc relationship
must be redefined
is
When you
is
used
each procedure.
in
name
name of an
of a predefined relationship to
named
operator
Syntax
[FIELDNAME]
Usage:
Once an ad-hoc
relationship
is
of the query.
using the
named
-^
Volume
operator.
6-20
for
(cont.)
CUSTOMERS
list
with
records
LAST NAME
sum
of
in
order
INVOICES named
"MAY" with
#
)
end
As
there
is
INVOICES
based on the
sum
of
customer
CUSTOMERS
and
INVOICES named
"MAY" with
#
)
DATE
selection
This query tells DataEase: 1) Select all the CUSTOMERS records that
have a account balance greater than $500. 2) Find all these customers'
invoices in the related INVOICES form that are dated during May 1989.
3) For each record selected from the CUSTOMERS form, list the
customer's last name and the sum of that customer's May invoices.
Note
that if
JUNE
we
invoices,
also
want DataEase
we have
to
to create a
CUSTOMERS
with
records
LAST name in order
list
sum
of
INVOICES named
"MAY" with
ORDER TOTAL
of INVOICES named
#
)
sum
"JUNE" with
ORDER TOTAL
#
)
end
6-21
Volume
DQL LEXICON
all
Keyword:
all
Type:
Relational Operator
Purpose: The
all
in a related
form
that
Syntax:
Returns:
all
The
form.
specified field.
For example,
Usage:
The
all
items
if
is
the
same
in a list
records command.
etc.).
CUSTOMERS
list
cannot be used
It
all
level
(i.e.,
See Example
with
to specify
2.
records
LAST name
all
fields,
is text.
for
as that of the
Examplel:
in
groups
INVOICES INVOICE #
INVOICES ORDER total
;
end
This query tells DataEase: 1) Select all the CUSTOMERS records that
have an ACCOUNT balance greater than $500. 2) Find all these
customers' invoices in the related INVOICES form. 3) For each record
selected from the INVOICES form, list the invoice # and the ORDER
total. The output from this query, arranged in groups by LAST NAME
(from the CUSTOMERS form), miaht look as follows:
LAST NAME
The
(cont.)
all
operator
lets
you
retrieve information
To demonstrate
relationship level.
Exampie2:
CUSTOMERS
for
list
this,
with
records
LAST NAME
all
in
groups
INVOICES INVOICE #
INVOICES ORDER TOTAL
INVOICES all RETURNS refund total
;
all
end
This query tells DataEase: 1) Select all the CUSTOMERS records that
have an ACCOUNT balance greater than $500. 2) Find all these
customers' invoices in the related INVOICES form. 3) For each record
selected from the INVOICES form, list the invoice # and the order
TOTAL. 4) For each invoice, find the related record in the RETURNS form
(i.e., the record with the same INVOICE
#) and list the REFUND TOTAL.
CUSTOMERS
LAST NAME
Adams
Cooper
Evans
this
NAME
all
ivers
(from the
same
relationship level.
DQL LEXICON
ampm
Keyword: ampm
Type:
Time Function
Purpose: The
ampm
Syntax:
AM
(HH:MM:SS) and
(before noon), or
PM
ampm(TIME VALUE)
AM or PM).
Returns:
Usage:
Examples: ampm(08:15:25)
Returns:
AM
ampm(1 5:30:50)
Returns:
Volume
PM
6-24
See Also:
between,
Logical Operator
<=,
not
=,
>,
>=
SELECTION CRITERIA
Returns:
<
or,
The values
in
statements.
Usage:
When
processed.
Examples:
and and or
operators
enclosed
for
in
in
This statement
that contain
tells
NY
in the
ACCOUNT BALANCE
processed.
for
or
STATE = "NJ")
This statement
tells
500
in
the
6-25
NY
NJ in the STATE
ACCOUNT BALANCE field.
or
field
CUSTOMERS
and
records
Volume
DQL LEXICON
any
Keyword: any
Type:
See Also:
Relational Operator
in a related
form
all
that
Syntax:
Returns:
any
The
specified value
related form.
of the specified
Usage:
from
the//;-i7
matching record
is
in the
same
the
as that
field.
to:
1.
2.
Specify selection
relationship level
etc.).
for
(i.e..
See Primary
INVOICES
with
records command.
criteria.
3.
Example:
in a list
Form
for details
on relationship
records
INVOICE # in order
levels.
list
ORDER TOTAL
any
end
CUSTOMERS
last name
This query tells DataBase: 1) Select all the INVOICES records that have
an ORDER TOTAL greater than 500. 2) For each record selected from the
INVOICES form, list the invoice # and the ORDER TOTAL. 3) For each
record selected from the INVOICES form, find the first (and only the
first) related record in the CUSTOMERS form. 4) For each record
selected from the CUSTOMERS form, list the customer's LAST NAME.
The output from this query, arranged in order by INVOICE #, might look as
follows:
INVOICE*
A1 17095
ORDER TOTAL
LAST NAME
asin (arcsine)
Type:
Trigonometric Function
Purpose: The
The
is
an angle expressed
in
nil.
Syntax:
asin(NUMERIC VALUE)
Returns:
Usage:
The
numeric value.
valid range of the input value
value
unless
Example:
Z2
is
it
it
is -1
may cause
to
1.
If the input
asin(l)
Returns:
1.570796
asin(-0.50)
Returns
-0.5235988
6-27
Volume
DQL LEXICON
assign
See Also: define, global, temp
Keyword:
assign
Type:
Procedural
Command
or global variable.
is
variable
is
processing of a procedure.
By
the stored value can be used like any other value in a query.
to another.
To
its
value
Syntax:
each procedure.
assign global
temp VARIABLE
Usage:
is
NAME
:=
ASSIGNED VALUE
followed by:
A period.
Example:
define
for
INVOICES
with
ORDER TOTAL
:=
ORDER TOTAL
temp DISCOUNT
end
This query
tells
DISCOUNT to
DataEase:
store a
1)
the
TOTAL
INVOICES
field. 3)
Give (assign)
DISCOUNT variable
Volume
in the
ORDER total
field.
6-28
Keyword: atan
Type:
(arctangent)
Trigonometric Function
Syntax:
Returns:
7t/2.
atan(NUMERIC VALUE)
numeric value.
Examples: atan(500.3)
Returns
.56879753
atan(-359.4)
Returns
6-29
-1.5680139
Volume
DQL LEXICON
atan2
Keyword: atan2
Type:
(arctangent 2)
Trigonometric Function
divided by Value
2.
The
result
is
an angle expressed in
radians between -n to n.
Syntax:
atan2(NUMERIC VALUE
Returns:
1,
NUMERIC VALUE
2)
numeric value.
Examples: atan2(3,127)
Returns
0.02361766
:
atan2(1,
Returns
Volume
1)
:
0.7854
6-30
database)
reorganize, restore db
Type:
Control
Command
When
processing reaches a
creates a
backup db
you want
to
procedure.
Syntax:
Usage:
backup db
backup db command,
DataEase restore db
command
or Maintenance
restore a database,
last
all
menu
the
option.
permanently erased.
LAN:
On
LAN
if
another user
is
currently
backup db command,
message
the
is
command
at brief intervals.
procedure during
When
this
this time,
you want
If
becomes
to abort the
the computer.
available,
DataEase
procedure.
for
See Volume
2,
Chapter
4,
System Administration
conflicts
and Multi-User
Locking Options.
Example:
backup db
6-31
Volume
DQL LEXICON
between
See Also: <=, <, =, >, >=,
not
Keyword: between
Type:
Comparison Operator
operator
is
Value
Returns:
Example:
for
which
CUSTOMERS
499
Volume
the
to
is
VALUE
comparison
with
is
true.
CUSTOMERS
and
to
between
2.
Syntax:
falls
It
in the
account balance
field.
6-32
Keyword: blank
Type:
Keyword
is
used to assign a
/;////
value to a field or
variable.
Syntax:
blank
Usage:
null value
is
included
in
on a
in the calculation.
generating
field,
Zero
blank values
field values
When
are not
are included
statistics.
compared
to
Examples:
for
CUSTOMERS
with
delete records
end
This query tells DataBase: Delete the CUSTOMERS records that have a
blank value in the account balance field. It might be used to delete
inactive
6-33
CUSTOMERS
records.
Volume
DQL LEXICON
break
Keyword: break
See Also: exit
Type:
Procedural
Command
is
command and
procedure.
When
command, DataBase
ith
Syntax:
It
resumes
menu
menu
Keyword:
call
Type:
Control
Command
menu command
Purpose: The
call
Syntax:
call
menu command,
menu name should he
hi a call
enclosed
Usage:
The
call
menu command
can be used
to display either a
at
unless
any point
in the
the
menu
is
make
selections
from
quotation marks
specified as a
When
in
it is
the
it
the
menu was
created.
When
the
a chain
menu
is
menu
called,
is
it
is
not displayed.
UTILITIES
(Utilities
menu
Menu Definition.
menu)
menu)
ADMINISTRATION
When
titles:
function
(Administration menu)
is
menu command.
Example:
call
menu "MAINTENANCE"
6-35
Volume
DQL LEXICON
call
program
Keyword:
call
Type:
Control
program
See Also: call menu
Command
program command runs
Purpose: The
call
Syntax:
program
call
the specified
DOS
program.
".
In a call program
the
Usage:
The
call
program
The
program command
at
used to
is
call
command must
program. The
is
command,
program name and
is
specified.
if
it
is
current directory.
1)
or an expression involving
When
the called
The command
optional arguments.
2).
program command.
CAUTION: Do
NOTE: DataEase
can he swapped
enough
EMS memory
program and
DataEase
to either
memory for
E.xpanded
Memoiy (EMS)
If
DataEase automatically
e.xpanded memory.
is
available,
memory requirement
PROGCALL.DAT
edit with
file.
This
any ASCII
is
an ASCII text
file
text editor.
to call
from DataEase:
PROGNAME
-^
Volume
bytes
6-36
program
(cont.)
PROGNAME
name of
the
is
the
with no parameters.
Parameters
program command,
but not
in
insert a space
followed by a
(e.g.,
384K
is
entered as 384000).
If you do not have EMS. you must add this information for
each program you want to call from within DataEase. If you
don't have sufficient EMS. a call will not be executed unless
the
program information
file.
To
ensure that
is
included
all calls
in the
are executed,
PROGCALL.DAT
we recommend
that
you add any programs you intend to call to this file, even if
you think you have enough EMS to make swapping to disk
unnecessary.
When DataEase
is
shipped the
COMMAND)
Example:
each of which
run procedure
call
PROGCALL.DAT
file
(CONVERT, GRAFTALK,
is
The
and
assigned 360K.
"MONTHLY SALES"
previous
sales.
run procedure
call
program
"MONTHLY SALES"
jointext
PROGCALL.DAT file
(PROG, CHART)
This query does exactly the same thing as the simpler one above, but
shows the proper use of an expression as an argument for the call
program command.
NOTE:
6-37
Volume
DQL LEXICON
case
Keyword:
case
Type:
Procedural
while
Command
It tells
ifs.
to a series of values
DataEase
to
compare an expression
When
compares
is
true.
command, DataEase
comparison
If the first
DataEase executes
is true,
all
the
comparison
compared
to the next
is
is
is
compared
As soon
to
end command
If
first
true,
DataEase
others keyword
is
specified actions,
Syntax:
If the
it
case (EXPRESSION)
value
COMPARISON
ACTION SERIES
[value
COMPARISON
1.
ACTION SERIES 2]
[value
COMPARISON N
ACTION SERIES N]
[others
OTHERS ACTION
SERIES.]
end
-^
Volume
6-38
(cont.)
Usage:
others
is
used,
it
keyword
last
field, a variable, or
are optional.
value statement.
in parentheses.
It
can
false).
An
command
including another
command must
first
while, or case
if,
end command
When
case
commands
matched with
applies to
for,
Example:
if,
all
end corresponds
to
a corresponding
nested Procedural
commands
rule
(including case,
and while).
"FRANK"
menu "ADMINISTRATION"
value "TOM"
call menu "UPDATE"
value "CAROL"
value
call
record entry
"CUSTOMERS"
end
This query tells DataEase: If the current user is Frank, display the
Administration menu. If the current user is Tom. display the Update
menu.
user
is
If
is
If the
current
CUSTOMERS
6-39
Volume
DQL
LEXICON
ceil
Keyword:
ceil
Type:
Math Function
random
Purpose: The
ceil function
to the next
integer.
Syntax:
ceil(NUMERIC VALUE)
Returns:
Examples:
An
integer value.
ceil(5.000)
Returns:
ceil(5.001)
Returns;
Volume
6-40
B
Keyword:
--
Type:
Symbol
(comments)
to
a query
in
Edit Mode.
Syntax:
Usage:
-COMMENT TEXT
Comments can
DataBase
treats
symbol and
To
continue a
dash symbol
Example:
the
for
Edit
Mode.
end of the
line as part
comment on more
at the
with
of the comment.
than one
beginning of each
CUSTOMERS
list
in
line,
line.
records
LAST name
ACCOUNT BALANCE
end -- THIS QUERY LISTS THE VOLUME BUYERS.
-IT SHOULD BE UPDATED ON THE TENTH DAY
-OF EACH MONTH.
;
NOTE: Comments
6-41
Volume
DQL LEXICON
Comparison Operators
Keyword: Comparison Operators
Type:
<, =, >,
>=,
Operator
are used to
criteria,
The
DQL
The value on
The value on
on the right
comparison
is
side.
comparison
is
<=
The value on
to the value
>=
The value on
to the value
between
The value
on the
on the
lies
is
less than or
equal
right side.
is
right side.
(inclusive).
not
immediately follows
Examples:
for
CUSTOMERS
with
for
INVOICES
to
Volume
01/31/89
it.
with date
between 01/01/89
6-42
Keyword: Conditional
Operators
Statistical
Type:
Operator
Purpose:
The
DQL
item
returns a
YES
comparison
count
returns the
is
or
NO
answer indicating
if
the
true or false.
number of
percent
the total
multiplied by 100).
at the
Usage:
level.
item that
list
operator
is
is
compared
Operator
is
inserted
to a specified value.
The
->
6-43
group
Volume
DQL LEXICON
Conditional Statistical Operators (cont.)
Example:
for
CUSTOMERS
records
LAST NAME in order
list
ACCOUNT BALANCE
ACCOUNT BALANCE > 500
;
end
This query tells DataEase: 1) Process all the CUSTOMERS records.
2) List each customer's LAST name and ACCOUNT balance. 3) For each
customer, display a YES or NO answer indicating if the customer's
ACCOUNT BALANCE is greater than 500. 4) Display the total number of
customers whose ACCOUNT balance is greater than $500.
5) Display the number of customers that have an ACCOUNT BALANCE
greater than 500 as a percentage of all the customers.
LAST
in alphabetical
order by LAST
name
Concept
Purpose:
constant value
procedure
is
in selection criteria
text
comparisons,
and numeric
expressions.
Usage:
type
is
allowed.
its
are the
number, numeric
value
same
as
string, date,
The format
-Do
-Do
Example:
for
as follows:
constants (01/01/89).
constants (09:30:00).
commas
CUSTOMERS
and
ZIP
in
In this
Number
with last
> 90000
90000
6-45
in
is
last
constants.
name = "SPENCER"
the zip
code
Volume
3
I
DQL LEXICON
Control Procedure
Concept
is
that lets
you
many
Procedural commands.
Control procedure
itself.
Note
command
also, that a
in the
Control procedure
itself
For a
full
individual
Example:
run procedure
etc.
commands and
if
command
Commands
operations
Usage:
Control
shown on DataBase
Record Entry, Run Procedure, Backup
DQL commands,
see the
call
menu
call
program
record entry
import
reorganize
db status
backup db
restore db
lock db
unlock db
install application
menu
"UTILITIES".
run procedure
else
call
"MAILING LIST"
menu "MAIN"
end
This Control procedure tells DataBase: If the current user is Paul,
1) Display the Utilities menu. 2) Run the procedure that generates an
up-to-date mailing list. 3) If the current user is not Paul, display the Main
Menu.
Volume
6-46
from
all
Keyword: copy
Type:
ail
from
Processing
Command
all
from command
Command menu
because
it
is
in identically
High Level
Syntax:
Usage:
copy
all
from
FORMNAME
to
data-entry
named
CUSTOMERS.
field in the
Source form.
CATALOG
who
CUSTOMERS
with
This query tells DataEase: 1) Select all the CUSTOMERS records that
have any related INVOICE record with an ORDER TOTAL greater than
$500. 21 For each CUSTOMERS record selected, enter a record in the
CATALOG CUSTOMERS form and copy all the information frotii the
source CUSTOMERS record into the target CATALOG CUSTOMERS
record, based on matching field names.
b-Al
Volume
DQL LEXICON
COS
Keyword:
cos (cosine)
Type:
Trigonometric Function
in radians.
Syntax:
-1
and
1.
cos(NUMERIC VALUE)
Returns:
numeric value.
Examples: cos(3.1415928)
Returns:
cos(-22)
Returns:
Volume
-1
.9271838
6-48
cosh
Keyword: cosh
Type:
(hyperbolic cosine)
Trigonometric Function
Syntax:
Returns:
cosh(NUMERIC VALUE)
numeric value.
Examples: cosh(2.34)
Returns: 5.23878166
C0Sh(-5.4)
Returns: 110.70547
6-49
Volume 3
LEXICON
DQL
count
Keyword: count
Type:
of, item,
number of records
in the
form
Syntax:
Usage:
CONDITION
To count
that
is
Example
is
count [other
statistical
operators]
shown
1: for
all
summary
in
Example
CUSTOMERS
2.
records
LAST NAME in order
list
ACCOUNT BALANCE
ACCOUNT BALANCE > 500
;
COunt
end
This query tells DataBase: 1) List the CUSTOMERS records showing
each customer's last name and account balance. 2) Count the
number of customers who have an ACCOUNT BALANCE greater than $500.
The output from this query might look as follows:
LAST NAME
Keyword: count
Type:
of
See Also:
highest
list
statistic in the
Syntax:
all,
any, count,
lowest
of,
mean
of sum of named
how many
operator counts
of,
records in a related
criteria.
The
result
can
summary
area
at the
end of a
report.
of FORMNAME
RELATIONSHIP [named "UNIQUE
RELATIONSHIP NAME"] [with (selection criteria)]
count
Example:
for
CUSTOMERS
list
There's an important
records
end
This query tells DataBase: 1) Process all the CUSTOMERS records.
2) List each customer's last name, and account balance. 3) For each
customer, display a YES or NO answer indicating if the customer's
ACCOUNT BALANCE is greater than 500. 4) Count the total number of
customers whose ACCOUNT BALANCE is greater than $500 and display this
total as a statistic at the end of the report output (this is generated by the
count operator). 5) Count the number of related INVOICES records that
have an ORDER TOTAL greater than $100, and display this number as a list
item for each customer (this is generated by the count of operator). The
output from this query might look as follows:
LAST
count
of.
number of records
that satisfy
DQL LEXICON
current
Keyword: current
input,
temp
Keyword
Type:
lets
current page
number
number
for
number
current item
returns the
number of the
current record by
numeric value).
name
current user
returns the
name used
(a text value).
numeric
Network
(a
to 7).
when
(a text value).
when
The value
Key Pressed
Action
ESC
EXIT
F2
F8
F7
SAVE
MODIFY
DELETE
is
shown below:
Value Returned
1
2
3
Volume
6-52
Syntax:
Example:
current variable
for
CUSTOMERS
list
name
ACCOUNT BALANCE
with
> 500
records
current date
current page number
current user name
;
end
This query tells DataBase: 1) Select the CUSTOMERS records that have
an ACCOUNT BALANCE value greater than 500. 2) List the LAST NAME
and ACCOUNT balance values from each record that is processed. 3) List
the current date (today's date), the current page number, and the
current user name (the name of the user who generated the report).
this
PAGE: 1
USER: GEORGE McGRAfH""DATE:l)l720/89
=====================================================
=================================================___
LAST NAME
ACCOUNT BALANCE
'^f^
Adams
generated by DataBase.
Cooper
Evans
Hill
'vers
6-53
$595.00
$725^00
$865.00
$525.00
$675.00
lines at
the top of this output are part
Volume
DQL LEXICON
data-entry
Keyword:
data-entry
Type:
Keyword
form as the
Syntax:
data-entry
Usage:
FIELDNAME
form name
is
used as the
if
a Data-entry
form has
Mode,
DataBase offers
if
a Data-Entry
menu
of
all
on the form
Example:
for
CUSTOMERS
CUSTOMER
with
customer
= data-entry
modify records
all from data-entry
copy
address
end
:=
data-entry
new address
This query might be used to post address changes into the CUSTOMERS
form. It tells DataBase: 1) Find the CUSTOMERS record that has the
CUSTOMERS
is
Volume
6-54
date
Keyword:
date
Type:
Date Function
yearweek
numeric values.
Syntax:
where
the
MONTH
is
the
number of
month
the
YEAR
(1-12),
the last
is
two
DAY
is
digits of
year.
Returns:
Usage:
If
is
the
MMfDDfYY.
invalid (e.g.,
is
DataBase calculates
month >
12 or day
>
31),
example, 6,45,89
are automatically
truncated.
Examplel: date(7,1,89)
Returns
Example
2:
07/01/89
TODAY
first
and
The
last
07/01/89;
NOTE:
to find the
LASTDAY
= 07/31/89. This
routine
is:
is
FIRSTDAY =
accurate for any date.
If your
6-55
Volume
DQL LEXICON
day
Keyword: day
Type:
Date Function
spellmonth, spellweekday,
month
(1- 31)
from a
year, yearday,
yearweek
date value.
Syntax:
day(DATE VALUE)
Returns:
An
day(31/12/89)
Returns: 31 (European format)
day(89/12/31)
Returns: 31 (Metric format)
NOTE:
In
Form
Definition,
Chapter
Volume
2.
Form
2.
Definition.
6-56
db
Type:
Control
Purpose: The db
Command
status
command
When
processing reaches a
db
status
command, DataBase
It
then displays a
The
The
The
one or
in the database.
J on
Database Maintenance
menu. For more information,
see Vohmie 1 Chapter 4.
Database Maintenance.
I
the
DOS
in
each form.
each form.
DOS
->
6-57
in
Volume
DQL LEXICON
db status
Syntax:
(cont.)
db status
To
Usage:
print the
db
SH-F9 PRINT
key.
On
LAN:
LAN
if
DataBase displays
message
the
is
is
currently
this
command
at brief intervals.
procedure during
When
another user
db status command.
this lime,
you want
If
to abort the
becomes
available.
DataEase
procedure. See
for
Locking Options.
Example:
Volume
6-58
Keyword:
define
Type:
Procedural
Command
variable
is
is
processing of a procedure.
By
the stored value can be used like any other value in a query.
one procedure
to another, a variable
To
its
must be defined
Syntax:
Usage:
define global
is
followed by:
-The
A period.
pjeriod
requires a concluding
not a semicolon.
NOTE:
characters long.
The
specify a length
in the
variables
default length
define
is
used
if
are 8
you do not
command.
6-59
Number
Volume
DQL LEXICON
define (cont.)
Example:
define
for
INVOICES
witti
ORDER total
:=
ORDER TOTAL
temp DISCOUNT
end
This query
tells
DISCOUNT to
all
the
DataEase:
store a
INVOICES
1)
TOTAL
Volume
6-60
Keyword:
delete records
See Also:
lisl
records, modify
records
Type:
Processing
Purpose: The
Command
delete records
command
form.
Syntax:
delete records
in
FORMNAME RELATIONSHIP
|
RELATIONSHIP NAME"]
When you
Usage:
is
Example
command
[named "UNIQUE
Example
(see
is
keyword
in
1).
CUSTOMERS
1: for
INVOICES date
with (highest of
delete records
01/01/80)
end
This query deletes records
1st,
When you
in the
Primary form
INVOICES
(CUSTOMERS) whose
form)
is
dated prior to
1980.
keyword
see
delete records in a
in
Example
Example
2).
2: for
CUSTOMERS
form
form
form
is reorganized. If
records cne frequently added
and deleted, reorganizing the
form will increase efficiency.
This query deletes records in the related (INVOICES) form that are dated
prior to January 1st, 1980. The named operator is used to assign a unique
relationship name to the group of outdated records in the related form.
Note
that
when you
relationship,
you
forfeit
tell
forms are
related.
CUSTOMER
6-61
By
#) in the
Volume
DQL LEXICON
do
See Also: while
Keyword: do
Keyword
Type:
is
component of
the while
command
syntax.
When
If the specified
condition
is
true.
The keyword do
command, DataEase
keyword while.
DataEase executes
all
the
original condition.
If the
condition
command
Syntax:
while
first
is still true.
If the
is
Mode.
the
DataEase
condition
h false.
end
CONDITION do
ACTION
ACTION 2
1
ACTION N
end
Example:
define
assign
while
list
records
SERIAL.
tells
2)
DataEase:
1)
Give (assign) an
is
labels,
5)
value of
words
SERIAL
to the
SERIAL
SYSTEM DISK
variable. 4)
variable.
to the
While printing
number
the
When
Volume
6-62
Keyword:
else
Type:
Procedural
Purpose: The
See Also:
else
The
if
if
Command
Command
keyword
command
is
component of
command
syntax.
When
true or false.
the if
processing reaches an
if
If the specified
DataBase executes
condition
is
true.
keyword then
\s
false.
until
is
command,
keyword
all
if
the
processing
command.
DataBase executes
all
If the
the actions
Syntax:
if
CONDITION
then
[ACTION
ACTION
ACTION N]
[else
ACTION
ACTION
ACTION
N.
end
Example:
for
CUSTOMERS
end
end
This query
tells
DataBase:
1)
For each
CUSTOMBRS
in the related
INVOICBS
form.
2) If the
most
is
which records
to delete.
command
6-63
from
the
Volume
DQL LEXICON
end
See Also: break, case,
if, and while
Keyword: end
exit,
for,
Type:
Procedural
Command
the
Syntax:
ACTION
ACTION
ACTION
N.
commands.
end
An end command
Usage:
is
When
multiple procedural
processing.
procedural
if,
commands
in the
Example
for
(see
query.
Example
CUSTOMERS
records
LAST NAME
is
critical to correct
refers to the
most recent
end command
command.
end commands
command
or while
it
reaches
its
matching
2).
list
ACCOUNT BALANCE
end
This query tells DataEase: Process all the CUSTOMERS records and list
each customer's LAST NAME and ACCOUNT BALANCE in the report output.
Volume
6-64
(cont.)
Example
2: for
CUSTOMERS
end
if
end
end
This query
tells
INVOICES
form. 2)
If the
most
recent invoice
record. 3) If
CUSTOMERS
in the related
is
1980. delete
1980. 4) For
all
all
which records
command
The
if
third
command
first
to
that selects
end marks
the
in the
query, there
is
a corresponding
NOTE:
6-65
Volume
DQL LEXICON
enter a record
Keyword:
enter a record
all from,
Type:
Processing
Command
form.
Syntax:
enter a record
in
FORMNAME
Usage:
you
copy
from command
all
entered
in the
(see
field data
Example
2,
below).
is
As data
is
performed,
Any
etc.
Example
1: for
CUSTOMERS
with
enter a record
in
file.
CATALOG CUSTOMERS
This query
have an
tells
DataBase:
ACCOUNT balance
CUSTOMERS
CUSTOMERS
CUSTOMERS
CUSTOMERS
CUSTOMERS
records that
2) For each
CATALOG
form
CATALOG
form.
Example
Example
2.
Example
2: for
CUSTOMERS
with
enter a record
in
copy
end
Volume
all
from
CATALOG CUSTOMERS
CUSTOMERS
6-66
Keyword:
exit
Type:
Procedural
Purpose: The
Syntax:
Command
exit
command
exit
command can
is
used
to
exit
Usage:
The
is
be used anywhere
Example:
in a
query.
When
it
for
menu
or procedure.
CUSTOMERS
records
list
if
exit
end
end
This query
tells
ACCOUNT BALANCE
the query.
Note
values.
that
When
BALANCE
field,
LAST NAME
this
processed, terminate
is
command
DQL
terminates processing.
ACCOUNT
DQL LEXICON
Keyword:
firstc
Type:
Purpose: The
(n)
Syntax:
Text Function
firstc function extracts a specified
firstc(TEXT
VALUE,
(left)
Usage:
Examples:
characters
n)
Returns:
text string
number of
of a text value.
n characters in length.
in the
firstcC'DataEase International,
Returns; DataEase
count of characters
(n).
Inc.", 8)
firstcC'New User", 4)
Returns: New
firStC(LAST NAME, 4)
Returns: The first four characters in the last name
field for every record that is processed. If a record
contains the value Holmes in the last name field,
the function returns Holm.
6-69
Volume
DQL LEXICON
firstlast
Keyword:
firstlast
Type:
Text Function
Purpose: The
Name
Syntax:
firstlast(TEXT
Returns:
Usage:
This function
from
is
an optional middle
the format:
Name [MJ
initial (or
name).
VALUE)
text value.
Examples:
firstlast("Anthony,
Returns:
Susan
B.
Susan
B.")
Anthony
firstlastC'Eliot, T.S.")
Volume
6-70
Keyword:
firstw
Type:
Purpose: The
from
Syntax:
Text Function
firstw function extracts a specified
number of words
firstw(TEXT
VALUE,
n)
Returns:
Usage:
text value
n words
in length.
n words
in the field,
Leading spaces
words
in the field,
If there
text value.
2)
1)
New
firstW(BOOK TITLE, 2)
Returns the first two words in the book title field for
every record that is processed. If a record contains
the value The Hound of the Baskervilles in the book
title
6-71
field,
The Hound.
Volume
Keyword:
for
Type:
Processing
Purpose: The
for
Command
command
specifies the
Usage:
is
always the
first
word
in a
Low
Level
//;
query.
A Low
command which
1).
to
move
position).
select records
In a
Mode,
to alte
and Fl
Mode.
F9 (High
Level),
to return to Interactive
the sequence of
for
command
is
corresponding end
the
command
command and
its
Syntax:
Note:
for
6-73
Volume
DQL LEXICON
for (cont.)
Example
Low
Level Query
Using for
for
Command
CUSTOMERS
to
with
records
LAST NAME in order
list
ACCOUNT BALANCE
end
This query tells DataBase: 1) Select the CUSTOMERS records that have a
value greater than $500 in the ACCOUNT BALANCE field. 2) For each
selected record, list the customer's LAST name and ACCOUNT balance.
LAST NAME
Adams
this
query, arranged
in
alphabetical order by
like this:
ACCOUNT BALANCE
LAST NAME.
field.
3) Select
list
the
all
the
invoice
INVOICES
#
list
records.
the customer's
4) For each
last name.
INVOICES
record,
LAST NAME
INVOICE #
DQL LEXICON
for (cont.)
Example
3:
CUSTOMERS
for
with
INVOICES
list
records
CUSTOMERS
invoice #
in
LAST NAME
order
ORDER TOTAL
in
groups
end
end
In this query, the second for
command, which
is
INVOICES form
its
end
for
first,
and performs
all
the
This query tells DataBase: 1) Select the CUSTOMERS records that have
a value greater than S500 in the ACCOUNT balance field. 2) Find all the
related INVOICES records for each CUSTOMERS record selected in
Step 1. 3) For each selected CUSTOMERS record, list the customer's
LAST NAME 4) For each selected INVOICES record, list the INVOICE #
.
this query,
LAST NAME
arranged
in
alphabetical order by
LAST NAME,
List of
Keyword: Functions
Type:
Concept
this
The
if
its
evaluation of a
number representing
into a
the day,
month, year, day of the week, or day of the year on which the
specified date falls.
its
equivalent
text value.
Time
AM
value.
Math
in radians.
functions perform
common
random
The
random number.
For a full explanation of any of the DQL functions, see the entry
under the function's name in this Lexicon.
6-77
listed
DQL
Functions
DQL LEXICON
futurevalue
See Also: installment, rate,
Keyword:
futurevalue
Type:
Financial Function
periods, presentvalue
payment,
Syntax:
interest rate,
Returns:
Usage:
If the
numeric value
installment
investment
(e.g.,
payment increases
If the
payment decreases
The
if
payments are
(the
monthly
interest rate
is
whole number
(10<7f is 10,
not 0.10).
When
12. 120)
10
Returns: $47,554.91
that
12,
and after
the
division
symbol.
Example
2:
in
futurevalue = principal
* ((]
(meaning "raise
to the
a query).
(installmentl(ratellOO)) * (({I
Volume
asterisks
+ (rate/JOO)) ** periods) +
+ (rate/JOO)) ** periods) -
I)
6-78
global
Keyword:
global
Type:
Keyword
variable
is
procedure.
By
in a
query.
temporary
current procedure.
Syntax:
Usage:
another.
To
variable
must be defined
global
When
its
variable name
processing a Control procedure that links two or more
name and
type
is
If a Control
procedure requires data retrieved from a relationship, the data
can be obtained in a Processing procedure and stored in a
its
global variable.
Example:
define global
income" Number
Number
"profit" Number
"MONTHLY TOTALS"
run procedure
if
global
INCOME >
run procedure
"PAYROLL BONUS"
else
run procedure
"REGULAR PAYROLL"
end
>
6-79
Volume
DQL LEXICON
global (cont.)
This query
is
INCOME. EXPENSES,
and
the query.
2)
PROFIT to
Run
store
the
MONTHLY TOTALS
totals
from
is
the
calculated,
it
is
named
global
variable. 3) If the
in
variable
is
EXPENSES
REGULAR
PAYROLL procedure.
The
MONTHLY TOTALS
Example:
this:
global
expenses
end
The key
feature of this
example
is
Volume
in the
6-80
Keyword: Grouping
Type:
Concept
Purpose: Grouping
lets
field value
together.
Usage:
groups and
DQL
in
The
Example
1: for
PRESIDENTS
records
POLITICAL PARTY in groups
LAST NAME in order
FIRST NAME
list
end
The output
is
POLITICAL PARTY
DEMOCRATIC
LAST NAME
field
FIRST
(shown
NAME
in bold):
LEXICON
DQL
Grouping
The
in
(cont.)
query.
each group
For example,
if
we add
if
any other
new
statistic is
line to the
requested by the
query
in
Example
1;
Example
2: for
PRESIDENTS
and
records
POLITICAL PARTY in groups with group-totals
LAST NAME in order
FIRST NAME
"A" = "A" count
list
end
In this
example, the
line:
"A" = "A"
count
the
POLITICAL PARTY
DEMOCRATIC
group
level statistics
LAST NAME
(shown
FIRST
in bold):
NAME
order
Keyword:
Type:
highest of
appear as a
list
statistic in the
end of the
Syntax:
highest of
in a related
form.
The
result
can
summary
FORMNAME RELATIONSHIP
|
[named "UNIQUE
FIELDNAME
field.
If a
field is specified,
value.
If
There's an important
difference between the
statistical
operator
for
CUSTOMERS
max finds
records
LAST NAME in Order
highest
this
in the set
of matching
query, arranged
in
ORDER TOTAL
all
all
This query tells DataBase: 1) Process all the CUSTOMBRS records and
list each customer's last name in alphabetical order.
2) For each
INVOICES form
among
end
CUSTOMBRS
of.
list
highest of
max and
operator highest
Example:
of,
sum of
of,
report.
Text
any, count
RELATIONSHIP NAME"]
Returns:
mean
of,
matching records
field in all
all,
lowest
named
See Also:
customer
INVOICES
3) List the
#).
records.
alphabetical order by
LAST name.
LAST NAME
Adams
$195.00
$225.00
$105.00
$125.00
$ 75.00
Cooper
Evans
Hill
Ivers
highest of
6-83
among
this
item
max
group of
Volume
DQL LEXICON
hours
Keyword: hours
See Also: ampm, current,
minutes, seconds, timeampm
Time Function
Type:
Syntax:
in a
24-hour format.
hours(TIME VALUE)
Returns:
An
00
to 23.
NOTE: The
it is
(e.g..
midday)
is
to clarifiy
parameters.
Volume
6-84
Command
Command
Keyword:
if
Type:
Procedural
Command
See Also:
command
series of actions)
Purpose: The
if
if Function
is
true or false.
When
processing reaches an
if
command. DataEase
keyword
evaluates
if.
specified condition
is
true.
DataEase executes
all
the
reaches the
condition
If the specified
the corresponding
Syntax:
if
CONDITION
(ACTION
\%
false.
keyword
DataEase executes
all
is
the
end command.
then
1
ACTION
ACTION
N.l
[else
ACTION
ACTION
ACTION
N.
end
Example
for
CUSTOMERS
end
end
6-85
>
Volume
DQL LEXICON
if
Command
This query
tells
(cont.)
DataBase:
recent invoice
1980, delete
all
INVOICES
in the related
3) If a customer's
record.
1st,
is
CUSTOMERS
For each
1)
1st,
of that customer's
form. 2)
is
If the
most
CUSTOMERS
INVOICES
1980.
The
first
delete.
the records to
that selects the
Usage:
query
may
contain multiple
if
Example
commands
2).
nested (indented)
These additional
if
or else; however, a
the previous condition
is true.
When
if
commands
if
and each
if
end corresponds to
be matched
command must
nested Procedural
Example
2: for
INVOICES
if
:=
in
copy
end
end
all
then
CUSTOMERS
PREFERRED
modify records
from
in
to current
date then
CATALOG CUSTOMERS
CUSTOMERS
end
This query tells DataEase to divide the INVOICES records into two
groups and process them as follows: 1) The records with an ORDER
TOTAL greater than $500 are modified by changing the value in the
STATUS field to PREFERRED. 2) The records with an ORDER total
greater than 500 and a date between the start of 1989 and today's date
are modified and also copied into the
In this example, the second if
first if
CATALOG CUSTOMERS
form.
the
command.
Volume
6-86
Function
Keyword:
if
Type:
Conditional Function
Function
See Also: break, case, for,
else, end, exit, if
Purpose: The
Syntax:
Returns:
if(CONDITION,
The
is
true or false.
query
may
if
value
Usage:
if
Command,
if
is
is false.
Generally, you can specify any type of value you want for the
true value
and
same type
In certain cases.
must be
the
For example:
"in
afternoon")
is
("AM"
or
"PM") and
morning" or
in the
condition
')
Conversely,
if(12 < hours(current time), "in the morning", "in the
afternoon")
If
is
in the
condition
we want DataBase
is
to
a text value.
function, try changing the type of the true and false values.
6-87
>
Volume
DQL LEXICON
if
Function (cont.)
Example:
for
CUSTOMERS
list
records
end
This query
the
tells
BALANCE
the
in the
account balance.
value in the
ACCOUNT BALANCE
NO. The output from
CUSTOMERS
If the
field
is
YES
form,
in the report
LAST
list
ACCOUNT
in
Keyword: import
See Also: install application
Type:
Control
Command
It
can be used
import data
to
at
used
Syntax:
in the
import
Usage:
to
execute a
command
is
This
Specification.
Database
Utilities
Specification
LAN:
On
LAN
is
defined.
if
another user
the
is
currently
this
command
you want
time, you must reboot
at brief intervals.
procedure during
When
command.
Run
message
this
If
becomes
to abort the
the computer.
available,
DataEase
Volume
2,
Chapter
Example:
This query
2)
When
6-89
import "MAILLIST"
run procedure "PRINT
4,
System Administration.
conflicts
and Multi-User
tells
the
LETTERS"
DataEase:
impon
is
Volume
DQL LEXICON
in
Keyword:
in
Type:
Keyword
Purpose: The
DataBase
in operator tells
to use a
when executing
list
records, delete
command.
Syntax:
in
When
Usage:
the in operator
is
all related
If
criteria,
records
in the
FORMNAME,
Example
1: for
CUSTOMERS
conjunction with
modify records
ORDER TOTAL
in
3).
;=
INVOICES
ORDER TOTAL
in
DISCOUNT
end
This query discounts every related INVOICES record each time a
CUSTOMERS record is processed. Since every invoice is related to
only one customer, each record is discounted only once.
Example
2: for
INVOICES
modify records
ORDER TOTAL
:=
INVOICES
ORDER TOTAL
in
DISCOUNT
end
This example demonstrates an INCORRECT use of the in operator.
This query discounts every INVOICES record each time a record is
processed (each invoice is discounted as many times as there are
records to process).
Example
3: for
INVOICES
modify records
ORDER TOTAL
:=
ORDER TOTAL
DISCOUNT
end
This query
The
in
CORRECTLY
keyword
delete records
is
command when
the action
is
form.
Volume
6-90
groups
Keyword:
in
Type:
Grouping Operator
groups
Purpose: The
then
those from
all
displayed once
New
at the
York.
etc.).
The group
identifier is
If statistics are
Syntax:
Usage:
FIELDNAME
HI
groups
in
In a query, an item to
hefore
all
order.
listed
When
a field
is
(all
Alabama customers
are
(i.e.. if
in
INVOICES
all
CUSTOMERS
state
in groups).
Example:
CUSTOMERS
for
list
records
STATE in groups
LAST name in order
end
;
This query
the
DataEase:
tells
same value
in the
1)
state
Process
all
the
CUSTOMERS
records with
2) Display the
this
STATE
LAST NAME
NJ
Adams
NY
Cooper
Evans
Hill
6-91
vers
Volume
DQL LEXICON
in
Keyword:
in
Type:
Grouping Operator
Purpose: The
in
Syntax:
Usage:
if
any other
statistic
FIELDNAME
The group
in
identifier
of the group.
is
If statistics
at the
beginning
Example:
(i.e., if
in
INVOICES
the
CUSTOMERS
all
Primary form,
STATE
CUSTOMERS
list
records
end
This query tells DataBase: 1) Process all the CUSTOMERS records with
the same value in the STATE field together as a group. 2) Display the
group identifier (STATE) once at the beginning of each group. 3) Within
each group, arrange the customers in alphabetical order by LAST NAME.
4) List each customer's ACCOUNT balance, the subtotal for each STATE
group, and the sum of all the account balance amounts combined.
The output from this query might look as follows:
STATE
NJ
LAST NAME
ACCOUNT BALANCE
order
Keyword:
in
Type:
Sorting Operator
order
Purpose: The
in
order operator
DataEase
tells
to process records
and
01013.
Syntax:
FIELDNAME
Usage:
The
in
1.
etc.).
order
in
Number
Time. Date, or
field is
highest value.
Text
tleld
is
Choice
field
is
field.
sorted by
Choice number.
Example:
INVOICES
is
all
the statement:
CUSTOMERS
for
if
INVOICES
LAST NAME
in order
records
list
STATE
ZIP
in
in
groups
order
LAST NAME
in
order
end
This query
tells
DataEase:
1)
Process
all
the
CUSTOMERS
records with
each group, arrange the customers in lowest to highest zip code order.
4) Within each zip code, arrange the customers in alphabetical order by
last name.
STATE
NJ
this
ZIP
CODE
LAST NAME
DQL LEXICON
in
reverse
Keyword:
in
Type:
Sorting Operator
reverse
Purpose: The
in
reverse operator
tells
DataBase
to process records
and
lowest value
before 01011,
Syntax:
Usage:
FIELDNAME
The
etc.).
in
reverse
in reverse operator
field.
to
lowest value.
Text
field
is
sorted in reverse
alphabetical order.
Example:
LAST NAME
CUSTOMERS
list
INVOICES
is
the
all
Primary form,
the statement:
CUSTOMERS
for
if
in reverse
records
STATE
in
groups
ZIP in reverse
LAST NAME
in
order
end
This query tells DataEase: 1) Process all the CUSTOMERS records with
the same value in the STATE field together as a group. 2) Display the
group identifier state once at the beginning of each group. 3) Within
each group, arrange the customers in highest to lowest ZIP code order.
4) Within each zip code, arrange the customers in alphabetical order by
LAST NAME.. The output from this query might look as follows:
STATE
Keyword:
input
Type:
Processing
Command
DQL
Syntax:
input using
In the
all
can be used
FORMNAME
into
any point
at
in a
procedure.
"TEMPFORM"
In Interactive
command
input
Mode. DataEase
to reference
There
is
no
limit to the
use in a query;
Usage:
tells
When
DataEase
to display a specified
the specified
form
displayed, you
is
view records
in related
forms.
number
that
TEMPFORM
name
at
a time.
in
If
memory
you want
to
command, set
variable. To enter an
>
Key Pressed
LEXICON
DQL
input (cont.)
Example
1: input
for
using
CUSTOMERS
into
"TEMPCUST"
INVOICES
(CUSTOMER* =
with
TEMPCUST customer
#)
records
INVOICE #
list
ORDER TOTAL
DATE
end
This quer>'
tells
all
the
in the
record in
memory
(using
INVOICES
TEMPCUST
it).
# as the
CUSTOMER
this
DATE
list
CUSTOMER
the
invoice #
CUSTOMER*
Example
(a
If
CUSTOMERS
input using
case (current status)
value 1
value 2
break
do
into
"TEMPCUST"
if
<= 20 then
else
message
"Invalid
end
others
or delete records."
window
end
end
This query tells DataEase: 1) Display the CUSTOMERS form. 2) Each
time the user enters a record and presses a processing key, check the value
of the current status variable. If current status = 1 (ESC), stop query
processing without entering a record in the CUSTOMERS form. If
current status = 2 (F2 SAVE), verify that a valid customer code
valid,
copy
the input
If
it
is
is
CUSTOMERS
another record.
When
Command
with Multiforms
command on
record
-^
6-97
or
it
is
Volume
LEXICON
DQL
input (cont.)
If the user presses F2 SAVE to enter a Multiform record, you can use
enter a record to enter the record into the Main form (the Subform
records were automatically entered when the user pressed F2). If the
query tests the Main form for validity (e.g., CUSTOMER CODE <= 20 in
Example 3) and it fails, you must use delete records to remove the
Subform records that were entered when you pressed F2 SAVE.
If the
user presses
F8
MODIFY
to
modify
you delete a Multiform record using the input command, the records
from the form. You must use the query to verify
that a valid record was entered and then use delete records to explicitly
delete the appropriate Main and Subform records.
If
Example
case (current
value 1
value 2
status)
break
if
do
"TEMPINVOICE"
enter a record
copy
all
from
message
in
then
INVOICES
TEMPINVOICES
"Invalid
This query
tells
Volume
6-98
appi
Keyword:
install
Type:
Control
Purpose: The
appI
(install application)
Command
install
procedures
command
appI
in the
you
lets
When
Syntax:
to specify the
install
appI
"INSTALLATION FILENAME"
The filename
LAN:
new DataEase
processing reaches
an install appI
name
replace forms or
install or
appI
Command
command
is
the
file.
command
The
On
LAN
if
more information
for
another user
is
currently
command,
message
the
is
Volutne
command
at brief intervals.
procedure during
When
this
If
you want
install
2.
Database
appl
Chapter
5.
Utilities.
to abort the
this time,
becomes
available.
DataEase
procedure. See
for
Volume
2,
Chapter
4.
System Administration,
Locking options.
Example:
This query
disk
in
tells
DataEase:
CATALOG
6-99
1) Install the
MAILLIST
2)
When
new
application
is
procedure.
Volume
LEXICON
DQL
installment
Keyword:
installment
Type:
Financial Function
payment required
payment periods.
Syntax:
Returns:
Usage:
If
the installment
investment
(e.g.,
the function
is
the
(e.g.,
If the
payment
loan amortization),
is
expressed as a
rate, installment
payments, and
annual rate
Examples:
/1 2).
installment(15000,
Returns: -318.71
0,
10
12,
60
When
10
12.
installment(0, 15000, 10
Returns: 193.71
12, 60)
in
asterisks
(meaning "raise
to the
a query).
Volume
6-100
Keyword: item
Type:
Statistical
Operator
coihlitional slatistical
opeialor.
Syntax:
fieldname
Usage:
In a
included
In a
DQL
Procedure,
if
automatically included
name
Example:
for
is
is only included
followed by the item operator.
CUSTOMERS
is
If statistics
no
if
the
list
ACCOUNT BALANCE
item min
max sum
end
This query
tells
DataBase:
alphabetical order by
BALANCE
(item).
the largest
balance
1)
Process
last name.
the
CUSTOMERS
account balance
account balance
LAST NAME
this
total
of
records
in
ACCOUNT
(min). 4) List
all
the
an important
.account
ACCOUNT BALANCE
Adams
Cooper
Evans
Hill
Ivers
6-101
all
is
statistical
are
records
LAST NAME in order
There
$595.00
$725.00
$865.00
$525.00
$675.00
^$52~5"oO
$865 00
$3 385 00
Volume
LEXICON
DQL
Keyword: item
Type:
answer indicating
if
the specified
COMPARISON STATEMENT
Syntax:
Usage:
In a query, the
item operator
comparison
is
item
is
placed after a
list
item that
Example:
for
CUSTOMERS
no
true or false.
is
is
separated
records
LAST NAME in order
list
end
This query
tells
DataBase: 1) Process
alphabetical order by
BALANCE
(item).
LAST NAME.
all
the
CUSTOMERS
ACCOUNT balance
records in
ACCOUNT
(min). 4) List
ACCOUNT BALANCE
this
LAST
ACCOUNT
NAME
BALANCE
Adams
ACCOUNT BALANCE
OVER 500
Keyword:
jointext
Type:
Text Function
Purpose: The
one.
Syntax:
jointext(TEXT
Returns:
Usage:
When two
text value
up
to
255 characters
in length.
more
fields,
To
join three or
as
Examples:
jointext("Data", "Ease")
Returns: DataBase
jointext(jointext("Data", "Ease"),
Returns; DataBase International
In the above example, there
the string International.
is
"
International")
a space at the
start of
PRODUCT
6-103
is
I6M. The
DatuEase.
Volume
LEXICON
DQL
Julian
Keyword:
julian
Type:
Date Function
yearweek
Purpose: The
Syntax:
julian(DATE
Returns:
YY
Usage:
VALUE)
the
day
in the
= 365, except
two
YYDDD.
year
when
1st
it
is
DDD
is
the position of
31
366).
Examples: julian(07/04/89)
Returns: 89185
julian( 12/31/89)
Returns:
Volume
89365
6-104
Keywords
Keyword: Keywords
See Also: blank, current,
Type:
Concept
Purpose: Keywords
using, value
Usage:
In interactive
from
Mode,
DQL
a Data-entry form.
certain
where required.
keywords
as specified below:
blank returns a
current tells DataBase that you want to access one of the eight
current system variables (date, time, page number, item number, user
name, user level, computer name, or status).
do
tells
found
in
to
command
is
true.
specified by a while
else tells
specified by an
if
command
to
\s false.
in tells
DataBase
to enter, delete,
list,
into
others
temp
then
name
identifies a
all
of a
the preceding
temporary variable.
using
command
when
the condition
to specify the
name of the
For a
to specify the
full
in this
6-105
DQL
Volume
DQL
LEXICON
lastc
Keyword:
lastc
Type:
Text Function
Purpose: The
Syntax:
firstw,jointext, lastfirst,
lastM\ length, lower, midc,
lastc(TEXT VALUE,
Returns:
Usage:
lastci
text value
characters
midM.',
proper, textpos,
upper
n)
n characters
FIELDNAME.
in length.
characters
number of
Examples: lastcC'DataEase",
Returns: Ease
4)
lastcC'New User",
Returns: User
4)
If there are
n or fewer
laStC(FIRST NAME. 4)
Returns: The last four characters in the first name
field for every record that is processed. If the first
NAME field contains the value Sherlock, the function
returns lock.
Volume
6-106
Keyword:
lastfirst
Type:
Text Function
Purpose: The
Syntax:
Returns:
lastfirst(TEXT
First
VALUE)
text value.
The contents of the field are rearranged so that the last word
(i.e.. the last name) becomes the first word in the returned
value.
Usage:
A comma
is
The name of
this function
the format in
which
Examples: lastfirst(Susan
the
B.
and the
names
last
name.
Anthony)
Returns:
Eliot,
T.S.
lastfirst(FULL name)
NAiviE field,
6-107
Volume
DQL
LEXICON
lastw
Keyword:
lastw
Type:
Text Function
Syntax:
end
(right)
of a text value.
lastw(TEXT VALUE,
n)
Returns:
Usage:
lastw(FIELDNAME,
text value
n words
in length.
n words
in the field
If there
are n or fewer
words
in
Examples:
lastw("DataEase International,
Returns: International,
lastw("New User",
Returns: User
1)
laStW(BOOK
Returns the
2)
TITLE,
Inc.", 2)
Inc.
Volume
6-108
Keyword:
length
^
^
Text Function
Type:
number of character
positions
in a text value.
Syntax:
length(TEXT VALUE)
Returns:
An
Usage:
integer value.
spaces.
Examples:
length("DataEase International,
Returns: 28
Inc.")
length("New User")
Returns: 8
length(coMPANY name)
Returns: The number of characters
in the company
NAME field for every record that is processed.
the
COMPANY NAME field Contains the value DataBase
If
^-'^^
Volume
LEXICON
DQL
list
records
Keyword:
list
Type:
Processing
records
Purpose: The
Command
records
list
command
tells
to
Syntax:
records
list
in
Each
last,
list
list
is
command
with report
the
[named "UNIQUE
[with(selection criteria)]
which
records
items.
FORMNAME RELATIONSHIP
RELATIONSHIP NAME"]
Usage:
lisr
The
in a list
after
for
CUSTOMERS
records
sum
selection criteria.
This query tells DataEase: 1) Process all the CUSTOMERS records with
the same value in the st.ate field together as a group. 2) Display the
group identifier (STATE) once at the beginning of each group. 3) Within
each group, arrange the customers in alphabetical order by LAST NAME.
account balance
(item).
5) List subtotals of
STATE
records
automatically
list
end
statistic for
the
command is
;
Mode,
group-totals).
Low Level
item.
list
each specified
command is
query.
In
Example:
records
available in a
statistics
list
the
when you
more
Keyword:
lock
Type:
Processing
Command
LAN
is
only functional
appears
command
or unlock
Usage:
lock
order to
at the start
LAN
in the
If
of the query,
query.
end of a query.
at the
Syntax:
appears
In
statement of the
all files
commands
first
all files
The lock
query.
filename
all files
command
locks
all
in the
The lock
file
command
an unlock
command. When an
same form
is
specified
is
Shared
lets
in
the locked
in that
form.
Exclusive prevents
all
access to the
The lock
selected record
except
it
processed.
When DataBase
command
file
currently being
this
command
it
is
loop (see
2). If you use it outside a for
no records are selected: therefore nothing is locked.
->
6-111
is
Use
Example
automatically unlocked.
loop,
command
Volume
LEXICON
DQL
lock (cont.)
Example:
lock
for
file
INVOICES shared
CUSTOMERS
(sum
with
of
INVOICES order
ACCOUNT BALANCE
end
This query
tells
DataBase:
1)
Lock
the
whose
related
than $500.
INVOICES
CUSTOMERS
list
records
ORDER TOTAL
the customer's
greater
LAST NAME
INVOICES form
sum
of calculation
Example
2: for
new
field.
CUSTOMERS
records
LAST NAME
list
ACCOUNT BALANCE
mean of INVOICES order total
;
end
This query tells DataBase: 1) Select all the CUSTOMERS records.
2) Lock each record as it is selected so other users can view it but cannot
add, delete or modify the record while it is being processed. 3) For each
record selected, list the customer's last name, account balance, and
the mean ORDER total of all the related INVOICES records.
In this example,
record that
is
all
the
CUSTOMERS
Volume
6-112
db
Keyword:
lock
Type:
Control
Purpose: The
db
(lock database)
Command
lock
db command
DataBase on a
LAN
is
This
command
Syntax:
lock
db
Usage:
when
conflict
installing a
new
database.
There
command
in several
differs
is
an important
ways:
lock db Control
command.
2.
It
command can
lock individual
individual records.
There
is
db command,
command
command
is
it
remains locked
exits
it.
the lock
still
let
is
who
until
is
locked by
an unlock db
db
from DataBase.
This entry continues on the next page
6-113
Volume
DQL LEXICON
lock
db
LAN:
(cont.)
On
LAN
db command,
message
the
command
at brief intervals.
procedure during
When
this
is
this time,
If
you want
to abort the
becomes
available, DataEase
procedure. See
for
Locking Options.
Example:
lock db
run procedure
run procedure
.
unlock db
This query
tells
"CALCULATE DISCOUNT"
"PRINT INVOICES"
DataEase:
1)
CALCULATE DISCOUNT
Lock
procedure. 3)
Run
the
2)
Run
the
PRINT INVOICES
Volumes
6-114
Keyword:
log
Type:
Scientific Function
Purpose: The
sqrt
numeric value.
Syntax:
Returns:
Examples:
log(NUMERIC VALUE)
numeric value.
I
log(3)
Returns:
1.098612
log(0.5)
Returns:
6-115
-0.693147
Volume
DQL LEXICON
Iog10
Keyword:
loglO
Type:
Scientific Function
common
base 10 logarithm
of a numeric value.
Syntax:
ioqioinumeric value)
Returns:
numeric value.
Examples: Iog10(3)
Returns:
0.477121
Iogl0(0.5)
Returns; -0.301031
Volume
6-116
lower
Keyword: lower
Type:
Text Function
Syntax:
Returns:
lower(TEXT VALUE)
The
ail
Examples: lower("DataEase")
Returns: dataease
lower("Washington D.C.")
Returns: Washington d.c.
IOWer(LAST NAME)
Returns the value in the last name field in lowercase
type for every record that is processed. If a record
contains the value HOLMES in the last name field,
the function returns holmes.
6-117
Volume 3
DQL
LEXICON
lowest of
Keyword:
lowest of
Type:
See Also:
highest
of,
The
result
all
all,
of,
any, count
min,
mean
of,
of,
sum
named
matching records
can appear as a
list
item
in a related
in the detail
form.
area of a
end of the
report.
Syntax:
lowest of
Returns:
field
is
specified,
Text
If a
There's an important
difference het^'een the
statistical
value).
min
If a
Example:
for
CUSTOMERS
operator lowest
of.
among
records
LAST NAME in order
lowest of INVOICES order total
list
end
This query tells DataEase: 1) Process all the CUSTOMERS records and
list each customer's LAST name in alphabetical order. 2) For each
CUSTOMERS record selected, find the related records in the INVOICES
form (those that have the same CUSTOMER #). 3) List the lowest ORDER
total
for
each customer
in the set
of matching
LAST NAME
in alphabetical order
records.
by last name,
Adams
$15.65
$22.40
$18.10
$12.50
$17.25
Cooper
Evans
Hill
Ivors
If
INVOICES
this
group of
lowest of
Volume
item min
6-118
max
Keyword: max
Type:
Statistical
Operator
VALUE max
:
result appears
specified value
ASCII
Usage:
specified field
max
is
Text
field,
max
value.
among
the
among
being processed.
Example:
for
CUSTOMERS
list
There's an important
difference between the
statistical
operator
operator highest
max finds
with
records
item
max sum
end
This query tells DataBase: 1) Process all the CUSTOMERS records that
have a value greater than 500 in the account balance field. 2) List the
customers by LAST name in alphabetical order. 3) List each customer's
max and
among
the
LAST NAME
this
ACCOUNT BALANCE
Adams
Cooper
Evans
Hill
Ivers
6-119
$595.00
$725.00
$865.00
$525.00
$675.00
^$865.00'
$3385.00
Volume
DQL
LEXICON
mean
Keyword: mean
See Also: item, max, min,
Type:
Statistical
mean
Operator
sum, variance
Syntax:
Returns:
Usage:
numeric value.
calculates the average of
number of values
calculation.
sum of
processed).
all
the values in
Blank
the calculation.
Example:
for
CUSTOMERS
with
records
LAST NAME in order
statistical
and
tile
operator
Item
mean sum
end
mean
relational statistical
mean of.
mean finds the average value
in the specified fie Id among
operator
mean offinds
list
ACCOUNT BALANCE
There's an important
difference between the
the average
This query tells DataBase: 1) Process all the CUSTOMERS records that
have a value greater than 500 in the ACCOUNT balance field. 2) List the
customers by last name in alphabetical order. 3) List each customer's
LAST NAME
this
ACCOUNT BALANCE
Adams
$595.00
$725.00
$865.00
$525.00
$675.00
Cooper
Evans
Hill
Ivers
Volume
$677.00
$3385.00
6-120
of
Keyword: mean
Type:
of
result
sum
specified field in
all
matching records
can appear as a
each group or
at the
item
list
Syntax:
in a related
in the detail
summary
end of the
of,
named
in a
form.
area of a
report.
Returns:
Usage:
numeric value.
calculates the average of
sum
Example:
CUSTOMERS
list
the values
for
all
in the calculation.
mean
of
in
Order
operator
mean
relational statistical
mean offinds
end
This query tells DataBase: 1) Process all the CUSTOMERS records and
list each customer's last name in alphabetical order.
2) For each
CUSTOMERS
statistical
and the
in the
records
LAST NAME
There's an important
difference between the
the average
INVOICES form
for each
of related
set
INVOICES
records.
LAST NAME
this
Adams
$35.25
$72.40
$48.10
$25.00
$67.45
Cooper
Evans
Hill
Ivers
you also want to include the mean order total among this group of
invoices, change the fourth line of the query to read:
If
mean
6-121
of
item
mean
Volume
LEXICON
DQL
message
Keyword: message
Type:
Procedural
Command
DataEase
tells
to display a specified
Each
message can be assigned individual color and highlighting
effects and be positioned anywhere on the screen.
characters in length (17 lines x 68 characters per line).
Syntax:
When you
Usage
message from
select
the
[pause]
list
DQL commands
of
DataEase prompts:
You
be displayed.
to
quotation marks
When you
when
message
window.
in a
message can be up
to
1000 characters
To
If
line (see
you want
window
the start
Example
You can
to indicate
).
yourself,
of
Rows.
in
at
MESSAGE
in
new
you
length.
If
all
or part
(See Example
3).
Volume
2,
Volume
6-122
(cont.)
is
limited to
When
message
the user
is
is
displayed
in a
Example
1:
message
this
procedure" window
Example
2:
in a
is
requirecl|to run
window. There
message
IS
This message is displayed in a window. There are line breaks after the
words Sony and required. The message window is 40 columns wide,
begins in row 15, column 20, and is 3 rows in length.
Example
3:
message
level
is
This message is displayed in a window. There are line breaks after the
words Sony and required. The message window is 40 columns wide,
begins in row 15. column 20. and is 3 rows in length. The word Sorjy
is
highlighted like a
word
keyname
is
The
treated
Example
4:
message
is
required to
This message
the screen.
character
pauses
6-123
is
The message
maximum
length).
Volume
DQL LEXICON
midc
Keyword: midc
See Also: Jirstcfirstlast,
Type:
Text Function
Syntax:
where
is
characters
text value.
midc(TEXT VALUE, m,
number of
number of
n)
and n
is
the
characters to extract.
Returns:
Usage:
text value
n characters
character position
in length.
(inclusive).
at
Examples: midc("DataEase",
Returns;
4, 3)
aEa
midcC'New User",
Returns: Use
5, 3)
midC(LAST NAME, 4, 2)
Returns two characters beginning at the fourth
character position in the last name field for every
record that is processed. If a record contains the
value Holmes
in
the last
name
field,
the function
returns me.
Volume
6-124
midw
Keyword: midw
See Also: firstc,firstlast,
Type:
Text Function
Syntax:
midw(TEXT VALUE, m.
where
is
n)
number of words
Returns:
Usage:
midw(FIELDNAME, m,
text value
is
the
to extract.
n words
in length.
n) returns n
words beginning
at
Examples: midw("DataEase
International Inc.", 2, 1)
Returns: International
2, 2)
midw(BOOK
TITLE, 2, 3)
6-125
book
Volume
DQL
LEXICON
min
Keyword: min
See Also: item, lowest
Type:
Statistical
Operator
Syntax:
Returns:
min [other
specified field
result appears
statistical operators]
specified value
ASCII
is
of,
std.err.,
a Text field,
min
There's an important
dijference between the
statistical
value.
Example:
CUSTOMERS
for
ACCOUNT BALANCE
LAST NAME
this
among
ACCOUNT BALANCE
$595.00
$725.00
$865.00
$525.00
$675.00
Cooper
Evans
Hill
Ivers
ACCOUNT BALANCE
Volume
tite
Adams
MIN
lowest value
returns
item min
This query tells DataBase: 1) Process all the CUSTOMERS records and
list each customer's LAST NAME in alphabetical order. 2) List each
customer's ACCOUNT balance and include the smallest ACCOUNT
of.
min
;
end
BALANCE amount
operator lowest
;
records
LAST NAME in order
list
$525.00
6-126
Keyword: minutes
Type:
Syntax:
Returns:
Time Function
function extracts the minutes from a time value
in a
24-hour format.
minutes(TIME VALUE)
An
00
to 59.
minutes(23:59:00)
Returns: 59
6-127
Volume
DQL LEXICON
mod
Keyword: mod (modulus)
See Also: abs,
Type:
decimal value
is
Returns:
is
returned.
If
both
Otherwise, a
returned.
mod(NUMERIC VALUE
Syntax:
floor,
when one
is
ceil,
random
Scientific Function
1,
NUMERIC VALUE
2)
numeric value.
Examples: mod(8,
3)
Returns; 2
mod(12.6,
Returns:
Volume
1.6)
1.4
6-128
Type:
Processing
Command
all from,
enter a record,
list
records
records in a specified
form.
Syntax:
Usage:
field values to be
Alternatively,
changed
in the
to
copy
from command. As
field
data
is
is
to
in
is
records
in the
records
command
(see
Example
an error
is
1
).
1: for
CUSTOMERS
with (any
file.
no selection
Example
form
a Target
Target form.
entered
in the
criteria
> 500)
modify records
;
ACCOUNT BALANCE
DISCOUNT)
:=
(ACCOUNT BALANCE
data-entry
end
This query tells DataBase: 1) Process all the CUSTOMERS records that
have any related INVOICES record with an ORDER total greater than
$500. 2) Modify each CUSTOMERS record by subtracting the DISCOUNT
amount entered in the Data-entry form from the value in the ACCOUNT
BALANCE
field.
6-129
Volume
DQL
modify records
(cont.)
Usage:
LEXICON
command
form
are modified.
Example
CUSTOMERS
2: for
modify records
ORDER TOTAL
INVOICES
ORDER TOTAL
in
:=
+ NY SALES TAX
end
This query
have
NY
tells
in the
processed, find
each related
all
INVOICES
Volume
STATE
INVOICES
ORDER TOTAL
form. Modify
to
field.
6-130
Date Function
month
(1- 12)
from a date
yearweek
value.
Syntax:
Returns:
month(DATE VALUE)
An
and
12.
The
month(31/12/89)
Returns: 12 (European format)
month(89/12/31)
Returns:
6-131
12 (Metric format)
Volume
LEXICON
DQL
named
Keyword: named
Type:
Relational Operator
operator
is
name
each
to
Syntax:
[with
(selection criteria)]
Usage:
new ad-hoc
relationship. If
two forms
are related
by more
named
by using the
operator
in the
you assign
is
name used on
relationship
like as
analogous
it's first
name appears
When you
to the optional
is
placed
in
It
can be
in the
quotes
name
to the relationship is
if
at the
the
subsequent statements.
use the
named
operator to distinguish a
distinguish
it.
if
named
Once
a relationship
is
assigned a
it
-^
Volume
criteria.
6-132
(cont.)
for
CUSTOMERS
modify records
with
in
(CUSTOMER
# =
data-entry DISCOUNT
named "OUTDATED"
CUSTOMERS customer
entered
in
the Data-entry
There
is
OUTDATED
relationship.
INVOICES. During
this
query,
we
CUSTOMERS
are creating
two
and
different ad-hoc
criteria is forfeited
whenever
new
relationship
is
created, the full relationship criteria, including the criteria used in the
predefined relationship
specified
when each
(customer # =
relationship
CUSTOMERS customer
#), is
named.
is
Subsequently, as long as the criteria remains unchanged, you can use the
name alone without restating the relationship criteria. For
relationship
would look
Example:
like this:
for
CUSTOMERS
modify records
with
in
(customer
# =
data-entry DISCOUNT
records in CURRENT
INVOICE # in order
list
ORDER TOTAL
end
6-133
Volume
DQL
LEXICON
Nested Actions
Concept
is
an action that
is
if,
invoked by another
action.
1)
nested loop
processed (see
is
different actions
Example
1: for
CUSTOMERS
for
to select
2).
INVOICES
list
records
CUSTOMERS
INVOICE #
LAST NAME
in
groups
ORDER TOTAL
end
end
This query tells DataEase to perform the same series of actions on each
record selected by the for command. In this example, the second for
command, which
record that
is
is
CUSTOMERS
first
for
command.
Example
2: for
INVOICES
ORDER TOTAL > 500 then
;
if
modify records
in
CUSTOMERS
STATUS := PREFERRED
DATE between 01/01/89 to current date tfien
enter a record in CATALOG CUSTOMERS
copy all from CUSTOMERS
end
.
if
actions as
shown
in these
examples.
end
end
two groups of INVOICES records:
greater than $500 (the related
CUSTOMERS records get modified). 2) The records with an order
TOTAL greater than 500 and a date between the start of 1989 and today's
date (the related CUSTOMERS records get modified and copied into the
This query
tells
DataEase
with an
to select
ORDER TOTAL
CATALOG CUSTOMERS
form).
first if
the
command.
Volume
6-134
Keyword:
not
Type:
Comparison Operator
operator
except
it
VALUE
Usage:
The not
(/fii
(e.g.,
state
York).
VALUE
stating the
<
precedes
New
Syntax:
or,
comparison
r/ic/;;)
greater than).
in a different
Whenever
field is less
in
the
order
6-135
Volume
DQL LEXICON
Operators
List of
DQL
Keyword: Operators
Type:
Concept
COMP.ARISON
Purpose: Operators
refine
commands; they
tell
DataBase how
to
There are
briefly
six
Commands.
groups of
DQL
Comparison Operators
left
DataBase
if
the
comparison
tell
to
compare
of the operator with the value to the right of the operator and
summarized below:
which records
are processed
Relational Operators
let
you
and
is
tell
true.
DataBase
to
Operators summarize
is
true
and the
total
number
is
or the percentage of
true.
to
summarize
field
There
is
Operators
Keyword:
or
Type:
Logical Operator
Purpose: The or
Syntax:
SELECTION CRITERIA
Returns:
The values
in
or
SELECTION CRITERIA
criteria.
criteria statements.
Usage:
The or operator
and
When
or operators
in
Examples:
CUSTOMERS
for
or
This statement
that contain
the
tells
NY
the
in
ACCOUNT BALANCE
field.
record
is
processed
if
it
satisfies either
of
these criteria.
for
or
state = "NJ")
This statement
tells
$500
in the
NY
or
NJ
in the
account balance
STATE
field
CUSTOMERS
and
records
field.
In this case, only records that satisfy both sets of criteria are processed.
6-137
Volume
DQL LEXICON
Others
Keyword:
others
Type:
Keyword
command
is
When
syntax.
processing a case
command,
If
each
none of
end command
Syntax:
first
case (EXPRESSION)
COMPARISON
value
ACTION SERIES
[value
COMPARISON
ACTION SERIES
[value
COMPARISON N
1.
2.1
ACTION SERIES N]
[others
end
Usage:
others
is
used,
must follow
it
keyword
all
are optional.
the specified
comparison
values.
Example:
"FRANK"
menu "ADMINISTRATION"
value "CAROL"
value
call
end
This query
tells
DataBase:
ADMINISTRATION
Procedure.
display the
Volume
If
If the
menu.
If
is
DAILY
CUSTOMERS
current user
is
6-138
Keyword: output
Type:
Procedural
Command
is
report format.
The
and
text
when
command is encountered
without regard to grouping, formatting, or other command
printer immediately
The command
structures.
command found
Syntax:
output
FIELD
Usage:
the
in
is
many programming
languages.
TEXT
lets
fields and/or
press
move
or
FIO FIELD
When you
and
to enter a field.
You can
report format.
it
select a field
Chapter 5 of
to
a separate line in
containing fields or
insert a period
column
Mode.
insert a period in
to Interactive
-^
6-139
command
1
in
Edit
line to
I
be output,
of the query.
Volume
DQL LEXICON
output (cont.)
To demonstrate
in the
shows a
command.
Since
in
Examplel
for
CUSTOMERS
records
LAST NAME
with
list
in
order
end
for
INVOICES
records
INVOICE # in order
list
ORDER TOTAL
end
LAST NAME
INVOICE #
Adams
Cooper
Evans
Hill
Ivers
A00005
ORDER TOTAL
Example
2: output
LAST NAME
for
CUSTOMERS
list
LAST NAME
output
[LAST NAME]
end
with
records
in
order
DQL
LEXICON
output (cont.)
A common
command
Example
3:
CO
#.
D. Vader, Inc.
in
Example
is
illustrated
below.
LEXICON
DQL
percent
Keyword: percent
See Also: item, count
Type:
Syntax:
Returns:
Example:
CONDITION
percent [other
statistical
operators]
numeric value.
for
CUSTOMERS
list
records
LAST NAME
in
order
ACCOUNT BALANCE
ACCOUNT BALANCE > 500
:
item percent
end
This query tells DataBase: 1) Process all the CUSTOMERS records and
list each customer's LAST NAME in alphabetical order. 2) List each
customer's ACCOUNT balance. 3) For each customer, display a YES or
answer indicating if the ACCOUNT balance is over $500. 4) Display
the percentage of records that have a ACCOUNT BALANCE value greater
than $500 in the report output.
NO
LAST
this
periods
Keyword:
periods
Type:
Financial Function
function calculates
how
long a financial
Syntax:
Returns:
to reach the
Usage:
if the installment
investment
(e.g.,
positive amount.
investment
(e.g.,
payment increases
payment decreases
is
expressed as a
is
The
number of months,
12.
To determine
the rate
To determine
is
periods as a
Examples: ceil(periods(10000,
Returns: 89
0,
periods as a
number of weeks,
the rate
is
365.
When
-150,8/12))
NOTE:
the formula
"raise to the
futurevalue = principal
6-145
Volume
DQL
LEXICON
power
Keyword: power
Type:
Scientific Function
power.
power(BASE, EXPONENT)
Syntax:
Returns:
Usage:
Use
the
power
Examples: power(12,
function instead.
2)
Returns:
144
power(6,
3)
Returns:
216
power(8, 1/3)
Returns: 2
Volume
6-146
presentvalue
Keyword: presentvalue
Type:
Financial Function
Syntax:
Returns:
numeric value
any installment
Usage:
If
payment increases
the installment
investment
(e.g.,
positive amount.
investment
(e.g.,
payment decreases
expressed as a
is
is
The
in
expressed as
2.
Examples: presentvalue(0,
Returns:
if
-150, 7.9
When
12, 48)
DataBase requires
you type a space before and
after the division symbol (/).
7.9
6156.12
12.
that
This example calculates the auto loan amount you can afford to borrow
an interest rate of 7.9% if you want to repay the loan in 48 monthly
payments of $150.
at
12, 240)
This example calculates the required starting balance for a savings plan
designed to accrue a $125,000 balance in 20 years based on monthly
payments of $150 and an annual interest rate of 10%.
NOTE:
in
futurevalue = principal *
(installment/date/
6-147
won
a query).
((I
* (((1
I)
Volume
LEXICON
DQL
Primary Form
Concept
Form
Usage:
to
view or manipulate.
Primary Form
is
called a
a Secondary form
is
to
When
lowest of,
in
a relationship exists
mean
of, or
records
if
The
sum
all
of)
is
in
another
between these
count
of,
highest of,
relationship level
relationship level.
a particular
(i.e.,
etc.).
all
Commands
See also: Control Procedure,
Processing Procedure
Concept
Purpose: The
DQL
Procedural
commands
Usage:
commands can
Procedural
be used
in
both Processing
Procedural
Commands
Example:
message
"MONDAY"
if
:
run procedure
value "FRIDAY"
run procedure
others
"NEW WEEK"
else
.
end
"CLOSE WEEK"
while
break
menu "MAIN"
call
exit
.
case
value
end
This query
WEEK
tells
procedure.
If
Main Menu.
6-149
DataBase:
procedure.
If the
If the
current date
current date
is
is
is
NEW
others
CLOSE WEEK
define
assign
Monday, run
the
(period)
Volume
DQL
LEXICON
Processing Procedure
Purpose:
Concept
A DQL
on the query
Usage:
Processing
procedure that
Example:
for
is
CUSTOMERS
list
Commands
records
modify records
delete records
enter a record
for
lock
unlock
records
LAST NAME in order
list
ACCOUNT BALANCE
quer>' selection
input
end
This query tells DataBase: 1) Process all the CUSTOMERS records.
2) For each record processed, list the LAST name and the ACCOUNT
BALANCE values and arrange the output in alphabetical order by LAST
NAME.
Voluine 3
6-150
proper
Keyword: proper
Type:
Text Function
Syntax:
Returns:
first letter in
and subsequent
each word
letters to
in a
lowercase.
proper(TEXT VALUE)
The
first letter in
each word
capitalized.
Usage:
Any
letter that is
a period
is
letter in the
the first
is
proper
function.
value
is
word nor
the first
proper function.
This function
is
last name
is:
proper(LAST .name)
in either
it
Examples:proper{"dr. watson")
Returns: Dr. Watson
properC'washington d.c")
Returns: Washington D.C.
proper(FULL NAME)
Returns the value
SHeiLOck hOLniES.
6-151
NAME
in the FLiLL
is
field in the
processed.
If
proper
a record contains
SHERLOCK HOLMES,
or even
Holmes.
Volume
DQL
LEXICON
query selection
Keyword: query
Type:
selection
Processing
Command
selection
form.
It
System Configuration
If
in
LAN
who
is
environment
rely
on
must
command
tells
processing
if
indexed field.
an indexed
it
DataBase how
field, the
Syntax:
files
records
nothing.
command
the
Record Selection locking rule and locks the fonn(s) from which records
are being selected. Other users cannot add, modify, or delete records in
the form. They can view records in the form if the selected records will
only he listed hy the procedure (not modified or deleted). The form
remains locked until the end of the procedure.
selection lock records command overrides the current default
Record Selection locking rule and locks any records that have been
selected for processing. Other users cannot modify or delete these
records. They can view the records if the selected records will only he
listed hy the procedure (not modified or deleted). Other users can view,
modify, or delete records in the same form(s) that have not been selected.
Once processing begins, the locking rule defined on the System
Configuration form for Record Processing applies.
The query
CAUTION .The
Options
4,
Volume
6-152
The query
(cont.)
Record Selection
command
applies.
The lock nothing command can be useful in situations where you need
keep data available to many users even while running a procedure that
to
uses that data. However, with this command in effect, it is possible for a
user to change a record that has already been selected for processing.
NOTE:
query,
command occurs
as the first
command in a
it
more
Usage:
information.
The query
selection
command
overrides the
Example:
at the
default
is
automatically
end of a query.
LAN
the database
CUSTOMERS
with
modify records
ACCOUNT BALANCE
DISCOUNT)
:=
(ACCOUNT BALANCE
data-entry
end
This query
discount
field
on the
Data-entry form.
In this
users can
processing.
It is
6-153
is
bonus points
will fall
being processed.
Volume
DQL LEXICON
random
Keyword: random
See Also: abs,
Type:
ceil, floor,
mod
Math Function
function returns a
and
(inclusive).
No
value
is
required in the
function's argument.
Syntax:
random(
Returns:
A number
Usage:
The following
using the
between
and
(inclusive).
random
1.
In the
Use
3.
fall.
possibilities) in
is
if
90.
which the
The
pseudo-random number
calculated by a formula, not a
true random number.
example 10-100,
(random(
integer
function
For example,
Determine
2.
random
function:
RANGE)
is
10.
random
integer.
STARTING VALUE
Examples: floor(random( * 9)
Returns: A random integer between
)
floor(random(
Returns:
*
)
9.
90) + 10))
integer between 10 and 100.
A random
Volume
and
down
6-154
Keyword:
rate
Type:
Financial Function
Purpose: The
presentvalue
rate function calculates the interest rate of a financial
Syntax:
Returns:
Usage:
If the
numeric value
installment
investment
(e.g.,
positive amount.
investment
(e.g..
payment increases
the
payment decreases
is
expressed as a
is
The
periods
Examples:
is
12 * rate(12000,
Returns: 7.3
0,
When
10
DataBase requires
you type a space before and
after the division symbol (/).
1
12,
that
-289, 48)
This example calculates the annual interest rate on a $12,000 car loan
be repaid in 48 monthly payments of $289.
to
NOTE:
((I
(installmentl(ralellOO)) * (((/
6-155
the formula
"raise to the
I)
Volume
DQL LEXICON
record entry
Control
Command
Syntax:
record entry
tells
DataBase
"FORMNAME"
Usage:
modified
in the specified
procedure.
either
to display the
You
form
can enter as
Form View
at
many
or Table View.
all
be entered or
to
command
option on the
Record Entry
modify
When you
command.
Example:
This query
tells
Volume
6-156
Keyword:
Statistical Operators,
Statistical
Type:
Operator
Purpose:
in a
related form
(i.e.,
in
a set of
is
Operators
all
the
Syntax:
FORMNAME RELATIONSHIP
|
[named
Usage:
To
Relational Statistical
Operators
1.
name of
by the name
count of
the relationship.
highest of
lowest of
2.
named
to the relationship if
necessary using
operator.
criteria in parentheses.
3.
Insert
4.
The
lowest of,
mean
of,
and
mean of
sum of
sum
count
of,
highest of,
of.
ASCII
Number
fields,
ASCII
sum
are used
records,
mean
lowest of
field value.
on number
in the set
fields.
of related
in
Each Relational
Statistical
Operator
is
treated as a separate
6-157
Volume
DQL LEXICON
Relationships
Keyword:
Relationships
Type:
Concept
Purpose: A Relationship
whether
in the
is
a link between
same form or
in
two
are related,
different forms.
mean
of,
sum of
When
other group.
in the
related
is
by a
link entered
more
it
can be used
in different
same
is
this
Relationships" in Volume 2,
Chapter 2. Form Definition
and Relationships.
procedures
whenever necessary.
An ad-hoc
relationship
creating a query.
is
a relationship that
is
defined while
used
procedure
Usage:
in
which
it
is
it
defined.
is
field, a
constant value, or
list
item, or as a
Once
a relationship
Operators
let
is
DQL Relational
established, the
if
the query
is
processing
in the related
CUSTOMERS
sum
sums
of
the
record that
is
is
covered
in a
Volume
6-158
Keyword: reorganize
Type:
Command
Control
status, restore
reorganize
Usage:
"FORMNAME
"
When
in
is
reorganized,
and
all
a constant or a variable,
must be
quotes.
a form
last
db
all
Form
Definition
Form Definition.
recreated.
If the
in the
On
LAN:
LAN
command
the
form
to a consistent status.
if
another user
DataBase displays
message
the
is
is
currently
command,
this
command
at brief intervals.
procedure during
When
error
this time,
If
you want
becomes
to abort the
the computer.
available,
DataBase
Volume
2,
Chapter
4,
System Administration.
conflicts
and Multi-User
Locking Options.
Example:
reorganize
run report
This query
2)
When
tells
"CUSTOMERS"
"PRINT INVOICES"
the reorganization
procedure.
6-159
Voluine 3
DQL LEXICON
Report Format
Type:
Concept
tells
DataBase how
DQL
Procedure.
titles,
text generated
by a
how
and other
that tell
DataBase
Commands
are:
Form
move
To
insert a field in a
report format,
A sample report that indicates which elements in the output are controlled
by various Formatting commands is shown below. For complete
information on Report Formatting refer to Chapter 5 in this manual.
header
.footer
Marketing Departnent
*-
.group header
Departnent Total
Grand Total
Figure 6-2
Volume
Sample
itens
.group trailer
.end
Page Z
Commands
6-160
db
Keyword:
restore
db
Type:
Control
Command
Purpose: The
(restore database)
restore
db command
recreates a database.
you
any errors
Syntax:
Usage:
restore
db
When
db command, DataBase
and how you want
displays
on which
to
handle
that
backup db command,
after
command
it
is
or Maintenance
restore a database,
last
all
menu
option.
On
LAN
if
another user
is
currently
db command,
message
the
is
this
command
If you want
you must reboot
at brief intervals.
procedure during
When
permanently erased.
LAN:
this time,
becomes
to abort the
the computer.
available,
DataBase
procedure. See
for
Volume
2,
Chapter
4,
System Administration.
conflicts
and Multi-User
Locking Options.
Example:
backup db
restore db
is
complete, begin the procedure to restore the database from the backup
copy.
6-161
Volume 3
DQL LEXICON
run procedure
Control
Command
program
run procedure
"PROCEDURE NAME"
Usage:
When
the procedure
is
resumes with
Example:
Running Procedures
in this
manual.
This query
tells
Volume
6-162
Keyword: seconds
Type:
Syntax:
Returns:
Time Function
in
24-hour format.
seconds(TIME VALUE)
An
00
to 59.
Examples: seconds(09:15:34)
Returns:
34
seconds(02:53:20)
Returns: 20
seconds(CHECK-ouT time)
Returns the seconds value
for
6-163
Volumes
DQL LEXICON
Secondary Form
Keyword: Secondary Form
Type:
Concept
Purpose: A form
Form
is
called a
Secondary
form.
Usage:
related to another
form by
Primary Form
a Secondary
is
called a
form
is
either a
form related
Secondary form.
to the
form related
to
When
in a
mean
of. or
The
in
another
lowest of.
records
if
sum
all
of)
is
count
of.
highest of.
in
relationship level
(i.e..
etc.).
all
related records in
relationship level.
Prinary Forn
Secondary Forn
Tertiary Fern
Tertiary Forn
Figure 6-3
Volume
Secondary Forn
- Forms and
Tertiary Forn
Tertiary Forn
Relationship Levels
6-164
Keyword:
Selection Criteria
Type:
Concept
Purpose:
In a quer>',
you can
tell
DataBase
some of
the records.
The
limiting
for
The
selection criteria
field in
processed.
CUSTOMERS
for
tells
DataBase
greater than
500
in the
with
CUSTOMBRS
ACCOUNT balance
in
which selection
field.
criteria
must be enclosed
in
parentheses:
Criteria
must be enclosed
in
parentheses
in a
Example:
for
CUSTOMERS
with
(sum
of
INVOICES order
whose
related
tells
INVOICBS
than 500.
2.
When two
sets
or operators, the
criteria
must be enclosed
in
parentheses to clarify
the meaning.
Example:
for
CUSTOMERS
that
is
6-165
tells
New York
DataBase
or
New
to
Jersey
CUSTOMBRS who
live
Volume
DQL LEXICON
Sin
Keyword:
sin
Type:
Trigonometric Function
Purpose: The
radians.
Syntax:
sin(NUMERIC VALUE)
Returns:
numeric value.
Examples: sin(2.53)
Returns:
0.574172
sin(-3)
Returns:
Volume
-0.14112
6-166
Keyword:
Type:
Trigonometric Function
expressed in radians.
Syntax:
Returns:
sinh(NUMERIC VALUE)
numeric value.
Examples: sinh(2.53)
Returns: 6.2369235
sinh(-4.4)
Returns: -40.71929
6-167
Volume
DQL LEXICON
Sorting
Sorting lets you process records and generate the resulting output in either
ascending or descending order based on the values in the specified field.
The
in
Number:
Date: earliest
Time:
Choice: lowest
least to greatest
numerical value
least to greatest
to latest date
Example:
for
to highest
STATES
list
records
STATE NAME
end
this
numbered choice
in
Order
STATE NAME
Alabama
Alaska
Arizona
Wyoming
The
STATE NAME
The output
is
in
reverse
reversed:
STATE NAME
Wyoming
Wisconsin
West
Virginia
Alabama
Volume
6-168
Keyword:
spellcurrency
Type:
Spell Function
a numeric value.
Syntax:
Returns:
Examples
spellcurrency(NUMERIC VALUE)
text value
spellcurrency(36.25)
Returns: Thirty Six Dollars and 25 Cents
spellcurrency(210.00)
Returns: Two Hundred Ten Dollars and 00 Cents
spellcurrency(SALARY)
Returns the spelled-out currency amount in the salary
field for every record that is processed. If a record
contains the value 605.75, the function returns Six
Hundred and Five Dollars and Seventy-Five Cents.
6-169
Volume
DQL LEXICON
spelldate
Keyword:
spelldate
Type:
Spell Function
Purpose: The
Syntax:
Returns:
common
form.
spelldate(DATE VALUE)
text value.
Examples: spelldate(07/01/89)
Returns: July 1, 1989
spelldate( 12/31/89)
Returns: December 31, 1989
Volumes
6-170
Keyword: spellmonth
Type:
Spell Function
name
(January) to 12
(December).
Syntax:
spellmonth(NUMERIC VALUE)
Returns:
Usage:
The
text value.
and 12
(inclusive).
Examples: spellmonth(7)
Returns:
July
spellmonth(month(1 2/31/89)
Returns:
December
of INVOICES date))
Returns: The name of the month that corresponds to
the value in the most recent invoice's date field.
If the most recent INVOICES record contains the
value 10/31/89 in the date field, the function
returns October.
spellmonth(month(highest
6-171
Volume
DQL LEXICON
spellnumber
Keyword: spellnumber
Type:
Spell Function
numeric value.
Syntax:
spellnumber(NUMERIC VALUE)
Returns:
Usage:
text value.
to
2,147.483.647.
Ninety Nine.
Examples: spellnumber(3.45)
Returns: Three
spellnumber(323.45)
Returns: Three Hundred Twenty Three
spellnumber(cusTOMER
#)
Volume
Hundred Twelve.
6-172
Keyword: spellweekday
Type:
Spell Function
name
(Monday)
to 7
(Sunday).
Syntax:
Returns:
spellweekday(NUMERIC VALUE)
text value.
Examples: spellweekday(5)
Returns: Friday
spellweekday(weekday(1 2/31/89)
Returns:
Sunday
6-173
Volume
DQL LEXICON
sqrt
Keyword:
Type:
Scientific Function
See Also
power
Purpose: The
value.
Syntax:
sqrt(NUMERIC VALUE)
Returns:
Usage:
numeric value.
Examples:
is
is
positive value.
If
unpredictable.
sqrt(9)
Returns:
sqrt(16)
Returns:
Sqrt(FLOOR SPACE)
Returns the square root of the value in the floor
SPACE field for every record that is processed. If a
record contains the value 16000 in the floor space
field,
Volumes
6-174
Statistical
Keyword:
Statistical
Type:
Operator
Purpose:
Statistical
statistical
Operators
Operators (shown
at right) are
used to generate
list
items in a query.
Syntax:
FIELDNAME
statistical
operator
Statistical
Usage:
To
Operators
Item
by a colon.
1.
2.
3.
After the
last
max
mean
min
std.dev.
std.err.
You may
If
many
use as
fields.
each by a space.
Statistical
variance
statistical
sum
Each
query.
one
in the
Operator
is
you must
name.
Lexicon.
6-175
Volume
DQL LEXICON
std.dev.
Keyword:
Type:
Statistical
Purpose: The
Operator
end of a
value
Syntax:
summary
area at the
report.
Returns:
Usage:
Standard deviation
numeric value.
set
of data
is
(68% of
is
contained
in a
in the first
standard deviation).
The
To
Example:
for
CUSTOMERS
field area.
list
with
records
last name in order
list
ACCOUNT BALANCE
item
sum
std.dev.
end
This query tells DataBase: 1) Process
have a value greater than $500 in the
the customers by
LAST NAME
all
the
CUSTOMERS
ACCOUNT BALANCE
in alphabetical order.
records that
field.
2) List
3) List each
customer's ACCOUNT balance amount, the sum of these amounts, and the
standard deviation in the report output.
LAST NAME
this
ACCOUNT BALANCE
Adams
$595.00
$725.00
$865.00
$525.00
$675.00
Cooper
Evans
Hill
Ivers
Volume
IN
DATA SET
$3,385.00
$129.88
6-176
Keyword:
std.err.
Type:
Statistical
Purpose: The
Operator
of items)
in a set
statistic in the
Syntax:
value
number
summary
Returns:
Usage:
Standard error
numeric value.
of data;
if
is
same data
The
may
mean
be considered to be
members of
the
set.
Quick Reports. To
Example:
for
list
CUSTOMERS
list
in
field area.
with
records
LAST name
in
order
ACCOUNT balance
end
item
sum
std.dev. std.err.
This query tells DataBase: 1) Process all the CUSTOMERS records that
have a value greater than $500 in the ACCOUNT balance field. 2) List
the customers by last name in alphabetical order. 3) List each
customer's ACCOUNT balance and include the standard deviation,
standard error, and the sum of all the account balance amounts in the
report output. The output from this query might look as follows:
LAST NAME
ACCOUNT BALANCE
Adams
~$595T00
$725.00
$865.00
$525.00
Cooper
Evans
Hill
$675.00
Ivers
6-177
IN
IN
DATA SET
DATA SET
$3,385.00
$129.88
$58.09
Volume 3
DQL LEXICON
sum
Keyword: sum
Type:
Statistical
among
value sum
Syntax:
Operator
Returns:
Usage:
numeric value
where
it
appears
defined by
the
sum
in the report
format.
statistical
its
position as follows:
operator
Running
on
through the
total
Items:
Running
Group Header:
Group Trailer:
Not applicable
Sub-total for group
item on
End:
Report grand
CUSTOMERS
list
with
total
sum
of.
among
last
for
sum and
sum
Footer;
operator
Not applicable
Running total through
Report Header:
Header:
Example:
There's an important
difference hetv,een the
is
processed,
sum of returns
total
records
item
sum
end
This query tells DataBase: 1) Process all the CUSTOMERS records that
have a value greater than $500 in the ACCOUNT BALANCE field. 2) List
the customers by last name in alphabetical order. 3) List each
customer's
look as follows:
LAST NAME
ACCOUNT BALANCE
Adams
$595.00
$725.00
$865.00
$525.00
$675.00
Cooper
Evans
Hill
Ivers
$3,385.00
6-178
of
Keyword: sum
Type:
of
named.
list
item
summary
in a related
form.
The
result
can appear as
in the detail
all
in
the
report.
Syntax:
Returns:
Example:
numeric value.
for
CUSTOMERS
There's an important
difference between the
;
statistical
records
LAST NAME in order
list
sum
of
operator
of.
among
sum of returns
of the values in the
processed,
the total
specified field
among
the
records.
LAST NAME
this
Adams
$595.00
$725.00
$865.00
$525.00
$675.00
Cooper
Evans
Hill
Ivers
you want
sum
This query tells DataBase: 1) FVocess all the CUSTOMERS records and
list each customer's last name in alphabetical order. 2) For each
CUSTOMERS record processed, find all the related records in the
INVOICES form (those that have the same CUSTOMER #). 3) List the sum
of the ORDER total field for each customer in the set of matching
If
sum and
sum
end
INVOICES
operator
to include the
sum of
this
the
sum
6-179
of
item
sum
Volume
DQL
LEXICON
tan
Keyword:
tan (tangent)
Type:
Trigonometric Function
in radians.
Syntax:
tan(NUMERIC VALUE)
Returns:
numeric value.
Examples: tan(2.53)
Returns:
-0.701292
tan(-1.89)
Returns: -3.025665
Volume
6-180
Keyword: tanh
(hyperbolic tangent)
Type:
Trigonometric Function
angle expressed
Syntax:
Returns:
in radians.
tan(NUMERIC VALUE)
numeric value.
Examples: tanh(2.53)
Returns:
0.987388
tanh(1.45)
Returns; -0.895692
6-181
Volume
DQL LEXICON
temp
Keyword: temp
See Also: assign, define,
global, variable
Keyword
Type:
Syntax:
Usage:
NAME
Tiie iceyword
temp
used
variable
is
to store a value
procedure.
By
procedure.
A global
another.
To
variable
must be defined
Example:
define
for
its
INVOICES
with
ORDER total
;=
:=
(ORDER total
(ORDER TOTAL
0.15)
temp DISCOUNT)
end
This query
DISCOUNT
TOTAL
of the
field.
to store a
4)
DISCOUNT
Volume
6-182
DAT
textpos
Keyword:
textpos
Type:
Text Function
first
position of a substring in
Syntax:
Returns:
An
Usage:
substring
is
contained
distinction
is
substring
If the
is
returned.
substring
returns 0.
is
not contained
function
textpos("DataEase International
Inc.", "national")
Returns: 15
textpOS(BOOK
TITLE, "wi"),
Returns the
first
6-183
Volume
DQL
LEXICON
timeampm
Keyword: timeampm
Type:
Time Function
24-hour format
appropriate
Syntax:
to a
AM or PM designation.
timeampm(TIME VALUE)
Returns:
of either
Usage:
AM
or
PM.
AM.
to
to
:59:59 to
23:59:59
toPM.
01:53:12
timeampm(1
Returns:
1:1
PM
0:30)
11:10:30
AM
timeampm(CHECK-ouT
time)
Volume
6-184
Concept
is
you
enter.
in the
you
physically enter the data into each form in record entry mode.
Because
it
is
maintenance.
Usage:
it is
processed by a predefined
DQL
is
Procedure that
in Chapter 4 of
manual demonstrates the use of transaction processing in
a mail-order business that uses a special Order Entry form to
this
shown below).
DQL LEXICON
unlock
Keyword: unlock
Type:
Processing
Command
command
LAN
is
when running
only functional
Syntax:
unlock
all files
The unlock
file
selected record
command
all files
by the procedure.
If
unlock
statement
You may
The unlock
file
command
lock
command.
In a
data
lock forms on a
command.
all
in
is
specified
unlock
file
command
lets
all
you unlock
the record
locking rules
are overridden by an
unlock
If the default
unlock
all files or
file
command,
is
it
is
selected.
may
take place.
By
LAN:
On
LAN
if
another user
at brief intervals.
procedure during
->
currently
While
this
message
command
Volume
is
command, DataBase
this time,
6-186
When
LAN:
becomes
available,
DataEase
See Volume
procedure.
for
2,
Chapter
4.
System Administration.
conflicts
and Multi-User
Locking Options.
Usage:
filesorms.
at the start
LAN
If neither
of these
all files or
commands
command
commands are
query.
in the
unlock
appears
appears
Example:
lock form
for
INVOICES shared
CUSTOMERS
with
of
INVOICES
records
LAST NAME
(sum
list
ACCOUNT BALANCE
unlock selected record
end
for
CUSTOMERS
with (highest of
INVOICES
end
tell DataEase: 1) Lock the INVOICES form so other users can
view records but cannot add, delete or modify INVOICES records during
This query
whose
CUSTOMERS
records
INVOICES
For each record selected, list the customer's last name and account
BALANCE. After each record is listed, unlock the record before continuing
to the next part of the query.
Locking the INVOICES form at the start of this procedure prevents other
users from entering new records that might alter the sum of calculation.
Locking and unlocking each CUSTOMERS record as it is listed prevents
the ACCOUNT BALANCE information from being modified by another user.
6-187
Volume
DQL LEXICON
unlock db
Keyword: unlock db
Type:
Control
(unlock database)
Command
LAN
is
when running
db
only functional
db command;
it
unlocks a
locked database.
Syntax:
unlock db
Returns:
database
On
LAN:
unlocked.
is
LAN
if
another user
is
currently
db command.
this
command
at brief intervals.
procedure during
When
this time,
becomes
available,
DataBase
See Volume
2.
Chapter
4.
System
There's an important
dijference between the unlock
Processing command and the
command;
it
unlocks the
whole database.
Once
Usage:
a database
locked
who
user
Example:
until
lock
db
is
db command it remains
db command is executed or until the
lock db command exits from DataBase.
an unlock
initiated the
This query
tells
CUSTOMBRS
3)
When
DataBase:
1)
Lock
2) Display the
PRINT INVOICBS
Volume
6-188
upper
Keyword: upper
See Also:
Type:
Text Function
firstc.firstlast.
midw.
textpos.
uppercase.
Syntax:
Returns:
upper(TEXT VALUE)
The
all
Examples: upper("DataEase")
Returns:
DATABASE
upper("Washington D.C.")
Returns:
WASHINGTON
D.C.
Upper(LAST NAME)
Returns the value
function returns
6-189
HOLMES.
Volume
DQL LEXICON
value
Keyword:
value
Type:
Keyword
When
compares
is
component of
processing a case
the case
command
command, DataBase
appear
query.
in the
comparison,
When DataBase
executes
it
reaches the
the actions
all
between
that value
Interactive
true,
is
first true
Mode.
DataBase
the
Syntax:
end command
case (EXPRESSION)
COMPARISON
value
ACTION SERIES1.
[value
COMPARISON
ACTION SERIES
[value
COMPARISON N
2.1
ACTION SERIES N]
[others
OTHERS ACTION
SERIES.]
end
Usage:
others
is
used,
it
must follow
all
keyword
are optional.
If
values.
Example:
"FRANK"
menu "ADMINISTRATION"
:
call
others
call
menu "MAIN"
end
This query tells DataBase: If the current user is Frank, display the
Administration menu. If the current user is anyone other than Frank,
display the
Volume
Main Menu.
6-190
Keyword:
variance
Type:
Statistical
Operator
mean
summary
sum
mean
value)
in
statistic in the
report.
Syntax:
VALUE
variance [other
Returns:
Usage:
Variance
statistical
operators]
numeric value.
is
also be used in
in
a set of data.
Quick Reports. To
Example:
for
list
field area.
CUSTOMERS
with
records
LAST NAME in order
list
ACCOUNT BALANCE
end
item
mean sum
variance
This query tells DataBase: 1) Process all the CUSTOMERS records that
have a value greater than $500 in the account balance field. 2) List the
customers by last name in alphabetical order. 3) List each customer's
LAST NAME
this
variance of
all
the
ACCOUNT BALANCE
Adams
$595.00
$725.00
$865.00
$525.00
$675.00
Cooper
Evans
Hill
Ivers
6-19!
IN
DATA SET
$677.00
$3,385.00
$16,870.00
Volume
LEXICON
DQL
variable
Keyword:
variable
Type:
Concept
Purpose: A variable
is
In a query, a variable
any type of
Often a variable
is
field
except a Choice
total
temp
when adding
column of
figures).
in the
(like a
The
query;
stored
it is
Usage:
value.
is
initial
The
status of a variable
is
2.
another. In order to
do
its
current
this, the
3.
as current date,
which
it
is
used.
procedure.
There
is
a separate entry
in this
groups.
Volume
6-192
DAT
weekday
Keyword: weekday
Type:
Date Function
(Monday)
to 7
spellmonth. spellweekday,
year, yearday. yeanveek
(Sunday).
Syntax:
Returns:
weekday(DATE VALUE)
An
integer value
from
to 7.
weekday(DATE)
Converts the value in the date field into an integer
from 1 to 7 for every record that is processed. If a
record contains the value 10/31/89 (a Tuesday),
the function returns 2.
6-193
Volume
DQL LEXICON
while
Keyword:
while
Type:
Procedural
Purpose: Like
the if
Command
command,
the while
command
executes a series of
command,
the if
in
which actions
the while
command
if
is
Unlike
true.
When
command. DataBase
condition
If the specified
is
true.
DataBase executes
keyword do
until
it
the
all
reaches the
is still true,
action
Syntax:
while
foUowine
the
If the
series
end command
CONDITION do
ACTION
ACTION 2
1
ACTION N
end
Usage:
Brequently, a while
that
is
command
counter).
Any
Volume
(i.e.,
command
(i.e., it
must
6-194
Example:
define
assign temp
SERIAL
:=
while
list
records
jointext
("SYSTEM DISK
",
temp SERIAL)
end
This query
SERIAL.
tells
2)
DataEase:
1)
Give (assign) an
is
labels,
5)
words
SERIAL
SYSTEM DISK
variable.
4)
to the
number
When
6-195
Volume
DQL LEXICON
with
Keyword: with
See Also: and,
Type:
Syntax:
form or
with
Usage:
in
a relationship.
(SELECTION CRITERIA)
or, Selection
Criteria
Operator
tells
DataBase
to process
Example
1: for
This statement
CUSTOMERS
tells
2: delete
tells
relationship (the
Volume
$500
in the
CUSTOMERS
ACCOUNT balance
records in INVOICES
< 01/01/80)
with (DATE
This statement
with
Example
with operator.
records
field.
named "OUTDATED"
INVOICES
6-196
Keyword: vear
Type:
Date Function
spellmonth, spellweekday,
yearday, yearweek
year(DATE VALUE)
An
selected in
is
year(DATE)
Converts the year portion of the value in the date field
into an integer from
to 99 for every record that is
processed. If a record contains the value 12/31/89 in
the DATE
6-197
field,
Volume
LEXICON
DQL
yearday
Keyword: yearday
See Also: current, date, day,
Type:
Date Function
spellmonth, spellweekday,
year, yearweek
Syntax:
yearday(DATE VALUE)
Returns:
An
integer value
selected in
is
yearday(DATE)
Converts the day portion of the value in the date field
into an integer from 1 to 366, representing the Julian
date, for every record that is processed. If a record
contains the value 12/31/88 (A Leap Year)
DATE field, the function returns 366.
Volume
in
the
6-198
Type:
Date Function
week number
(1-53) of
spellmonth, spellweekday,
year, yearday
a date value.
Syntax:
Returns:
yearweek(DATE VALUE)
An
selected in
Usage:
Week
1,
in
December 30th
Week
is
Week
53
is
2. etc.
In a
December
also counted in
1st -7th as
non-Leap
31st. In a
Week
53
(all
Leap
dates
yearweek( 12/30/89)
Returns:
yearweek(30/1 2/89)
Returns: 52 (European Format)
yearweek(89/1 2/30)
Returns: 52 (Metric Format)
yearweek(DATE)
Converts the day portion of the value in the date field
into an integer from 1 to 53, representing the week of
the year, for every record that is processed. If a
record contains the value 12/30/87 (A Leap Year)
the date field, the function returns 53.
6-199
in
Volume 3
Database Status
* multiplication sign
INDEX
=
3:6-16
(equal)
1:3-14
2:A-2
cache buffer
effect on performance
optimum
2:D-3
2:A-2
size
2:2-64, 2:2-73
calculate
call
menu
call
program
calling
2:3-3,3:6-35
3:6-36
menu
3:6-39,3:6-190
3:6-40
ceil
Chain menu
Change
3:6-16
2:3-3,2:3-8.2:3-29
the Database
Name
2:5-4. 2:5-57
1:1-3
1:1-3
3:6-32
3:6-135
not
compatibility with version
3:1-3, 3:6-62
3:6-50
3:6-102
percent
3:6-144
configuration
Type
2:2-52
2:2-55
2:2-52
field
advantages
3:3-5. 3:6-45
1:1-4
commands
3:4-1.3:6-46
backup db
3:6-31
2:3-9
call
menu
2:2-55
call
program
2:2-54
db
2:2-102- 2:2-104
3:6-44
item
1:4-27
Choice Description
3:6-43
count
3:6-63.
3:6-194-3:6-195
constant value
3:6-35
3:6-36-3:6-37
3:6-57
status
3:6-90
import
2-55
install
2-55
lock
2-52
record entry
3:6-156
during Import
5-14
reorganize
3:6-159
2-53
restore
2-55
run procedure
choice
1:,
choice
2: etc.
choice numbers
:2-34
:2-35
2-55
ordering
2-53
limitations
2:2-55.2:2-102- 2:2-104
modify
2:2-102- 2:2-104
modifying choice values
optional choice type
name
2:2-54
2:2-52 -2:2-53
selecting a choice
Columnar format
:3-4.
:3-28.
:3-35
1:3-36
3:5-4-3:5-5,3:5-8 -3:5-11
trailers
line length
spacing
statistics
commands
3:5-12. 1:3-36
3:5-9. 1:3-36
3:5-8
3:5-12
3:4-1
list
3:4-1
restrictions
3:4-1
types
3:4-1
comments
comparison operators
< (less than)
<=
2:4-27
2:4-33
Choice
2.
conditional processing
Field
3:6-17
or equal to)
between
2:3-12
3:4-14-3:4-15,3:6-38
case
3:6-37
3:6-17,3:6-41
3:3-5,3:6-15,3:6-42
3:6-15
3:6-15
3:6-99
appl
3:6-113-3:6-114
db
3:6-161
db
3:6-162
3:6-188
unlock db
2:3-3.3:1-3.3:4-1.
control procedure
3:4-21 -3:4-24,3:6-46
High
level
3:4-2
example
2:4-34
control strings
convert an application
2:5-56
2:5-37, 2:5-46
2:5-46
conversion procedure
dBASE
files
2:5-37. 2:5-46
2:5-56
2:5-49
converted
2:5-56
Lotus 1-2-3
Lotus
Symphony
2:5-56
2:5-37.2:5-46
2:5-37, 2:5-46
2:5-56
2:5-55
messages displayed during conversion
2:5-37. 2:5-46 2:5-56
Paradox
2:5-54
2:5-51
2:5-50
2:5-52
DQL Procedure
1:3-50
1:3-51
commands
INDEX
exception
2:2-100
files
2:5-16
during Import
3:6-67
exit
EXIT menu
in
Form
in
Record Entry
Definition
exp
expanded memory
effect on performance
use of
2 2-18
1
2-18
3 6-68
2:A-3, 2:D-3
2:A-3
1:3-4
1:3-28,3:5-5.3:5-27
Export formats
DIE
3:5-27, 3:5-39
3:5-27, 3:5-35
MailMerge
3:5-27
MultiMate
Variable Length ASCII
WordPerfect
3:5-27.3:5-30
3:5-36-3:5-37
3:5-27,3:5-31 -3:5-32
3:5-27
exporting data
set
2:2-26
calls
2:A-3
extended character
program
3:5-38
3:5-33-3:5-34
GrafTalk
field
1:2-17-
1:1-7.
Export
external
2:2-17
INDEX
inconsistent form
2:2-14
nested actions
3:4-6,3:6-134
1:3-3. 1:3-20
order
ordering
3:6-135
in
null value
3:6-33
others
1:1-16
output
not
1:3-20
Quick Reports
3:6-38,3 :6-138
3:5-1.3:5-40,3 5-59,
Number
3:6-
2 2-45
Type
Number field
compared
2 2-46
2:2-45
to
2 2-46
Numeric String
digits of precision
2:
2:5-14, 2:5-26
during Import
2-45
2 5-27
Fixed Point
2:
2-45
2 2-45
Floating Point
in
139-3:6-143,3 :6-l60
3 6-52
current page
Field
1:3-13
naming conventions
Record Entry
2-34
2 2-45
Integer
2 2-97
2 2-45
modify
system provided characters
3:5-53. 3:5-69
page break
page dimensions
page length
page numbering
3:5-70.3:5-76
3:5-76
3:6-52
in a report
3:5-69
page size
page width
3:5-76
2:3-23
parameter substitution
1:1-16
description of
1:1-8- 1:1-9
2:2-21
paste text
3:6-144
percent
Numeric String
Field Type
2:2-43
2:2-43
formatted
2:2-44
2:2-44
2:2-44
other format
phone no.
2:2-43
2:2-43
2:2-44
special punctuation
2:2-43
2:2-44. 2:2-46
2:2-46
field
2:5-14
during import
2:2-44
in calculations
Record Entry
modify
1:2-32
in
:2-33
2:2-97
2:3-24
2:4-19
parity
password
numeric keypad
2:D-1 -2:D-3
performance factors
3:6-145
periods
2:2-10
permanent relationships
number
when defining configuration
power
port
2:4-17
3:6-146
3:5-2
predefined format
2:2-10.2:2-109
Predefined Relationship
3:6-147
presentvalue
2:2-100
modify
1:2-42-
primary form
3:3-3-3:3- 4,3:6-148.3:6-164
form definition
example
2:5-6
One-time Import
3:6-42-3:6-44,3:6-136
operators
assignment
3:6-14
boolean
3:6-25
comparison
grouping
3:6-15- 3:6-17
3:6-81
3:6-82.3:6-91
3:6-93
sorting
name
optional relationship
names
XV
1:3-49
an example
in
1:3-48
Quick Reports
3:5-1.3:5-70-3:5-82
CPI spacing
3:5-78
3:5-77
3:5-78
2:2-54
disk
2:2-105.2 :2-109.
examples
2:2-127
2::2-129
highlights
3:^
:6-i37
in
2:2-87
3:2-4. 3:2-27
3:6-94
3:6-22. 3:6-26
relational
or
3:6-92
3:6-25
logical
2:2-86-2:2-87
1:3-4,1:3-39,1: 3-41,3:5-73.3:5-82
Quick Reports
3:5-80
3:5-82
3:5-78
1:3-4
mode
INDEX
optional relationship
specifying ranges as
1:3-13
selection criteria
Text fields
wild card characters
2:2-10
1:3-12
predefined
1:3-12
relationship levels
specifying form
2:2-10,2:2 109,3:6-158
3:6-148
form
using more than three Match
view a relationship
Relationships form
1:2-79
1:2-77, 1:2-79
lock nothing
:2-77- 1:2-78
lock records
2:5-22
2:2-95
renaming a database
2:5-4, 2:5-57
3:6-159
1:2-70,2:2-10-2:2-11.
reorganize a form
2:2-132-2:2-133.2:2-138
in
LAN
1:2-44, 1:3-22
1:2-42
relational database
relational database
-).
'
3:3-9
any
Derivation Formulas
3:3-10. 3:4-1
1.
3:4-20
shared
3:6-22
report definition
DOS
named
relational statistical operators
highest of
lowest of
mean of
sum of
3:6-121
relationship concepts
form names
relationships
active
ad-hoc
definition
delete a relationship
form names
in a lookup formula
levels
many-to-one
Match fields
modify a relationship
:3-32
3:5-6.3:5-42.3:6-160
1:3-29
1:3-4,1:3-28. 1:3-35-1:3-36
Columnar
Custom
1:3-4. 1:3-24
1:3-4, 1:3-24
3:6-179
Export
Formatting
_.--iu^
1:3-4,1:3-28
2:2-1 12
GrafTalk Chart
1:3-4,1:3-28
3:6-158
long:text fields
1:2-45.2:2-111
2:2-10.2:2-109,3:4-12,
3:6-20-3:6-21.3:6-158
advantages
between forms
3:5-
3:6-84
3:6-118
2:5-3
3:5-70-3:5-76
report formats
3:6-51
count of
file
3:6-157
1:3-52
1:3-52- 1:3-53
filename extension
report destination
2:2-68
3:6-132-3:6-133
one-to-many
1:2-81
exclusive
"^
3:6-26
name
2:2-23
'
all
relationship
2:2-132
management system
definition
in
2:2-133
replace a field
1:1-4
Relational Operators
2:2-138
considerations
procedure
when to reorganize
1:3-17
definition
1:3-17
2:5-4. 2:5-58
1:2-78
refresh
2:2-125
2:2-130
reorganize
2:2-110.2:2-116-2:2-126
form
Quick Reports
2:2-111
fields
the Database
Remove
1:2-9
related
2:2-112
names
the Relationships
2:2-129
permanent
1:3-15
criteria
referential integrity
2:2-127
names
2:2-109
2:2-10
2:2-10.2:2-109
- -
Commands
1:3-24
1:3-4, 1:3-28
Commands
3:6-164
REPORT menu
-''
'
2:2-113-2:2-115
2:2-130
TO.
109
-- '"^
3:3-1
1:3-27,3:5-42,
3:5-49,3:5-51
30
report margins
1:3-4,1:3-28
system defined
Template
See also Format
7
_._-ii2:2-65
0-'>
2:2-42
1:3-4, 1:3-28
Mailing Labels
Record Entry
Report Formatting
1:3-27,1:3-29
in
Commands
3:5-77
Record Entry
1:2-17, 1:2-26
report ordering
for
Choice
report output
report spacing
fields
2:2-55
3:2-14
3:5-78
XVlll
7.1:1-9
user restrictions
name
when changing a database
when defining menus
when defining users
when removing a Database
selection criteria
starting
2:5-4
2:3-6
command
Start-up menu
2:4-8
statistical
2:5-4
item
3:6-119
max
mean
3:6-120
min
3:6-176
std.dev.
3:6-177
std.err.
3:6-178
3:6-165.3.6-196
2-2-64. 2:2-66
sequence
sequenced fields
1:2-82
9-4-19-2:4-21
pnnters
a note about serial
2.4-19
stop bits
word length
2:4-19
1:1-7
1:1-7
signing on
3:6-166
sin
3:6-167
sort
2:A-4
memory
in
in
Soundex search
source form
l-->-8.
1:2-58-1:2-60
3:5-12
procedures
Quick Reports
2:3-17
as a function type
1:3-21
Quick Reports
in
deviation
See also standard
in
1:3-21
Quick Reports
Subform
special effects
2:4-34
2:4-34
spelldate
spellmonth
spellnumber
spellweekday
1:3-14
3:6-169
3:3-10.3:4-
3:6-169
in
3:6-172
spellnumber
3:6-173
spellweekday
3:6-174
sqrt
3:6-176
standard deviation
3:6-177
3:2-3. 3:2-6
2:2-28
1:3-3.3:6-178
Quick Reports
3:6-171
2:2-31
2-2-27
1:3-21
in
3:6-173
spellmonth
New Procedure
New Report
2:2-28
sum
3:6-172
spelldate
Start
2:2-28
sum of
summary
3:6-171
3:6-170
Start
2:2-28
modify
3:6-170
spellcurrency
standard error
2:2-28
2:2-
Custom Form
examples
spellcurrency
2:4-19
2:2-9. 2:2-27
Automatic Form
Automatic Table
special 2
spell functions
1:3-3.3:6-177
std.err.
2:4-34
selection criteria
specifying ranges as
1:4-4.1:4-11
1:3-3.3:6-176
std.dev.
special 2
1-4^,1:4-12-1:4-13
Import Specifications
Procedures
stop bits
special
1-4-4.1:4-7-1:4-10
Forms
9-5.3 ^-5-10.2:5-13.2:5-17.2:5-32
-^ ^- - 2:4-34
2:3-17
Status report
2:4-34
special
1:3-20-1:3-21
status
3:3-7
operators
sorting and grouping
3:6-126
statistics
3-6-94. 3:6-168
sorting
3-6-101-3:6-102
3:6-157
2:4-19
sinh
3:6-175
operators
3:6-191
protocol
screen
2:3-5.2:4-12
variance
2:4-19
On
9-3-"'
2:4-19
baud
Sign
line options
sum
2:4-19
parity
IG. 1:1-9
2:4-20
additional questions
rate
DataBase
2:3-7
report
7-9-46. 2:4-28
Numeric Strings
3:3-13
syntax scan
Svstem Administration
1:1-14.2:4-1
4-14 2:4-16-2:4-27,
Define Configuration
Define Printers
Define Screen Styles
2.4-35
2:4-34
2:4-37
2:4-42
2:4-7 -2:4-8.2:4-11
Define Users
screen
System Configuration
2:4-36
2:4-32
2:4-13
2:4-14
1:3-3.1:3-10.3:4-1
XX
t'omis
1:2-
Configuration
Dictionary
DOS
filenames
Record Entry
in
Menus
Printers
Relationships
Screen Styles
status
Users
System menus
access from a custom menu
TABLE menu
in
Record Entry
Table View
cursor
movement keys
of records
in
file
tan
tanh
target form
temp
Template format
temporary variable
tertiary
form
Text
delete
Type
Field
Text
field
during Import
in
Record Entry
maximum
length
modify
multiple line
valid data
text functions
firstc
first last
firstw
jointext
lastc
lastfirst
lastw
length
lower
midc
3
1
:3-4.
INDEX
unlock db
3:6-188
in
indexed order
2:3-26
in
order saved
2:5-13
in related
as a function type
update matching
3:6-189
upper
Upper Limit
2:2-6.
;:2-35.
2:2-72
formula syntax
using
Lookup
in
formulas
Record Entry
2-76
modify
view
2:4-6
user
mode
2-55
1:2-8
2-45
2-51
virtual field
2-61
-100
w
weekday
3:6-193
3:6-62.3:6-194-3:6-195
while
wild card character
*
menu
1:2-57. 1:2-62.3:6-6
1:2-57. 1:2-62
1:2-57,3:6-7
2:3-3,2:3-12-2:3-13
name
2-51
:2-53
2:3
:2-23,
2:4-6
as a function type
31.
2-44
2-38
4-26
encryption
1:2-421
2-38
:2-6.
:2-25,
order
field
Users form
user
:2-8.
searching in unchecked
2:2-73
file
2-52
2:2-74
2:2-73
valid formulas
in
2-62
1:2-22,1:2-51-
2:2-74
for limits
Upper/Lower Limit
:2-8,
2:2-74
2:2-100
modify
using constants
forms
in reverse
''-52
file
1
IG, 1:1-1,2:1-1
upgrade information
user
1:4-3. 1:4-33
unlock database
''-23
by record number
3:6-186-3:6-187
unlock
search limitations
1:1-8- 1:1-9
1:2-57
1:2-57.3:6-8
user password
2:4-7
limitations
2:5-57
2:5-58
user-defined forms
1:2-1
1:4-7. 1:4-10
status report
window menu
1:2-7,1:2-57
2:2-33
3:3-4,3:4-3,3:4-19,3:6-196
with
word
length
WordPerfect
export format
2:4-19
3:5-31 -3:5-32
utilities
2:3-20
as a function type
work area
Write Security
1:1-18
2:2-6,2:2-35,
2:2-75-2:2-76, 1:2-41
value
:6-190
3:6-38,
assign
3:5-37
:6-192
3:4-8.
command
3:6-28
3:6-52
current
define
3:6-59
global
3:4-8,3:6-182,3 6-192
temporary
3 6-191
variance
Quick Reports
view a form
1:3-21
in
View
Security
viewing records
2:2-9
year
3:6-197
yearday
3:6-198
yearweek
Yes or No
3:6-199
Field Type
Yes or No field
as a Choice field
in Record Entry
2:2-51
valid entries
2:2-51
2:2-51
2:2-51
1:2-5
2:2-76
2:2-7. 2:2-95
2:5-30
1:2-7. 1:2-51
2-52
xxii
Addendum
The following pages contain
Volume
covered
in
3 of the
that chapter.
Addendum
in the
DOS PATH.
Query
for
CUSTOMERS
list
records
FULL NAME
ADDRESS
CITY
STATE
ZIP
ACCOUNT BALANCE
end
CrossView
lets
different
Addendum
When you
CrossView
select the
A sample
(cont.)
.call
command
to invoke
is
CrossView.
shown below:
Format
.items
end
.call
prexvu
%m
%m
When CrossView
is
When you
press
ESC
to exit
returned to DataEase.
Addendum
DataBase
VOLUME
POS operations,
^^ DataBase
INTERNATIONAL
Revised
90