SQLServer varchar returning truncated string

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
ZDC
Premium Member
Premium Member
Posts: 15
Joined: Fri Nov 23, 2007 5:06 am

SQLServer varchar returning truncated string

Post by ZDC »

Hi,

I am reading a varchar(8000) column from MSSQL Server 2000 using SQLServer enterprise Stage. The actual value in the column is 2300 characters. The output from the job is a truncated string of 255 characters followed by char(0) characters. The total character count in the output is 8000. sorry i couldn't paste the string here becoz of char(0).

When i do a substring in the query again only the first 255 chars are ok.
Any suggestions ?

Thanks in advance.
Zero Degree Consulting
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Use LongVarChar. Under ODBC standards the maximum size of a VarChar is 255 characters.

All complaints to billg@microsoft.com (because ODBC is a Microsoft standard).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ZDC
Premium Member
Premium Member
Posts: 15
Joined: Fri Nov 23, 2007 5:06 am

Post by ZDC »

I am afraid it is giving me the same result with LongVarchar as well :cry:
Zero Degree Consulting
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Perhaps your driver does not properly support LongVarChar. Try using a different client, perhaps MS Access, from the DataStage server.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ZDC
Premium Member
Premium Member
Posts: 15
Joined: Fri Nov 23, 2007 5:06 am

Post by ZDC »

Nothing seems wrong with the ODBC con . I have checked it using C# code and it returns the proper value and not a truncated one.
any other setting i should check for ?
Zero Degree Consulting
Post Reply