1. Home
  2. DBINFORMATION procedure

DBINFORMATION procedure

Loads information on the tables and columns in an ODBC database, PC Windows only (D.B. Baird).

Options

PRINT = string token What to print (information); default info
INFORMATION = string token What information to read from the database (tables, columns); default tabl
DRIVER = scalar Driver version (either 32 or 64) to use with the 64-bit version of Genstat; default 64

Parameters

DB = texts Database connection string
GDBFILE = texts GDB file specifying an ODBC query
ISAVE = pointers Specifies pointers to save the information

Description

This procedure allows you to print or save information about the tables and columns in an ODBC database. The ISAVE parameter can specify a pointer to save the information, and the INFORMATION option controls what is saved. If INFORMATION=tables, a single text structure ISAVE['Table'] is saved. Alternatively, if INFORMATION=columns, three text structures named ISAVE['Table'], ISAVE['Column'] and ISAVE['Type'] are saved. These contain the table names, the column names and the column type (either Numeric, Text, Date, Time, Binary or Unknown), respectively. By default the information is printed, but you can set option PRINT=* to suppress this.

The ODBC query can be specified by using the DB parameter to supply a text containing a database connection string. Note that any file names in the string must use \\ rather than / for the directory separator: i.e. the file name

C:\WORK\MYDATA.MDB

should be specified as

C:\\WORK\\MYDATA.MDB

rather than as

C:/WORK/MYDATA.MDB

Alternatively, you can use the GDBFILE parameter to specify an existing GDB file that contains an ODBC query. This can be created in Genstat for Windows using the ODBC Data Query menu (accessible from the New option of the Spread menu on the menu bar). The DSN line in this text file can be used to connect to the same database as specified by the DB parameter.

You can set option DRIVER=32 to use 32-bit ODBC drivers when you are running the 64-bit Genstat; there is more information about this on the VSN website: www.vsni.co.uk.

Options: PRINT, INFORMATION, DRIVER.

Parameters: DB, GDBFILE, ISAVE.

Method

An SQL query to get the information is sent to the ODBCLOAD.DLL library which runs the query and saves the results in a temporary GWB file. This is then loaded using the SPLOAD directive.

Action with RESTRICT

Restrictions are not applicable to any of the parameters.

See also

Procedures: DBCOMMAND, DBEXPORT, DBIMPORT, IMPORT.

Commands for: Input and output.

Updated on June 20, 2019

Was this article helpful?