Втр, 25 Май 2010, Cox, Ed писал(а): > I'm using the J ODBC driver to connect to SQL Server. I'm finding > that queries that I run are returning unwanted trailing blanks in > all fields. For example from a table field defined as nvarchar(50) > I am getting lengths of 100 returned, most of which are spaces as > the end. From temp tables I am getting returned lengths of 1000 on > data originally sourced from a table field of nvarchar(500). So > there seems to be a 2 to 1 increase - perhaps due to the Nvarchar > field. But the root issue is why am I getting this in the first > place? It persists even if I use RTRIM() in the query. > > Is there some way to deal with this at the ODBC level instead of > having to having to trim it all after the results are returned > (since performance would tank on huge result sets)?
did you use ddfch? data type nvarchar means national varchar which is unicode, and one wchar unicode character needs 2 bytes therefore nvarchar(50) requires a buffer length of 100. the buffer length during column binding can also be obtained using 'ddcol' verb. Try using varchar instead of nvarchar if you are not comfortable with unicode. -- regards, ==================================================== GPG key 1024D/4434BAB3 2008-08-24 gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
