cancel
Showing results for 
Search instead for 
Did you mean: 

Insert an unique space in a varchar column

Former Member
0 Kudos

Hi,

I need some helps regarding the insert of space string into a varchar column.

I try to do that :

Here the Table,

Name;Data Type;Dim;Code;Key;Not Null;Default;Comment

M_OID;FIXED;28;;;X;;

PROPERTY_NAME;VARCHAR;256;ASCII;;;;

PROPERTY_TYPE;FIXED;2;;;;;

PROPERTY_INDEX;FIXED;3;;;;;

NUMBER_VALUE;FIXED;28,6;;;;;

STRING_VALUE;VARCHAR;2000;ASCII;;;;

DATE_VALUE;TIMESTAMP;;;;;;

The query

INSERT INTO COMPONENT_PROPERTY(PROPERTY_INDEX, PROPERTY_TYPE, STRING_VALUE, NUMBER_VALUE , DATE_VALUE, PROPERTY_NAME, M_OID) VALUES (?, ?, ?, ?, ?, ?, ?) Parameters : [,2, ,,,separator,19814]

So the STRING_VALUE (3rd entry) has the value ' ' (one space) and the value inserted in the database is empty varchar without length.

How can I do this insert to have exactly the space in the DB

DB configuration, Driver JDBC configuration or Query configuration?

I have the same issue if I have a single space at the end of a sentence, this space is deleted and it's not in a SELECT Query

Thanks a lot for your helps,

Nicolas

Accepted Solutions (0)

Answers (1)

Answers (1)

steffen_schildberg
Active Participant
0 Kudos

Hi Nicolas,

I have to disappoint you: no way to insert single spaces (and spaces at the end of an char string) as significant character values. MaxDB treats trailing blanks as not significant and cuts them off. You need to have your app to handle this, for instance with an additional length column.

Regards,

Steffen