Details about LONGVAR datatype

IBM's flagship relational database management system

Details about LONGVAR datatype

Postby gokulNmf » Fri May 08, 2009 5:33 pm


For the first time i come across with LONGVAR datatype. I tried to find some information about it, all i found was they have variable character length :( and length greater that 256. i couldnt find out how it is different from varchar :? ?

What is LongVar Data ytpe, how it is different from VARCHAR?
when it is downloaded for using in a Cobol pgm, into what datatype(variable) it can be moved?\

Thanks in Advance.
User avatar
Posts: 114
Joined: Sat Mar 28, 2009 6:41 pm
Location: India
Has thanked: 0 time
Been thanked: 0 time

Re: Details about LONGVAR datatype


Re: Details about LONGVAR datatype.

Postby dick scherrer » Sat May 09, 2009 12:35 am


Suggest you not be concerned. . .

From the DB2 V8 SQL manual:
Although the syntax LONG VARCHAR and LONG VARGRAPHIC is allowed for compatibility with previous releases of DB2, its use is not encouraged. VARCHAR(integer) and VARGRAPHIC(integer) is the recommended syntax, because after the CREATE TABLE statement is processed, DB2 considers a LONG VARCHAR column to be VARCHAR and a LONG VARGRAPHIC column to be VARGRAPHIC.
When a column is defined using the LONG VARCHAR or LONG VARGRAPHIC syntax, DB2 determines the length attribute of the column. You can use the following information, which is provided for existing applications that require the use of the LONG VARCHAR or LONGVARGRAPHIC syntax, to calculate the byte count and the character count of the column.
Hope this helps,
User avatar
dick scherrer
Global moderator
Posts: 6308
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 90 times

Return to DB2


  • Related topics
    Last post