I am currently migrating a C-application from RdB (OpenVMS) to Oracle 11 (Linux). I now stumbled over a difference between the two database systems.
Example:
create table MYTAB(id number(13), name varchar2(10)) ;
Contents
Id Name
1 Smith
2 Smith<blank> // trailing blank after Smith
When I select the names in Embedded SQL, Oracle adds trailing spaces up to the length of my host variable, i.e., the two names cannot be distinguished. Even if I TRIM the name, Oracle adds spaces.
But with a Select-Statement by column name I must give the exact number of spaces:
select id from MYTAB where name ='Smith' -> gives Id 1
select id from MYTAB where name ='Smith ' -> gives Id 2
This makes it very difficult for me to handle the data because I cannot differ the number of trailing spaces from my select statement.
Is there any way to stop Oracle from blank-padding?
Thanks a lot in advance Jörg