Google
 

Trailing-Edge - PDP-10 Archives - BB-AI48A-BM - datatrieve/tutor.txt
There are no other files named tutor.txt in the archive.
STEP 1

BEGIN
Welcome to the DATATRIEVE-20 Tutor Program.  This program is
an example usage of Callable DATATRIEVE.  It sends your
commands to Callable DATATRIEVE and then displays the results
which come back.  As a result, the <esc> and <?> keys don't
work as in DTR20.  In DTR20: typing <?> gives you a list of
possible things to type next; typing <esc> gives you a guide
word or completes the field.  In order to keep the differences
straight, all text coming from the Tutor has been separated
by stars. This Tutorial will show you how to use DATATRIEVE to 
display information.  Follow the Tutorial along, it will tell you
what to type.
    Lets start with the SHOW command:
The SHOW command displays information about your DATATRIEVE 
environment.  It can give you the names of objects in the
environment. For example the command SHOW ALL will give the names
of all items in the environment.  Go ahead and try the command,
Type: SHOW ALL

HELP
Oops, how about trying again. Type: SHOW ALL

END
     That was a lot of information!  

PETS

STEP 2

BEGIN
The SHOW command may also be used to only display information about
certain objects in the environment.  You may have notices the titles
DOMAINS, RECORDS, PROCEDURES, PLOTS, etc.  The SHOW command can also
display the names of these restrictive types of objects.  Go ahead and
type SHOW DOMAINS.  Notice how only the domains are shown

HELP
Datatrieve had some problems with that; try typing SHOW DOMAINS again.

END
That was good

PETS

STEP 3

BEGIN
The show command may also be used to show information about a specific
object.  For example, you may have noticed a record named YACHT under
the heading RECORDS.  You can see the RMS definition of this record by
typing SHOW YACHT.  Go ahead and try it!

HELP
This wasn't correct, take another shot at it:

END
Hey your getting good at this!

PETS

STEP 4

BEGIN
Now lets move on to a new topic.  
Printing information on your terminal.  Before we can start
looking at this information, it must be ready to be accessed.
We are going to use the domain named yachts.  You already looked
at its record definition in the last step.  In order to ready the
a domain type ready followed by the domain name.  Go ahead and ready
the domain named yachts.

HELP
Here's a hint, Type READY YACHTS

END
That worked.  You can have more than one domain readied at a time.
In this example we will just stick to the one named yachts.

PETS

STEP 5

BEGIN
The PRINT statement displays information on the terminal.  We can
display all the records in the domain yachts by typing PRINT YACHTS.
This will print all the fields of all the records in the Database,
organized by the primary key.  If the last sentence was too much then
just remember that PRINT YACHTS will tell you everything you have stored
about yachts.  Go ahead and try typing in PRINT YACHTS:

HELP
Are you sure you typed PRINT YACHTS?

END
Whew!, what a lot of information about yachts!

PETS

STEP 6

BEGIN
Since we don't always want to know about all of the yachts in our
database; the PRINT command also allows us to restrict the number of
records which are displayed.  To limit the information we follow the
PRINT YACHTS with a Record Selection Expression (RSE) which tells 
which record we want to look at.  
   For example we may be in the market for a cheap yachts.  We can
display all of the yachts with no price (maybe because their not
for sale, or someone forgot to enter the price) by adding the
clause WITH PRICE = 0 to the end of our print statement.  Try
printing the free yachts.

HELP
Heres a hint. Type PRINT YACHTS WITH PRICE = 0

END

PETS

STEP 7

BEGIN
These RSEs can get quite complicated.   You are allowed to use arithmetic
expressions as well as AND, OR and NOT as well as a number of other
things to link them together.  Just for fun try typing in the following
RSE:
   PRINT YACHTS WITH ((LOA * BEAM > PRICE) AND 
                      (D_P > LOA * 100 + BEAM * PRICE) AND
                      (BUILDER NE "JONES"))
You will probably need to use more than one line.  This is ok, to continue
lines just type a carriage return at a point where you haven't completed
a line (For example if you typed <cr> after PRINT YACHTS then Datatrieve
wouldn't know you wanted more, so it would just print all the yachts.

HELP
Oops are you sure you typed:
   PRINT YACHTS WITH ((LOA * BEAM > PRICE) AND 
                      (D_P > MAX (LOA * 100 + BEAM * PRICE)) AND
                      (BUILDER NE "JONES"))

END
That works fine and dandy

PETS

STEP 8

BEGIN
What about the times when you only want to know a bit about the
yachts, like the builder, length and beam.  Well Datatrieve has
an answer to that too!  If you specify a print list of the fields
you want displayed then only those fields will be displayed.  To
see what I mean type:
PRINT BUILDER,LOA,BEAM OF YACHTS WITH PRICE > 30000

HELP
Oops

END

PETS

STEP 9

BEGIN
The fields which are printed need not be record fields, they may also
be computed.  For example to get a rough idea of the displacement
per square foot of yacht. We can type:
PRINT BEAM,LOA,D_P,(D_P / (BEAM * LOA)) ("DISP PER SQ FT") OF 
      YACHTS WITH (BEAM * LOA) NE 0

END
You may have noticed that the expression "DISP PER SQ FT" was displayed
above the field.  You can title the fields by including the name in
parenthesis.  This name is then placed above the row of numbers.

PETS

STEP 10

BEGIN
Now the tutorial is going to let you try using the PRINT statement
to make your own RSE and PRINT lists.  Go ahead its easy.

HELP
Oops, how about trying again

END
Well, thats the complete tutorial.  For more assistance look
at INTRODUCTION TO DATATRIEVE and assorted documents, or try
typing DTR20 and experimenting around

PETS