next up previous contents index
Next: Adding Records to the Up: AddingModifying, and Deleting Previous: AddingModifying, and Deleting

Entering a Parameter Table

Suppose we want to study the relationship between current and temperature for several shots taken under similar conditions. We have the data in the following table.

Shot Current Temperature
83001 400 2.1
83002 410 2.2
83003 450 3.0
83004 430 2.8
83005 445 2.9

First let's create a database with these values in it. We'll call the database TESCAL, and the parameters SHOT, IP, and TE. All data are stored in character format and cannot exceed 12 characters.

   $ LOCUS
   Database?                       TESCAL
   Edit,Print,Plot,Regress,...?    E
   TESCAL not found.  Create it?   Y
   Parameter?                      SHOT
   Parameter?                      IP
   Parameter?                      TE ; 
   SHOT?                           83001 400 2.1 ;         
   SHOT?                           83002 410 2.2 ; 
   SHOT?                           83003 450 3.0 ; 
   SHOT?                           83004 430 2.8 ; 
   SHOT?                           83005 445 2.9 ; 
   SHOT?                           \X

To create a parameter table:

   Edit option? <AE>:              CP
   New table name? <>:             COOLPLASMAS
   Alias? <>:                      C
To define the parameter names, data formats and lengths:
   Parameter and Format? < >:      SHOT
   Data type? <real>:
    \* Options are:
     1) Integer
     2) Real (or float)
     3) Char

   Data type? <real>:                              I
   Length in bytes (2, 4, or <=132 for CHAR)? <>:  4

   Parameter, format, length? <SHOT>:              IP R 4
   Parameter, format, length? <SHOT>:              TE R 4
   Parameter, format, length? <SHOT>:              COMMENT C 132
   Parameter, format, length? <SHOT>: 

                COMMENT  IP    SHOT         TE

                ; to write parameters to the database.

   Parameter, format, length? <SHOT>:              ;
Specify the permits:
    \* Options are:
     1) Retrieve permission to all
     2) Private access
     3) Define access rights individually

   Select access rights for COOLPLASMAS <D>:       RE
Enter records:
   SHOT? <NODATA>:          83001
   IP? <NODATA>:            400
   TE? <NODATA>:            2.1
   COMMENT? <NODATA>:       "'Good shot; no disruptions.'"
   SHOT? <NODATA>:          ;
   SHOT? <83001>:           83002 410 2.2 "'Medium good shot.'"  ;
   SHOT? <83001>:           83003 450 3.0 """Excellent shot."""  ;

    insert into COOLPLASMAS (SHOT,IP,TE,COMMENT) 
                    values  (25001,800,35,'Good shot; no disruptions.')
Note that character data is entered between "' and '" or between """'s.

(The ; is used to indicate the end of the list of parameters and the end of the individual records. Until the ; is typed, the record is not stored. \X exits from the program.)



Marilee Thompson
Fri Jul 11 17:05:56 EDT 1997