dbTalk Databases Forums  

Varchar datatype

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Varchar datatype in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ichabod
 
Posts: n/a

Default Varchar datatype - 05-10-2011 , 02:49 PM






I am migrating from version 8.1 of DB2 to 9.7. Right now I have the
9.7 Express-C version installed on my laptop. I am using the 64-bit
version with Windows 7 professional 64 bit. I have attempted to create
a database with a large varchar field, (~15000), and when I do it
fails saying
the largest allow field is 4005 bytes. I have listed below the section
of the run file that is giving me the problem. From what I saw on the
web site, the varchar type will support up to 32K field. Any help
would be appreciated. Thank you.

create table sosdb.nsnmaster
(FSC smallint not null,
STATUS char(1) not null with default,
NIIN int not null,
KEYWORD_CODE int not null with default,
PIC char(1) not null with default,
QCC char(3) not null with default,
CRITICAL_ITEM char(1) not null with default,
AMC char(2) not null with default,
UNIT_OF_ISSUE char(2) not null with default,
PGK_INFO char(12) not null with default,
HAZARDOUS_MAT char(1) not null with default,
QTY_UNIT_PACK char(3) not null with default,
PACK_REQ_ABC char(2) not null with default,
OPT_PACK_IND char(1) not null with default,
INT_CONT_CODE char(2) not null with default,
INT_CONT_UNIT_PCK char(3) not null with default,
SPEC_MARK_CODE char(2) not null with default,
SPC_PCK_INST char(10) not null with default,
SPC_PCK_REV char(1) not null with default,
SPC_PCK_DTE date not null with default,
PALLET_REQ char(1) not null with default,
PALLET_INST_NUM char(10) not null with default,
PALLET_INST_REV char(1) not null with default,
PALLET_INST_DATE date not null with default,
UNIT_WEIGHT dec(3,1) not null with default,
DESCRIPTION varchar(15360) not null with default)
in nsnmaster;

Reply With Quote
  #2  
Old   
Mark A
 
Posts: n/a

Default Re: Varchar datatype - 05-10-2011 , 03:32 PM






"ichabod" <p_yohn (AT) yahoo (DOT) com> wrote

Quote:
I am migrating from version 8.1 of DB2 to 9.7. Right now I have the
9.7 Express-C version installed on my laptop. I am using the 64-bit
version with Windows 7 professional 64 bit. I have attempted to create
a database with a large varchar field, (~15000), and when I do it
fails saying
the largest allow field is 4005 bytes. I have listed below the section
of the run file that is giving me the problem. From what I saw on the
web site, the varchar type will support up to 32K field. Any help
would be appreciated. Thank you.
Your tablespace for that table probably has a page size of 4K. You need to
create the table in a larger tablespace, probably one with 32K page size
(the max allowed) would be good in this case. Make sure there is a 32K page
size bufferpool before you create a 32K page tablespace. It is best to also
make sure you a system temporary tablespace with 32K pagesize.

Reply With Quote
  #3  
Old   
Serge Rielau
 
Posts: n/a

Default Re: Varchar datatype - 05-11-2011 , 06:14 AM



Assuming that DESCRIPTION won't be indexed you may be better of making
this a CLOB with a reasonable INLINE LENGTH.
Note that in DB2 9.7 FP3 (Express C is at FP4 level now) you will still
be able to do standard comparisons for this CLOB as it is smaller than
MAXVARCHAR

Cheers
Serge

--
Serge Rielau
SQL Architect DB2 for LUW, IBM Toronto Lab
Blog: tinyurl.com/SQLTips4DB2
Wiki: tinyurl.com/Oracle2DB2Wiki
Twitter: srielau

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.