ISQL and Tools

The following is the commands file to load records into the orders table. The input data file is orders_in which is a binary file in the fixed length record format.

DEFINE RECORD orders_rec OF FIXED LENGTH 30 AS (

order_no POSITION (1:4) LONG, order_date POSITION (6:16) CHAR, product POSITION (18:25) CHAR, qty POSITION (27:30) LONG

) ;

FOR EACH RECORD orders_rec FROM orders_in

INSERT INTO ADMIN.orders (no, date, prod, units)

VALUES (order_no, order_date, product, qty) ;

NEXT RECORD

4.7DBLOAD ERRORS

This section discusses the different types of errors that can occur during the execution of dbload.

There are three types of errors that can occur during the dbload execution process:

Commands file errors

dbload errors

c-treeSQL database errors

The invalid records that are encountered during the processing of records from the data files are flagged as bad records and are written to the badfile that is specified in the dbload com- mand option. By default, the bad records are written to the file, badfile, in the current directory. Any error in the input data file is messaged in the log file (if specified in the command line option) along with the statistics. The following sections discuss the compilation errors and fatal errors that could occur during the dbload process execution.

4.7.1Compilation Errors

The compilation error messages are as follows:

Record name redefined.

The record name in the DEFINE RECORD statement was already defined. The record name must be unique. dbload creates a new definition using the same name.

Error in record definition.

Too many fields in record definition.

The number of fields used in the record definition is more than the maximum allowed. Cur- rently, the maximum number allowed is TPE_MAX_FIELDS in the header file sql_lib.h.

Position not specified for fixed length record.

4-8

FairCom Corporation

Page 78
Image 78
HP c-tree-SQL ISQL and Tools Compilation Errors, Record name redefined, Position not specified for fixed length record