You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "paul.wang" <pa...@mphasis.com> on 2004/12/08 02:47:43 UTC
Insert problem whith wrong column sequence in SQL map
I have a table with two date fields, and table schema, sql map like
below:
My prolem is the insert clause using different ordering of table
columns, then problem happens:
QUEUE_ITEM_MODIFY_DT_TIME DATE is 0/0/0000
QUEUE_ITEM_CREATE_DT_TIME DATE is 12/8/2004 09:19:57 and this is ok.
I am using iBatis 2.0.8, Oracle 9i. Is it a bug introducing by iBatis?
[Table schema]:
CREATE TABLE TEST_DATE ( ID VARCHAR2(20 BYTE), QUEUE_ITEM_MODIFY_DT_TIME
DATE, QUEUE_ITEM_CREATE_DT_TIME DATE )
[SQL mapping]:
<insert id="insertDate" parameterClass="testDate"> insert into
TEST_DATE ( id, QUEUE_ITEM_CREATE_DT_TIME,
QUEUE_ITEM_MODIFY_DT_TIME) values ( oracle_SEQ.nextval,
#createOn,javaType=java.util.Date,jdbcType=TIMESTAMP#,
#modifyOn,javaType=java.util.Date,jdbcType=TIMESTAMP# ) </insert>
Regards,
Paul
Re: Insert problem whith wrong column sequence in SQL map
Posted by Clinton Begin <cl...@gmail.com>.
I've never seen this before. But you might try using DATE instead of
TIMESTAMP, as that's the actual type of your column.
Clinton
On Wed, 08 Dec 2004 09:47:43 +0800, paul.wang <pa...@mphasis.com> wrote:
> I have a table with two date fields, and table schema, sql map like
> below:
> My prolem is the insert clause using different ordering of table
> columns, then problem happens:
> QUEUE_ITEM_MODIFY_DT_TIME DATE is 0/0/0000
> QUEUE_ITEM_CREATE_DT_TIME DATE is 12/8/2004 09:19:57 and this is ok.
>
> I am using iBatis 2.0.8, Oracle 9i. Is it a bug introducing by iBatis?
>
> [Table schema]:
> CREATE TABLE TEST_DATE ( ID VARCHAR2(20 BYTE), QUEUE_ITEM_MODIFY_DT_TIME
> DATE, QUEUE_ITEM_CREATE_DT_TIME DATE )
>
> [SQL mapping]:
> <insert id="insertDate" parameterClass="testDate"> insert into
> TEST_DATE ( id, QUEUE_ITEM_CREATE_DT_TIME,
> QUEUE_ITEM_MODIFY_DT_TIME) values ( oracle_SEQ.nextval,
> #createOn,javaType=java.util.Date,jdbcType=TIMESTAMP#,
> #modifyOn,javaType=java.util.Date,jdbcType=TIMESTAMP# ) </insert>
>
> Regards,
> Paul
>