About Export Errors

In this section:

There are several possible Hyperstage-related errors that could occur when exporting data from a Hyperstage table. These errors are described in the following table. Standard MySQL errors may also occur (for more information, see Appendix B, Errors, Error Codes, and Common Problems in the MySQL 5.x Reference Manual).

Hyperstage Export Errors

Code

Message

Description

Action

1

Cannot open file or pipe.

Cannot open a file or a pipe for output.

Ensure that the file exists and the path is entered correctly.

2

Wrong data or column definition.

Not used.

Ensure the data being exported is the correct data type and does not exceed the size specified.

3

Syntax error.

Not used.

Check the export syntax.

4

Cannot connect to the database.

Not used.

Ensure the database exists, the correct path is given, and Hyperstage is started.

5

Unknown error.

Unspecified error occurred.

Contact Customer Support Services.

6

Wrong parameter.

Wrong value for one of the export parameters.

Make sure the correct parameter is used (see Setting Import and Export Parameters.

7

Data conversion error.

Not used.

Ensure the data is the correct column type.



x
Sample Script (Create Table, Import Data, and Export Data)

The following sample script creates a table called customers, sets Hyperstage as the default engine, imports data from an existing text file, and exports the data into both binary and text formats.

USE Northwind;
DROP TABLE IF EXISTS customers;
CREATE TABLE customers (
  CustomerID varchar(5),
  CompanyName varchar(40),
  ContactName varchar(30),
  ContactTitle varchar(30),
  Address varchar(60),
  City varchar(15)
  Region char(15)
  PostalCode char(10),
  Country char(15),
  Phone char(24),
  Fax varchar(24),
  CreditCard float(17,1),
  FederalTaxes decimal(4,2)
) ENGINE=BRIGHTHOUSE;
-- Import the text file.
Set AUTOCOMMIT=0;
SET @bh_dataformat = 'txt_variable';
LOAD DATA INFILE "/tmp/Input/customers.txt" INTO TABLE customers FIELDS TERMINATED BY ';' ENCLOSED BY 'NULL' LINES TERMINATED BY '\r\n';
COMMIT;
-- Export the data into BINARY format.
SET @bh_dataformat = 'binary';
SELECT * INTO OUTFILE "/tmp/output/customers.dat" FROM customers;
-- Export the data into TEXT format.
SET @bh_dataformat = 'txt_variable';
SELECT * INTO OUTFILE "/tmp/output/customers.text" FIELDS TERMINATED BY ';' ENCLOSED BY 'NULL' LINES TERMINATED BY '\r\n' FROM customers;

WebFOCUS