iBatis - Additional space gets added in the SQL Server table fields while the 
data gets added.
----------------------------------------------------------------------------------------------

                 Key: IBATIS-455
                 URL: https://issues.apache.org/jira/browse/IBATIS-455
             Project: iBatis for Java
          Issue Type: Bug
          Components: SQL Maps
    Affects Versions: 2.3.0
         Environment: Windows XP, SQL SERVER 2000.
            Reporter: Vyas


I have a field defined in the SQL SERVER table (SHPG_CAT) as below.

SHPG_CAT  VARCHAR(255) NOT NULL.

And the data is inserted to this field using the following Insert Query defined 
in iBatis Query Map,

<insert id="insertShippingCategory" 
parameterClass="com.bestbuy.rise.sdi.dataobject.ShippingDO">
  INSERT INTO SHPG_CAT(BSNS_HIER_ID,  
  
SHPG_CAT_DESC,SHPG_MTHD_TYP_CDE,REC_CRT_TS,REC_CRT_USR_ID,REC_UPD_TS,REC_UPD_USR_ID)
  VALUES (#bsnsHierID#, #shpgCatDesc#,
  
#shpgMthdTypCode#,#recCreateTS#,#recCreateUserID#,#recUpdateTS#,#recUpdUserID#)
</insert>

Issue: During Runtime, if Ienter a value in the description like - TEST, it 
gets added to this database field as TEST + (251 spaces)
Imade sure that from the when the parameter is passed to the Query Map from 
Java, its trimmed. But still trailing spaces comes in the field. Please let me 
know if this is a bug or I'm doing something wrong.

As of now, I have added RTRIM(#shpgCatDesc#) in the query to trim the space. Is 
this the only solution?


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to