Run ODBC Export Link (GLK) file
See Also
This dialog allows you to run an ODBC Export Link (GLK) file that has previously been saved using either the Export Insert or Merge menus. Thus the same options set in a previous export to the database can be reused. A GLK file is a text file containing header information that GenStat recognises. If a GLK file is open with the usual File Open menu, then you can either open it as a plain text file to edit, or run it to update the specified database. GLK files can be used with the command DBEXPORT to programmatically update an ODBC database from a batch job. The structure of the GLK file is specified below.

Export File

Specifies the name of a GenStat ODBC Export Link file (*.GLK), which contains the saved specification of the update to be used on the ODBC database. You can select a file using the Browse button.

Browse

This opens a File Open dialog to specify the name of a GLK file to run against the current spreadsheet window or an existing GenStat spreadsheet (GSH) file specified within the GLK file.

Data to Export to Database


View or Edit Export before running it

This opens the appropriate Create/Insert/Merge dialog with the options specified in the GLK file before running the export against the ODBC database. Thus the options can be altered before running the export.

OK

Export the data from the spreadsheet to the ODBC table and close the dialog.

Cancel

Close the dialog without making any changes to the database.

GLK File Specification


Line ContentsDescription
1.[GenStat ODBC Update]GLK File type flag
2.<DNS>Database connection string
3.<GSH Filename>GSH Spreadsheet file to be loaded into table
4.TEMPORARY/PERMANENTMarker that GSH file is to be deleted
5.<Update Mode>Create, Insert, Merge (C,I,M)
6.<Table Name>Name of Table to be updated
7.HALTONERROR=<0,1>0 = Halt only on fatal error, not warnings
1 = Halt the export if any error occurs
8.RESTRICTION=<0,1>0 = Ignore any restriction on inserting rows (C,I only)
1 = Do no add in restricted rows
9.ADDCOLUMNS=<0,1>0 = Do not add columns not found in table (I,M only)
1 = Add new columns to table
10.SUBSET=<0,1> 0 = Use all columns in Spreadsheet (I,M only)
1 = Only use a subset of columns
(subset must be provided as column no.s)
11.BYNAME=<0,1>0 = Names will be provided for table columns
1 = Use spread names for table columns
12.ACTION=<0,1,2>0 = Do not add unmatched rows (M only)
1 = Add in extra unmatched rows if a match exists
2 = Add in all extra rows
13.NCOLUMNS=<n>Add in this number of columns
(needed if Subset=1 or ByName=0)
<Colno>=<TColName> x nInsert column <Colno> into Table
(as <TColName> if ByName = 0)
14+NMATCH=<m>Match this number of columns (M only)
<Colno>=<TColName> x mMatch column <Colno> with Table column <TColName>

The order of lines 7-12 can be interchanged without effecting the export.

See Also

Create New Database Table from Spreadsheet
Insert Spreadsheet into Database
Merge Spreadsheet into Database
ODBC Data Query - Select Data
ODBC Databases
SQL Statements

The DBEXPORT procedure provides this functionality within the command language.