1

i would like to load data from a txt file (9 KB) to SQL IBM netezza database in Aginity workbench.

After creating the table:

I right-clicked the table and go to "import data" tab and chose "comma" as field delimiter and skip the first row for the header in the file.

The SQL query is:

INSERT INTO username.my_table   // the table has 12 columns and all are characters
SELECT * FROM 
EXTERNAL 'C:\\mypath\\my_file.txt'
USING
(
  DELIMITER ','
  LOGDIR 'C:\\temp'
  Y2BASE 2000
  ENCODING 'internal'
  SKIPROWS 1
  REMOTESOURCE 'ODBC'
  ESCAPECHAR '\'
)

But, I got error:

 Unable to export the data to a file. Error: operations canceled.

Why it is "export", I want to do import.

Any help would be appreciated.

thanks

user3601704
  • 753
  • 1
  • 14
  • 46
  • Is that the full text of the error? Or did it also say something about a required option? – ScottMcG Nov 21 '14 at 23:17
  • Is this not the same question you asked here? Did the previous solution work for you? http://stackoverflow.com/questions/26129317/error-of-importing-data-from-csv-file-to-ibm-netezza-sql-database – ScottMcG Nov 21 '14 at 23:22
  • They look similar but different. I have solved the problem in this OP by changing the character data size to a larger value. Thanks ! – user3601704 Nov 22 '14 at 01:48

1 Answers1

1

Uncheck the double quote option, and remove all of your double quotes from the file itself. That's broken in Netezza among other functionality for the "Import Data" option. If the file you are importing contains commas or double quotes, just escape them with a \, or \" since you're using \ as your ESCAPECHAR argument value.

You should also remove the headers in the file before the import.

If that didn't work, can you please provide the contents of your file? Provide the headers (for visibility) and the data for at least one line that causes this error.

JustBeingHelpful
  • 18,332
  • 38
  • 160
  • 245