ProvideX V8.20 > Language Reference > 9. Special Command Tags
787
[ODB] Tag
         Open DataBase
Format
OPEN (chan[,fileopt1])"[ODB]datasource[;table][;fileopt2]"
Where:
[ODB]
File tag clause to inform ProvideX that it will be opening an external
Windows ODBC database (not a ProvideX data file).
chan
Channel or logical file number to open.
datasource
Datasource name as defined in ODBC Administration.
fileopt1
File options. Supported options include:
BSZ=num Buffer size (in bytes)
ERR=stmtref Error transfer
IOL=iolref Default IOList
NBF=num Dedicated number of buffers
OPT=string$ Open parameters (See [ODB] OPT= Parameters)
REC=string$ Record prefix (REC=VIS(string$) can also be used).
OPT=string$ Open parameters (See [ODB] OPT= Parameters)
fileopt2
table
Name of the table to open. If the table name is not supplied, then SQL
statements sent to the database must be created by the application and
sent via one of the following commands:
WRITE (chan) SQL$
WRITE RECORD (chan) SQL$
READ (chan, KEY="!", SQL$)
See DB2/ODB Table and Column Information, p.771.
Note: The [ODB] tag is built into the ProvideX programming language. You do not need
the ProvideX ODBC driver to use this tag, but you are limited to using the tag in Windows
only. (ODBC is the Microsoft acronym for Open Database Connectivity.)
Description
The [ODB] tag is used as a prefix in an OPEN statement to denote that ProvideX is to
route all file I/O requests to an external ODBC database. Once you open a channel
for [ODB] use, you can use it just like any other channel (i.e., for file I/O). It remains
open until you close it.
ProvideX supports ODBC under Windows as well as two open source versions of
ODBC for UNIX/Linux (iODBC and unixODBC). Use TCB(197) to determine if
ODBC support is enabled for a given UNIX/Linux system.
Note: To open and read ProvideX (internal) data files using other database applications,
(e.g., Excel), install and use the ProvideX ODBC driver instead of the [ODB] tag.