call db2 load statement from an odbc connection

空扰寡人 提交于 2019-12-12 06:08:08

问题


I have this txt file, formatted with the '|' character between columns, and this script generated by the db2 LOAD wizard:

  LOAD FROM "<path_and_name_of_the_txt_file>" OF DEL MODIFIED BY ANYORDER COLDEL|
  METHOD P (1, 2, 3) MESSAGES "<path_and_name_of_a_new_log_file>"
  REPLACE INTO DB2ADMIN.WEB_NOHAB_CONSOLI (RUC, RAZSOC, FECHA)
  NONRECOVERABLE INDEXING MODE AUTOSELECT LOCK WITH FORCE;

The script just works ok. Now I have to call it from my VFP form (cStatement contains all the LOAD from above):

SQLEXEC(nMyConn,cStatement)

but it fails with error SQL0104N I've tried with "" and '' for the path parameters but the problem persists. Any Ideas?


回答1:


The DB2 CLP can run LOAD and other non-SQL commands that client applications cannot send over a driver-based connection. DB2 provides a system stored procedure called ADMIN_CMD, which client connections (ODBC, JDBC, etc.) can call to initiate any of several popular administrative commands, including LOAD.



来源:https://stackoverflow.com/questions/28444042/call-db2-load-statement-from-an-odbc-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!