HP Business BASIC/XL Reference Manual - HP 3000 MPE/iX Computer Systems - Edition 1 (32715-90001)
4- 34
| 8 | Read | Read | 6, 8 |
|| | | |
---------------------------------------------------------------------------------------------
Examples
The following statements show the use of the DBOPEN statement.
90 Database$ = " Clients" !Database name is preceded by two spaces
100 DBOPEN Data_base$,STATUS=S(*)
110 DBOPEN Data_base$,PASSWORD="synergy",STATUS=S(*)
120 DBOPEN Data_base$,PASSWORD=Pw$,MODE=4,STATUS=S(*)
130 DBOPEN Data_base$,PASSWORD=Pw$,MODE=2,STATUS=Status(*)
140 DBOPEN Data_base$,MODE 1,STATUS Status(*)
150 DBOPEN Data_base$,MODE 7,STATUS S(*)
160 DBOPEN Data_base$,STATUS Status(*)
170 DBOPEN Data_base$,PASSWORD "Quanta",STATUS Status(*)
DBPUT
The DBPUT statement adds new entries to a manual master or detail data
set.
The database must be open in access mode one, three, or four (see Table
4-2 in "DBOPEN Statement" for the meanings of these modes). A covering
lock must be in place if mode one is used.
DBPUT...USING... Data will be packed into an internal buffer
from the list of local variables specified in
the PACKFMT statement before writing into the
data set.
DBPUT...FROM... Data will be transferred from the buffer into
the data set.
DBPUT...USING...FROM... Data will be packed into the buffer specified
in the FROM clause using the PACKFMT list that
will then be transferred into the data set.
Syntax
{USING
line_id
} {,}
DBPUT
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.
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.
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.
item_list
The name of an ordered set of data item identifiers,
either names or numbers. The value of each data item is