HP c-tree-SQL ISQL and Tools manual Compilation Errors, Record name redefined

Page 78

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

Image 78
Contents Isql and Tools Reference Guide For use with c-treeSQL ServerPage Table of Contents Data Load Utility dbload Tutorial Source Code IiiFairCom Corporation Purpose of this Manual Syntax Diagram ConventionsDocumentation Overview AudienceRelated Documentation Isql and ToolsIntroduction OverviewIsql and Tools FairCom Corporation Init Quick TourIntroductory Tutorial IsqlIsql Create Table Custmast DefineManage Isql Commit Work CustmastDone Complete Introductory Tutorial CodeQuick Tour Relational Model and Indexing Tutorial ISQLTutorial2.sqlQuick Tour Insert Into Values Insert IntoValues Commit Work QTY PriceComplete Relational Model and Indexing Tutorial Source Code Locking Tutorial ISQLTutorial3.sql@ISQL @iSQLTutorial3.sql Isql Delete from Custmast Complete Locking Tutorial Source Code Transaction Processing Tutorial ISQLTutorial4.sqlTransaction Rollback Work Complete Transaction Processing Tutorial Source Code Syntax Isql StatementsStarting Interactive SQL ArgumentsUsername PasswordStatement History Support ConnectstringIsql Statements for Statement History Support Formatting Output of Isql QueriesIsql Statements Statement SummaryIsql Statements for Query Formatting Summary DisplayExample 3-1 Unformatted Query Display from Isql Customername Customercity Orderid OrdervalueFormatting Column Display with the Column Statement Example 3-2 Controlling Display Width of Character ColumnsExample 3-3 Customizing Format of Numeric Column Displays OrdervalueCustomername Customercity Example 3-4 Specifying Column Breaks and Values with Display Numorders Customername Example 3-6 Specifying a Query Header and Footer with Title Help and Table Statements Transaction SupportDescription Isql Reference1 @ Execute Syntax ExampleBreak Syntax BreakspecExamples Skip nCustomername Clear Syntax HistoryOption ArgumentColumn Syntax Break Column Compute Display TitleColumnname Format formatstringHeading headingtext Date-Time Format Strings for the Column Statement Character DescriptionNull ? Type Length Colname Not Null INTChar Orderinfo AmountSysdate NEW Title FLDColumn Title ComputeAVG MAX MIN SUM Count VariablenameDefine Syntax ValueCOL columnnumber ColpositionDisplayvalue @columnnameEdit Syntax Exit or Quit Syntax Related StatementsExit 10 GET Syntax Isql GET query.sqlIsql RUN History Syntax Help CommandsclausesHelp Syntax Orderstate LotlocationFollowing example illustrates usage of the History statement Hostcommand Host or SH or SyntaxFrom List Syntax Quit Quit or Exit Syntax16 RUN Syntax Isql HistoryPagesize Save Syntax18 SET Syntax LinesizePagesize numberlines Isql Break on Isql Select TBL from Systables TBL Connection databasename DefaultTransaction Isolation Level isolationlevel TBLShow Syntax Filename on Is Default ?Spool Syntax Database ConnectionsIsql Spool STK on Start SyntaxArgument … Isql Spool OFFNull ? Type Length Colname Not Null INT Not Null VarcharTablename Type Length Colname Null ?Date Text Title SyntaxLeft Center Right COL n DoubleIsql Clear Title Isql and Tools FairCom Corporation Data Load Utility dbload IntroductionPrerequisites for Dbload Dbload Command Line SyntaxCommandsfile OptionsData File Formats Data Load Utility dbloadFixed Length Records Commands FileVariable Length Records Next RecordDefine Record Statement Char Short Long Float DoubleFor Each Statement NullExample 4-1 Sample dbload commands files ExamplesCompilation Errors Record name redefinedPosition not specified for fixed length record Fatal Errors Isql and Tools FairCom Corporation Data Unload Utility dbdump Prerequisites for DbdumpDbdump Command Line Syntax Data Unload Utility dbdump Short Long Float DoubleFor Record Statement Define Record custrec of Fixed Length 37 AS Isql and Tools FairCom Corporation Schema Export Utility dbschema Username.tablename Username.procedurenameOutfile Username.triggernameImport Begin Schema Export Utility dbschemaDbschema ENDIsql and Tools FairCom Corporation Tutorial Source Code Commit Work Select * from Custmast Delete from CustmastInteger MoneyVARCHAR6 Tutorial Source Code Commit Work Delete from CustmastImdesc VARCHAR48 Select * from orderlist Select * from orderitems Isql and Tools FairCom Corporation Symbols Index-iIsql Index-ii FairCom CorporationIndex Index-iii FairCom Corporation