从odbc连接调用db2 load语句 [英] call db2 load statement from an odbc connection

查看:328
本文介绍了从odbc连接调用db2 load语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个txt文件,在列之间用'|'字符格式化,这个脚本由db2 LOAD向导生成:

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;

脚本运行正常。现在我必须从我的VFP表单中调用它(cStatement包含上面的所有LOAD):

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)

但它失败并出现错误SQL0104N
我试过用和''代表路径参数但问题仍然存在。
任何想法?

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

推荐答案

DB2 CLP可以运行 LOAD 以及客户端应用程序无法通过基于驱动程序的连接发送的其他非SQL命令。 DB2提供了一个名为 ADMIN_CMD ,哪些客户端连接(ODBC,JDBC等) )可以调用以启动任何几个流行的管理命令,包括 LOAD

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.

这篇关于从odbc连接调用db2 load语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆