DB2在长varchar列中插入文本文件的内容
我对 db2 不是很熟悉..这个任务在 Oracle 中相当容易,但我不知道如何用 db2 来完成它。
我有下表:
Data type Column
Column name schema Data type name Length Scale Nulls
------------------------------- --------- ------------------- ---------- ----- ------
ID TEST CHARACTER 10 0 No
BU TEST CHARACTER 5 0 No
FILETYPE TEST CHARACTER 6 0 No
FILENAME TEST CHARACTER 80 0 No
PATH TEST CHARACTER 254 0 No
TS TEST TIMESTAMP 10 0 Yes
TSYS TEST CHARACTER 50 0 No
STAT TEST CHARACTER 1 0 No
REP TEST LONG VARCHAR 32700 0 Yes
我想创建一个新行,并且 REP 列应包含文本文件的内容。 我该怎么做?
I'm not very familiar with db2.. this task would be rather easy in Oracle but I don't know how to do it with db2.
I have the following table:
Data type Column
Column name schema Data type name Length Scale Nulls
------------------------------- --------- ------------------- ---------- ----- ------
ID TEST CHARACTER 10 0 No
BU TEST CHARACTER 5 0 No
FILETYPE TEST CHARACTER 6 0 No
FILENAME TEST CHARACTER 80 0 No
PATH TEST CHARACTER 254 0 No
TS TEST TIMESTAMP 10 0 Yes
TSYS TEST CHARACTER 50 0 No
STAT TEST CHARACTER 1 0 No
REP TEST LONG VARCHAR 32700 0 Yes
I want to create a new row and the column REP should contain the contents of a textfile.
How do I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 IMPORT 或 LOAD 命令:
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.admin.doc/doc/r0008304.htmm
但有一个问题,我不确定 LOB 功能是否适用于非 LOB 列...尽管 LONG VARCHAR 与 CLOB 非常相似,除了 max 之外。允许的数据大小。
You can use either the IMPORT or LOAD command:
http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com.ibm.db2.udb.admin.doc/doc/r0008304.htmm
one catch though, I'm not sure that the LOB functionality is going to work with non-LOB columns... although LONG VARCHAR is very similar to CLOB, apart from the max. allowed data size.