dashDB和DB2 Load操作 [英] dashDB and DB2 Load operation

查看:264
本文介绍了dashDB和DB2 Load操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用db2cli实用程序和ODBC(值来自dashDB Web控制台上的连接/连接信息)的dashDB数据库。在这一刻,我可以完美地执行 SELECT INSERT 语句,并从我创建的自定义表中获取数据,谢谢命令:

  db2cli execsql -connstringDRIVER = {IBM DB2 ODBC DRIVER  -  IBMDBCL1}; DATABASE = BLUDB; HOSTNAME = yp -dashdb-small-01-lon02.services.eu-gb.bluemix.net; PORT = 50000; PROTOCOL = TCPIP; UID = xxxxxx; PWD = xxxxxx-inputsql /tmp/input.sql 

现在我试图通过db2cli实用程序来执行DB2 LOAD操作,但是我不知道如何继续,甚至是有可能这样做。
目的是从文件导入数据,而不对DB2 DashDB数据库进行编目,但只能通过ODBC进行编目。有人知道这种操作是否可行(使用db2cli或其他实用程序)?

解决方案

这是不可能的。 LOAD 不是SQL语句,因此它不能通过SQL接口(如ODBC)执行,只能使用DB2 CLP,而后者又需要编目的数据库。 p>

可以通过SQL界面调用ADMIN_CMD() ,但是,它要求输入文件在服务器上 - 它不能与存储在工作站上的文件一起使用。



如果JDBC是一个选项,可以使用 CLPPlus IMPORT 命令


I am currently trying to use a dashDB database with the db2cli utility and ODBC (values are from Connect/Connection Information on the dashDB web console). At this moment I can perfectly do SELECT or INSERT statements and fetch data from custom tables which I have created, thanks to the command:

db2cli execsql -connstring "DRIVER={IBM DB2 ODBC DRIVER - IBMDBCL1}; DATABASE=BLUDB; HOSTNAME=yp-dashdb-small-01-lon02.services.eu-gb.bluemix.net; PORT=50000; PROTOCOL=TCPIP; UID=xxxxxx; PWD=xxxxxx" -inputsql /tmp/input.sql

Now I am trying to do a DB2 LOAD operation through the db2cli utility, but I don't know how to proceed or even if it is possible to do so. The aim is to import data from a file without cataloging the DB2 dashDB database on my side, but only through ODBC. Does someone know if this kind of operation is possible (with db2cli or another utility)?

解决方案

This is not possible. LOAD is not an SQL statement, therefore it cannot be executed via an SQL interface such as ODBC, only using the the DB2 CLP, which in turn requires a cataloged database.

ADMIN_CMD() can be invoked via an SQL interface, however, it requires that the input file be on the server -- it won't work with a file stored on your workstation.

If JDBC is an option, you could use the CLPPlus IMPORT command.

这篇关于dashDB和DB2 Load操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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