Title: iBatis insertion issue, thanks!

HI,

My name is Tim Ding, working as Java Developer/iBATIS Developer. I want to use one stanza (that is, for example <insert> and </insert>) or <statement>s (like <statement> and </statement>) to do more than one SQL insertions. The example likes:

<insert id="save_account_profile" parameterClass="java.util.HashMap">
        <selectKey resultClass="int" keyProperty="pk">
                ACCOUNT_PROFILE_SEQ.NEXTVAL AS pk from dual
        </selectKey>
       
        <!-- first insertion -->
      insert into PROFILE_HISTORY
        (PK,
        TYPE,
        DATE,
        ACCOUNT_ID,
        …...
        )
        values
        (#pk#,
        #type#,
        #date#,
        #acountId#,
      …...
      )

        <!-- second insertion -->
      insert into ACCOUNT_SUMMARY
        (PK,
        PRODUCTION_DATE,
        CYCLE_CODE,
        …...
      )
        values
        (#pk#,
        #billingCycleDate#,    
        #cycleCode#,
            …..
            )
</insert>

It seems that I had found documents/user guide for this kind of iBatis insertion before, but I cannot find where it is now. When I try to run it, there is an exception about the iBatis syntax. Could you please let me know what is the correct syntax for this type of iBatis statement. Thank you very much!


Regards!

Tim Ding
Billing Collections
Tel: 604-432-2167
10T1 #77 BNBYBCHQ



Reply via email to