| |

VerySource

 Forgot password?
 Register
Search
View: 2088|Reply: 3

DB2 clob type inserts data larger than 32k and reports an error

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-3 21:30:01
| Show all posts |Read mode
The table structure is like this
create table CONTENT (
ID VARCHAR (30),
CONTENT CLOB (2M)
);

I heard that the db2lic.ini file needs to be changed, so I added [common] to the file. In fact, I do n’t know if I should use the [common] tag or the database name in the system, such as [mydbname] But no matter it is [common] or [mydbname] tag, use command to insert into content values ​​('abc', 'ddddddddddddddddddddddddddd ......) when the content content is greater than 32k, it will report sqlstate: 54002 characters String constant is too long. I really don't know how to insert data larger than 32k into db2. Please give us some opinions!

; Comment lines start with a semi-colon.

[tstcli1x]
uid = userid
pwd = password
autocommit = 0
TableType = "'TABLE', 'VIEW', 'SYSTEM TABLE'"

[tstcli2x]
; Assuming dbalias2 is a database in DB2 for MVS.
SchemaList = "'OWNER1', 'OWNER2', CURRENT SQLID"


[MyVeryLongDBALIASName]
dbalias = dbalias3
SysSchema = MYSCHEMA


[common]
LONGDATACOMPAT = 1
LOBMAXCOLUMNSIZE = 2147483647

[mydbname]
LONGDATACOMPAT = 1
LOBMAXCOLUMNSIZE = 2147483647
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-23 13:00:01
| Show all posts
It is the limitation of sql length, you'd better pass the value by parameter

For example, in .net development, you won't still use patchwork sql.
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-7-31 09:45:01
| Show all posts
Your table space should be large, generally no more than 32K with no pages!
Reply

Use magic Report

0

Threads

16

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-8-28 15:15:01
| Show all posts
I also want to know, I am looking for information in this area~~~~~
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list