Page 1 of 1

Trailing blanks from CHAR fields truncated

Posted: Thu 20 Apr 2006 06:50
by heidenbluth
Hello,

There is a bug with fixed char fields. Please create a table like
CREATE TABLE TEST (
ID NUMBER(9),
TXT CHAR(10));
and insert a value including trailing blanks,
INSERT INTO TEST(ID,TXT) VALUES( 1, 'ABCDE ');
COMMIT;
Now show the contents in a TOraQuery:
SELECT ID, TXT from TEST

Unfortunately, the trailing blanks are truncated. You see 'ABCDE' instead of 'ABCDE '.
Could this be fixed, please? If the column is defined as CHAR the length cannot vary.
Regards,
Holger
--
Delphi 2005 - VCL, Oracle 10g Release 2, both on Windows XP

Posted: Thu 20 Apr 2006 08:51
by Challenger
You can set TrimFixedChar option of TOraQuery to False but you will get ABCDE and 5 spaces. So for storing such values it is better to use Varchar fields.

Posted: Thu 20 Apr 2006 19:12
by heidenbluth
Thank you, that helped me.
Regards,
Holger