无法在bluemix上指定db2导入参数?

时间:2015-07-16 02:49:07

标签: sql ibm-cloud

我从bluemix订阅了一个免费的sqldb服务,并尝试将CS​​V文件中的数据导入此数据库实例。
对于某些列,我有纯粹的空间"作为数据,以及一些要按默认值填充的列。我可以在我的本地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'

在bluemix上,我只能指定日期/时间/时间戳格式并跳过第1行。如何添加"修改为usedefaults keepblanks"部分在bluemix上完成导入?

此外,导入失败时,我只收到以下消息:

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]

我在哪里可以获得我可以在本地数据库中看到的详细错误日志,例如:

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

1 个答案:

答案 0 :(得分:1)

在同一个快速加载页面(步骤4中的加载完成)中,应该有一个链接来查看此加载的日志。希望它能够揭示有关错误消息的更多细节。

另请注意,keepblanks仅适用于DEL文件格式(定界ASCII)。它不适用于ASCII文件格式(ASC / DEL)或ASC文件格式(非分隔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

相关问题