Subject RE: [Firebird-Java] Re: Unnecessary padding to Strings read
Author Prabhakar Krishnaswami
Roman:

The data type declared in the Unicode database was char[2]. The value of
40 was stored in the table. Would you still pad it since the length of
the value matches the data type size? Now I changed this once to
varchar[2] and another time to varchar[6] using alter command but in
both the cases, the behaviour was the same. Incidentally, is this only
an issue in Unicode databases and not regular databases? In regular
databases, when this field value is read what I see in the debugger was
"40" but in Unicode databases the value read is "40 ";

Prabhakar Krishnaswami

Software Engineer



Dynix

pkrishnaswami@...

p 801-223-5817

f 801-223-5202

www.dynix.com


-----Original Message-----
From: Roman Rokytskyy [mailto:rrokytskyy@...]
Sent: Wednesday, August 13, 2003 12:14 PM
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] Re: Unnecessary padding to Strings read

> Recently we configured the JBoss 3.0.x server to use firebird driver
> FirebirdSQL1.0.1 to access our Interbase Unicode database. On
> testing this configuration, while reading certain columns in the
> table either char or varchar, the string read as an extra padding at
> the end. I am not sure why this is happening? Has anyone seen a
> similar problem? Is there a solution to this problem?

Columns defined as CHAR are padded to full length by server according
to SQL standard. VARCHAR columns are not padded. If you can provide a
reproducable test case where _VARCHAR_ columns are padded, I will
consider this a bug, but I'm almost 100% sure that you get the issue
with CHAR columns and this is correct behavior.

Best regards,
Roman Rokytskyy



To unsubscribe from this group, send an email to:
Firebird-Java-unsubscribe@yahoogroups.com



Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/