Maximum length of a varchar field

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Maximum length of a varchar field

Post by somu_june »

Hi ,

I have a file created by a server job with data type integer(10) and while I'm designing a parallel job I mentioned it as varchar(255), my question is what is the maximum varchar length I can give in datastage. Because when ever I import a meta data it gives me varchar(255) , is varchar(255) maximum or I can define varchar(1023) for integer(10) field.



Thanks,
Raju
somaraju
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Because text files don't have data types (other than "text") VarChar(255) is used as a default. DataStage has a really high limit on length of a VarChar (64K ?); however some databases limit it (for example to 1024) making you use Long VarChar for anything larger.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Thanks ray for the reply. If I don't provide any length to the varchar field in datastage, what is the maximum it takes is it ( 255 ) or is it going to read entire data from the column as you said it is a text field with out trimming or dropping any data from the column.


Thanks,
Raju
somaraju
kandyshandy
Participant
Posts: 597
Joined: Fri Apr 29, 2005 6:19 am
Location: Singapore

Post by kandyshandy »

it will not drop any data i.e. it will read entire column data. Best way is to try it out ;)
Kandy
_________________
Try and Try again…You will succeed atlast!!
somu_june
Premium Member
Premium Member
Posts: 439
Joined: Wed Sep 14, 2005 9:28 am
Location: 36p,reading road

Post by somu_june »

Thanks Kandy/sandy and Ray , I tested the job and if I don't provide any length to varchar field it reads the entire column data.



Thanks,
Raju
somaraju
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

This is what's called an "unbounded VarChar".

These have a specific storage strategy in Data Sets, which ordinarily store data (even bounded VarChar) in fixed width format, because it's far more efficient to pack and unpack.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply