开发者

DB2: How to insert a clob with line breaks

I have a simple thing which I want to do, yet is so frustrating in attempting and completing. I just want to take some value such as this:

'a value with
line breaks'

And insert it into a CLOB field and retain the line breaks in DB2. Something like this statement

insert into some_table (the_clob_field) VALUES('a value with
l开发者_StackOverflow社区ine breaks');

causes a value with line breaks to be inserted.


Another alternative is

insert into some_table (the_clob_field) VALUES('a value with ' || chr(10)
||'line breaks');


insert into sometable the_clob_column values(?);

Then set the parameter to point to your text object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜