James Yu
James Yu

Reputation: 519

unable to specify db2 import parameters on bluemix?

I subscribed a free sqldb service from bluemix and tried to import data in CSV file to this database instance.
For certain columns I have pure "space" as data, and some columns to be filled by default value. I can import this data with the following command on my local DB2:

db2 'import from MY_DATA.csv of del modified by usedefaults keepblanks timestampformat="MM/DD/YYYY HH:MM:SS" skipcount 1 insert into MY_TABLE'

On bluemix, I can only assign date / time / timestamp format and skip 1st row. How can I add the "modified by usedefaults keepblanks" part on bluemix to complete the import?

Also, when the import fails, I only receive the following message:

BaseException message: [Routine "SYSPROC.ADMIN_CMD" execution has completed, but at least one error, "_0911", was encountered during the execution. More information is available.. _CODE=20397, _STATE=01H52, DRIVER=3.66.46]

Where can I get the detail error log that I can see on my local DB such as:

SQL3125W  The character data in row "2" and column "32" was truncated because
the data is longer than the target database column.

SQL3148W  A row from the input file was not inserted into the table.  SQLCODE
"-181" was returned.

SQL0181N  The string representation of a datetime value is out of range.
SQLSTATE=22007

SQL3185W  The previous error occurred while processing data from row "2" of
the input file.

SQL3110N  The utility has completed processing.  "2" rows were read from the
input file.

SQL3221W  ...Begin COMMIT WORK. Input Record Count = "2".

SQL3222W  ...COMMIT of any database changes was successful.

SQL3149N  "2" rows were processed from the input file.  "0" rows were
successfully inserted into the table.  "1" rows were rejected.


Number of rows read         = 2
Number of rows skipped      = 1
Number of rows inserted     = 0
Number of rows updated      = 0
Number of rows rejected     = 1
Number of rows committed    = 2

enter image description here

Upvotes: 1

Views: 486

Answers (1)

CharlesL
CharlesL

Reputation: 942

In the same quick load page (load complete in step 4), there should be a link to view the logs for this load. Hopefully it'll reveal more details about the error message.

Also note that keepblanks is applicable to DEL file formats (Delimited ASCII) only. It is not applicable to ASCII file formats (ASC/DEL) or ASC file formats (Non-delimited ASCII).

http://www-01.ibm.com/support/knowledgecenter/SSEPGG_10.5.0/com.ibm.db2.luw.sql.rtn.doc/doc/r0023577.html?cp=SSEPGG_10.5.0%2F3-6-1-3-0-0-12&lang=en

quick load page

Upvotes: 1

Related Questions