You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Vyas (JIRA)" <ib...@incubator.apache.org> on 2007/09/06 14:34:32 UTC

[jira] Created: (IBATIS-455) iBatis - Additional space gets added in the SQL Server table fields while the data gets added.

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.


[jira] Commented: (IBATIS-455) iBatis - Additional space gets added in the SQL Server table fields while the data gets added.

Posted by "Brandon Goodin (JIRA)" <ib...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/IBATIS-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12525456 ] 

Brandon Goodin commented on IBATIS-455:
---------------------------------------

It is best for you to post questions like this to the user list. Once it is confirmed as a bug you should enter it here. I would encourage you to try this with straight jdbc. It may be an issue with your JDBC driver. Additionally, it would be good for you to enabling logging and provide the logging output that occurs during this operation. I can say that iBATIS does nothing unusual. It uses PreparedStatement to set values underneath just like straight JDBC would.

> 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)
> I made 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.