Colum name BUG

2004-12-07
2013-04-11
  • wang panzhang
    wang panzhang
    2004-12-07

    I have a table with two Date fields in Oracle DB:
    QUEUE_ITEM_MODIFY_DT_TIME,
    QUEUE_ITEM_CREATE_DT_TIME.
    sql map like below:
    <insert id="insertDate"
        parameterClass="testDate"
        >
        insert into TEST_DATE (
          id,
          QUEUE_ITEM_MODIFY_DT_TIME,
          QUEUE_ITEM_CREATE_DT_TIME)
        values (
          oracle_SEQ.nextval,
          #modifyOn,javaType=java.util.Date,jdbcType=TIMESTAMP#,
          #createOn,javaType=java.util.Date,jdbcType=TIMESTAMP#
        )
      </insert>

    It insert ok, but QUEUE_ITEM_MODIFY_DT_TIME always 0/0/0000, QUEUE_ITEM_CREATE_DT_TIME is ok.

    When change colums name to :
    QUEUE_ITEM_MODIFY_DT_TIMES,
    QUEUE_ITEM_CREATE_DT_TIMES,
    Both works ok.

     
    • Clinton Begin
      Clinton Begin
      2004-12-07

      From an ibatis perspective this doesn't really make much sense.  iBATIS isn't dependent on any name or naming conventions.  I'm not sure what this could be.

      ??? anyone else have a guess?

       
      • wang panzhang
        wang panzhang
        2004-12-07

        I have made some other tests on two DATE fields suffixed with DT_TIME.

        When specified colum name with insert into clause,  first field always is "0/0/0000". 

         
    • wang panzhang
      wang panzhang
      2004-12-07

      Dear cbegin,

      It is strangeous. If I made changes as follows, It will work.
      insert into TEST_DATE values (
      oracle_SEQ.nextval,
      #modifyOn,javaType=java.util.Date,jdbcType=TIMESTAMP#,
      #createOn,javaType=java.util.Date,jdbcType=TIMESTAMP#
      )

       
      • Kris Jenkins
        Kris Jenkins
        2004-12-07

        That's very weird.  The fact that it works when you don't specify the column names is particularly strange...

        Can you post a DESC of the table?  And which Oracle driver are you using (thin/oci)?

        Kris

         
        • wang panzhang
          wang panzhang
          2004-12-07

          Below is table schema, using classes12.jar, and url is
          jdbc:oracle:thin:@10.240.4.142:1521:testdb.

          CREATE TABLE TEST_DATE
          (
            ID VARCHAR2(20 BYTE),
            QUEUE_ITEM_MODIFY_DT_TIME  DATE,
            QUEUE_ITEM_CREATE_DT_TIME  DATE
          )

           
        • wang panzhang
          wang panzhang
          2004-12-07

          continued..
          Oracle running windows 2000 server, oracle version is 9.0.1.1

           
    • Kris Jenkins
      Kris Jenkins
      2004-12-07

      Hmm...it could be the mismatch between DATE and TIMESTAMP, which are handled quite differently in Oracle.  Try this instead:

      <insert id="insertDate"
      parameterClass="testDate"
      >
      insert into TEST_DATE (
      id,
      QUEUE_ITEM_MODIFY_DT_TIME,
      QUEUE_ITEM_CREATE_DT_TIME)
      values (
      oracle_SEQ.nextval,
      #modifyOn,javaType=java.util.Date,jdbcType=DATE#,
      #createOn,javaType=java.util.Date,jdbcType=DATE#
      )
      </insert>

      Kris

       
      • Brandon Goodin
        Brandon Goodin
        2004-12-07

        guys, why isn't this thread on the list?

        mailto:ibatis-user-java-subscribe@incubator.apache.org

        We should close these forums or change the name to CLOSED - ...
        Brandon