7 database commands, Database commands – Rice Lake 920i Installation Manual V3.05 User Manual
Page 100

94
920i
Installation Manual
9.1.7
Database Commands
The commands listed in Table 9-13 can be used to
create and maintain databases in the
920i
. Except for
the
DB.DELA LL
command, all of the database
commands require an extension to identify the number
of the database within the memory card and the slot
number of the memory card.
DB.ALIAS
The
DB.ALIAS
command is used to get or set the alias
used by
iRite
programs to reference the specified
database. Each database alias must be unique among
all databases and adhere to the following rules: 8
character maximum; must begin with an alpha
character or an underscore; can only contain A–Z,
a–z, 0–9, or an underscore (_).
Example.
The following command assigns an alias of
TRUCKS_2 to the first database on the memory card
installed in slot 2:
DB.ALIAS.1#2=TRUCKS_2
Sending the
DB.ALIAS
command alone, without
assigned data, returns the current database alias.
DB.CLEAR
To clear the contents of a database, send the following
command:
DB.CLEAR.n#x
Where:
n
is the database number within the memory card
x
is the slot number of the memory card (0 is the
onboard memory)
The
920i
responds with
OK
if the command is
successful,
??
if unsuccessful.
DB.DATA
The
DB.DATA
command can be used to send data to or
retrieve data from the
920i
.
Data can be sent to the indicator using the following
command:
DB.DATA.n#x = data{ | }
Where:
n
is the database number within the memory card
x
is the slot number of the memory card (0 is the
onboard memory)
data
represents a single cell of a row of data
{ | }
is a pipe character (ASCII 124), used to
delimit cell data. If the data being sent is not the
last cell of the row, append the pipe character to
the data to indicate that more data is coming for
that particular row. If the data being sent is the last
cell of the row, do not append the pipe character.
If the command is accepted, the
920i
responds with
OK
; if not, it responds with
??
Example.
The following commands place the data
shown in Table 9-14 into the first database in the
onboard memory:
DB.DATA.1#0=this|
DB.DATA.1#0=is|
DB.DATA.1#0=a|
DB.DATA.1#0=test
DB.DATA.1#0=aaa|
DB.DATA.1#0=bbb|
DB.DATA.1#0=ccc|
DB.DATA.1#0=ddd
Sending the
DB.DATA
command alone, without
assigned data, returns the database contents:
DB.DATA.n#x
The
920i
responds with the entire contents of the
database. Returned data is cell-delimited with the pipe
character (ASCII 124) and row-delimited with
carriage returns (ASCII 13).
For example, the following command could be used to
return the contents of database 1 in the onboard
memory:
DB.DATA.1#0
Command
Description
DB.ALIAS.n#x
Get or set database name
DB.CLEAR.n#x
Clear database contents
DB.DATA.n#x
Get or set database contents
DB.SCHEMA.n#x
Get or set database structure
DB.DELALL
Delete all databases and database
contents
n represents the database number within the memory card;
x is the slot number of the memory card.
Each command must be terminated with a carriage return
character (
Table 9-13. Database Commands
Record
Cell
1
2
3
4
first
this
is
a
test
second
aaa
bbb
ccc
ddd
Table 9-14. Sample Database Contents