HP 3000 Manuals

UPDATE procedure [ QUERY/V Reference Manual ] MPE/iX 5.0 Documentation


QUERY/V Reference Manual

UPDATE procedure 

Executes an UPDATE command stored as a procedure in the current
Proc-file.

Syntax 

     U[PDATE] procedure name [,character]

For example:

     >UPDATE UPDNAMES

Where procedure name = UPDNAMES

     >U CHANGE,%

Where procedure name = CHANGE and character = %

Parameters 

procedure name         is the name of an UPDATE ADD, UPDATE REPLACE, or
                       UPDATE DELETE command procedure in the current
                       Proc-file.

character              is any printable ASCII character.

Discussion 

You can use the CREATE command to store any of the three forms of the
UPDATE command.  Once the procedure is stored in the Proc-file, you use
this form of the UPDATE command to execute it.  Refer to the CREATE
command for information on creating a procedure.

When you execute the UPDATE procedure, QUERY first checks each line of
the procedure.  If an error occurs, a message is sent and the incorrect
statement in the line is ignored.  All other correct statements in the
procedure are executed.  If the character is included in the command, the
procedure is listed before the execution begins.

Example 

     >F LAST-NAME IS MAYFIELD 
     USING SERIAL READ
     1 ENTRIES QUALIFIED
     >PROC-FILE=PROCX 
     >UPDATE CHANGE 
     WHAT IS THE VALUE OF THE CITY
     >>PETALUMA 
     WHAT IS THE VALUE OF THE STREET-ADDRESS
     >>37 41ST AVE. 
     WHAT IS THE VALUE OF THE CREDIT RATING
     >>8.5 

In this example, the FIND command is used to locate the entry to be
updated.  The procedure named CHANGE (located in Proc-file PROCX)
contains the following:

     U REPLACE,
     CITY="";
     STREET-ADDRESS="";
     CREDIT-RATING="";
     END

When using null values, QUERY prompts for values when the procedure is
executed.



MPE/iX 5.0 Documentation