varchar2 accepts spaces in Oracle 10g [message #220455] |
Tue, 20 February 2007 14:14 |
astar
Messages: 4 Registered: February 2007
|
Junior Member |
|
|
Hi,
We have oracle 9i and oracle 10g. For some reason Oracle 10g accepts spaces in varchar2 as supplied values for ex :
if table has varchar2(20) as column and I insert values
'abc' it works fine
but if i insert 'abc ', it shows results as 'abc ' instead of 'abc'.
Our application did not had this issue in 9i, it used to truncate trailing spaces automatically.
The data has been loaded from FixedWidth file using cobol api. No change has been made in the code so it's only due to oracle 9i to 10g migration.
Is there any kind of setting in 10g which changes this behaviour to accepted values ?
Thanks in advance.
Astar
|
|
|
|
|
|
|
|
|
Re: varchar2 accepts spaces in Oracle 10g [message #220467 is a reply to message #220465] |
Tue, 20 February 2007 15:28 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
>> but is there a way to automatically set this in oracle
Already responded.
You can write a before insert trigger to do this in backend, which will be painful if you are loading lot of data.
Better to use an RTRIM in you application code.
|
|
|