Return-Path: Delivered-To: apmail-ibatis-dev-archive@www.apache.org Received: (qmail 90706 invoked from network); 12 May 2006 01:21:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 12 May 2006 01:21:38 -0000 Received: (qmail 49023 invoked by uid 500); 12 May 2006 01:21:42 -0000 Delivered-To: apmail-ibatis-dev-archive@ibatis.apache.org Received: (qmail 49005 invoked by uid 500); 12 May 2006 01:21:41 -0000 Mailing-List: contact dev-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ibatis.apache.org Delivered-To: mailing list dev@ibatis.apache.org Received: (qmail 48991 invoked by uid 99); 12 May 2006 01:21:41 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 May 2006 18:21:41 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=HTML_MESSAGE,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of Tim.Ding@telus.com designates 204.174.64.46 as permitted sender) Received: from [204.174.64.46] (HELO bliksem.nssi.telus.com) (204.174.64.46) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 May 2006 18:21:35 -0700 DomainKey-Signature: s=bliksem.nssi; d=telus.com; c=simple; q=dns; b=IEXiso5Wo2ADcQCX506m4+swobvo+s/9A0ixKxKYK97lOabEwGEQQHGzPf0MrFnA4qPyryeKzHpt2sTvUEOSzq91y3qWuzptnVkqWzfwVb+cuaxIQdrNIQUCnisMdPeiXLep1+7MxTYXRYfQQGaIosVQ3np4wpx3iBFe9YSZfZU=; Received: from unknown (HELO bcmsg103.corp.ads) ([142.174.10.3]) by bliksem.nssi.telus.com with ESMTP; 12 May 2006 01:21:14 +0000 X-SBRS: None X-BrightmailFiltered: true X-Brightmail-Tracker: AAAAAA== X-IronPort-AV: i="4.05,117,1146441600"; d="scan'208,217"; a="555656965:sNHT53077446" Received: from BCMSG111.corp.ads ([142.174.35.32]) by bcmsg103.corp.ads with Microsoft SMTPSVC(6.0.3790.1830); Thu, 11 May 2006 18:21:14 -0700 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C67562.5B358E1F" Subject: RE: iBatis insertion issue, thanks! Date: Thu, 11 May 2006 18:21:12 -0700 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: RE: iBatis insertion issue, thanks! Thread-Index: AcZ1YltRxjiSyrZtQEaRnI0DZc5mug== From: "Tim Ding" To: X-OriginalArrivalTime: 12 May 2006 01:21:14.0043 (UTC) FILETIME=[5C2E70B0:01C67562] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------_=_NextPart_001_01C67562.5B358E1F Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable HI Daniel, In iBatis, we can use null value replacements like: ///////////////////////// insert into PROCESS=20 ( PROCESS_ID,=20 ....=09 DATA_SRC_ID ) VALUES ( #processId:NUMERIC#, ... #dataSourceId:NUMERIC:0# ) /////////////////////////////////////// Can I use it in the update case like? /////////////////////////////////////// update PROCESS =20 set DATA_SRC_ID =3D #dataSourceId:0#, ..... where PROCESS_ID =3D #processId# ////////////////////////////////////// Thank you very much! Tim Ding -----Original Message----- From: Daniel Henrique Ferreira e Silva [mailto:dhsilva@gmail.com]=20 Sent: Friday, October 28, 2005 2:28 PM To: dev@ibatis.apache.org Subject: Re: iBatis insertion issue, thanks! Hi Tim, This kind of stuff is not much encouraged by iBATIS staff but depending = on your database, i guess it is possible. It's not encouraged because = you can use stored procedures. iBATIS supports store procedures smoothly = and then you'll can use all resources your database engine delivers to = you, like savepoints and any other one that i can't remember of right now. Cheers, Daniel Silva. On 10/28/05, Tim Ding wrote: > > > > HI, > > My name is Tim Ding, working as Java Developer/iBATIS Developer. I=20 > want to use one stanza (that is, for example and )=20 > or s (like and ) to do more than=20 > one SQL insertions. The example likes: > > > > ACCOUNT_PROFILE_SEQ.NEXTVAL AS pk from dual > > > > insert into PROFILE_HISTORY > (PK, > TYPE, > DATE, > ACCOUNT_ID, > ...... > ) > values > (#pk#, > #type#, > #date#, > #acountId#, > ...... > ) > > > insert into ACCOUNT_SUMMARY > (PK, > PRODUCTION_DATE, > CYCLE_CODE, > ...... > ) > values > (#pk#, > #billingCycleDate#, > #cycleCode#, > ..... > ) > > > 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=20 > let me know what is the correct syntax for this type of iBatis=20 > statement. Thank you very much! > > > Regards! > > Tim Ding > Billing Collections > Tel: 604-432-2167 > 10T1 #77 BNBYBCHQ > > ------_=_NextPart_001_01C67562.5B358E1F Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable RE: iBatis insertion issue, thanks!

HI Daniel,

In iBatis, we can use = null value replacements like:

/////////////////////////
insert into PROCESS
        ( PROCESS_ID,
          .... 
          DATA_SRC_ID ) VALUES
        ( #processId:NUMERIC#,
          ...
          #dataSourceId:NUMERIC:0# )
///////////////////////////////////////

Can I use it in the = update case like?

///////////////////////////////////////
update PROCESS 
        set DATA_SRC_ID =3D #dataSourceId:0#,
          .....
      = where PROCESS_ID =3D #processId#
//////////////////////////////////////

Thank you very = much!
Tim Ding


-----Original Message-----
From: Daniel Henrique Ferreira e = Silva [mailto:dhsilva@gmail.com]
Sent: Friday, October 28, 2005 = 2:28 PM
To: dev@ibatis.apache.org
Subject: Re: iBatis insertion = issue, thanks!

Hi Tim,

This kind of stuff is not much = encouraged by iBATIS staff  but depending on your database, i guess = it is possible. It's not encouraged because you can use stored = procedures. iBATIS supports store procedures smoothly and then you'll = can use all resources your database engine delivers to you, like = savepoints and any other one that i can't remember of right = now.

Cheers,
Daniel Silva.

On 10/28/05, Tim Ding = <Tim.Ding@telus.com> wrote:
>
>
>
> 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=3D"save_account_profile" = parameterClass=3D"java.util.HashMap">
>         <selectKey = resultClass=3D"int" keyProperty=3D"pk">
>          &nbs= p;      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#,
>          &nbs= p;  …..
>          &nbs= p;  )
> </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
>
>


------_=_NextPart_001_01C67562.5B358E1F--