如果有此字段,是不是就可以直接插入了?
请指导下啊,谢谢。。。
6 个解决方案
#1
用clob类型。
#2
增加数据库的pagesize就可以增大varchar数据的表示范围
#3
可以创建 32k 或者 16k 大小的表空间
db2 => create table test (id varchar(32673)) in tbspace32k
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0604N The length, precision, or scale attribute for column, distinct type,
structured type, attribute of structured type, function, or type mapping
"varchar(32673)" is not valid. SQLSTATE=42611
db2 => create table test (id varchar(32672)) in tbspace32k
DB20000I The SQL command completed successfully.
db2 => drop table test
DB20000I The SQL command completed successfully.
db2 => create table test (id char(1)) in tbspace32k
DB20000I The SQL command completed successfully.
db2 => alter table test add ex varchar(32672)
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0670N The row length of the table exceeded a limit of "32677" bytes.
(Table space "TBSPACE32K".) SQLSTATE=54010
db2 => alter table test add ex varchar(32671)
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0670N The row length of the table exceeded a limit of "32677" bytes.
(Table space "TBSPACE32K".) SQLSTATE=54010
db2 => alter table test add ex varchar(32670)
DB20000I The SQL command completed successfully.
db2 =>
db2 => create table test (id varchar(32673)) in tbspace32k
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0604N The length, precision, or scale attribute for column, distinct type,
structured type, attribute of structured type, function, or type mapping
"varchar(32673)" is not valid. SQLSTATE=42611
db2 => create table test (id varchar(32672)) in tbspace32k
DB20000I The SQL command completed successfully.
db2 => drop table test
DB20000I The SQL command completed successfully.
db2 => create table test (id char(1)) in tbspace32k
DB20000I The SQL command completed successfully.
db2 => alter table test add ex varchar(32672)
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0670N The row length of the table exceeded a limit of "32677" bytes.
(Table space "TBSPACE32K".) SQLSTATE=54010
db2 => alter table test add ex varchar(32671)
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0670N The row length of the table exceeded a limit of "32677" bytes.
(Table space "TBSPACE32K".) SQLSTATE=54010
db2 => alter table test add ex varchar(32670)
DB20000I The SQL command completed successfully.
db2 =>
#4
db2 "CREATE BUFFERPOOL mypool SIZE 50 PAGESIZE 32 K"
db2 "create regular tablespace tbspace32k PAGESIZE 32 K managed by database using (file 'C:\db2\tbspace32k' 100) extentsize 4 prefetchsize 4 BUFFERPOOL mypool"
--在 C:\db2\myspace 目录下生成了3M 的tbspace32k 文件
db2 "create regular tablespace tbspace32k PAGESIZE 32 K managed by database using (file 'C:\db2\tbspace32k' 100) extentsize 4 prefetchsize 4 BUFFERPOOL mypool"
--在 C:\db2\myspace 目录下生成了3M 的tbspace32k 文件
#5
没遇到过这种情况.
#6
等待牛人来答.
#1
用clob类型。
#2
增加数据库的pagesize就可以增大varchar数据的表示范围
#3
可以创建 32k 或者 16k 大小的表空间
db2 => create table test (id varchar(32673)) in tbspace32k
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0604N The length, precision, or scale attribute for column, distinct type,
structured type, attribute of structured type, function, or type mapping
"varchar(32673)" is not valid. SQLSTATE=42611
db2 => create table test (id varchar(32672)) in tbspace32k
DB20000I The SQL command completed successfully.
db2 => drop table test
DB20000I The SQL command completed successfully.
db2 => create table test (id char(1)) in tbspace32k
DB20000I The SQL command completed successfully.
db2 => alter table test add ex varchar(32672)
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0670N The row length of the table exceeded a limit of "32677" bytes.
(Table space "TBSPACE32K".) SQLSTATE=54010
db2 => alter table test add ex varchar(32671)
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0670N The row length of the table exceeded a limit of "32677" bytes.
(Table space "TBSPACE32K".) SQLSTATE=54010
db2 => alter table test add ex varchar(32670)
DB20000I The SQL command completed successfully.
db2 =>
db2 => create table test (id varchar(32673)) in tbspace32k
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0604N The length, precision, or scale attribute for column, distinct type,
structured type, attribute of structured type, function, or type mapping
"varchar(32673)" is not valid. SQLSTATE=42611
db2 => create table test (id varchar(32672)) in tbspace32k
DB20000I The SQL command completed successfully.
db2 => drop table test
DB20000I The SQL command completed successfully.
db2 => create table test (id char(1)) in tbspace32k
DB20000I The SQL command completed successfully.
db2 => alter table test add ex varchar(32672)
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0670N The row length of the table exceeded a limit of "32677" bytes.
(Table space "TBSPACE32K".) SQLSTATE=54010
db2 => alter table test add ex varchar(32671)
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0670N The row length of the table exceeded a limit of "32677" bytes.
(Table space "TBSPACE32K".) SQLSTATE=54010
db2 => alter table test add ex varchar(32670)
DB20000I The SQL command completed successfully.
db2 =>
#4
db2 "CREATE BUFFERPOOL mypool SIZE 50 PAGESIZE 32 K"
db2 "create regular tablespace tbspace32k PAGESIZE 32 K managed by database using (file 'C:\db2\tbspace32k' 100) extentsize 4 prefetchsize 4 BUFFERPOOL mypool"
--在 C:\db2\myspace 目录下生成了3M 的tbspace32k 文件
db2 "create regular tablespace tbspace32k PAGESIZE 32 K managed by database using (file 'C:\db2\tbspace32k' 100) extentsize 4 prefetchsize 4 BUFFERPOOL mypool"
--在 C:\db2\myspace 目录下生成了3M 的tbspace32k 文件
#5
没遇到过这种情况.
#6
等待牛人来答.