DBUPDATE [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation
HP Business BASIC/XL Reference Manual
DBUPDATE
The DBUPDATE statement replaces the values of data items in the current
address of a specified dataset.
The database must be open in access mode one, two, three, or four (see
Table 4-2 in "DBOPEN Statement" for more on the meanings of these modes).
DBUPDATE...USING... Data will be packed into an internal
buffer from the list of local
variables specified in the PACKFMT
statement that can update the dataset.
DBUPDATE...FROM... The buffer specified in the FROM
clause is used to update the data set.
DBUPDATE...USING...FROM... Data will be packed into the buffer
specified in the FROM clause using the
PACKFMT can be used to update the data
set.
Syntax
{USING line_id }{,}
DBUPDATE dbname$ {FROM[=]str_var }{;} DATASET[=]dataset
{USING line_id FROM[=]str_var}
[, ITEMS[=]item_list] [, STATUS[=]status_array(*)]
Parameters
dbname$ A string variable whose value is a TurboIMAGE database
name. dbname must be the variable that was passed to a
successful DBOPEN.
str_var The string variable containing the data item values to
be added to the database. The values must be in the
same order as their data item identifiers in the
items_list parameter. The values must be packed into
str_var from their corresponding HP Business BASIC/XL
variables using HP Business BASIC/XL's PACK statement.
line_id A line number or label for a PACKFMT or IN DATASET
statement. The referenced statement is used to
automatically pack data from program variables.
dataset A string expression with a maximum length of 16
characters. Its value is the name of a data set. The
name must be left-justified and, if shorter than 16
characters, must be terminated by a semicolon or blank.
This parameter can also be an integer or short integer
corresponding to the desired dataset number.
item_list The name of an ordered set of data item identifiers,
either names or numbers. The value of each data item is
in the corresponding position in the ordered set of
values contained in str_var. Any search or sort items
defined for the entry must be included in item_list.
Fields of unreferenced items are filled with binary
zeros.
If the item_list is a string variable, the list of data
item names must be left justified in the string.
Individual data item names are separated by commas and
the last is followed by a semicolon or blank. Embedded
blanks are not allowed and names cannot appear more than
once.
The data item_list can contain special symbols such as @
that specifies all data items in the data set. Consult
the Special List Parameter Constructs table in the
explanation of the DBPUT library procedure in the
TurboIMAGE/XL Database Management System for additional
special symbols and their usage.
If referencing data items by number, the first word in
the short integer array must be the total number of
elements in the array. This number is followed by the
unique data item number.
The item_list specified is returned internally by
TurboIMAGE as the current list. Consult the
TurboIMAGE/XL Database Management System for details
about the benefits of using TurboIMAGE's current list.
If the items option is not specified, HP Business
BASIC/XL sets the item_list to "@;".
Examples
The following examples show the use of the DBUPDATE statement.
110 DBUPDATE Db$ FROM S$,DATASET=Ds$,STATUS=S(*)
130 DBUPDATE Db$ FROM S$,DATASET=Ds$,STATUS=S(*)
150 DBUPDATE Db$ FROM S$,DATASET Ds$,STATUS S(*),ITEMS I$
170 DBUPDATE Db$ FROM S$,DATASET Ds$,ITEMS I$,STATUS S(*)
220 DBUPDATE Db$ USING 400; DATASET Ds$
230 DBUPDATE Db$ USING Pack1; DATASET Ds$,STATUS=S(*)
400 IN DATASET Ds$ USE A,B, SKIP 10,D$
410 Pack1: PACKFMT A,B, SKIP 10,D$
The following statements:
100 DBGET Dbase$ USING 200 FROM D$; DATASET = "parts"
200 PACKFMT A,Price,Company$
are equivalent to:
100 PACK USING 200;D$
110 DBUPDATE Dbase$ FROM D$;DATASET="parts"
200 PACKFMT A,Price,Company$
MPE/iX 5.0 Documentation