Of course this is an option, but I am not sure I would go to this path. Any way if there is no other way than sp's, I guess I am happy with 2 calls.
Thanks for your input Chris. Regards, RJ. _____ From: Chris O'Connell [mailto:[email protected]] Sent: Tuesday, February 24, 2009 9:13 AM To: [email protected] Subject: Re: reading an identity column and inserting it in to other table Stored procedure. On Tue, Feb 24, 2009 at 8:42 AM, Rashid Jilani <[email protected]> wrote: Hi: Mario thanks for response. I am already doing exactly what you have told, and it is working, but I was looking to do every thing in 1 call instead of 2 calls. Right now I first call the statement inseretIntoUser, and then invoke other call to store the id attribute returned by sqlmap.insert(). I thought there must be more elegant way to do all this in 1 call? Regards, RJ. -----Original Message----- From: Mario Ds Briggs [mailto:[email protected]] Sent: Monday, February 23, 2009 10:06 PM To: [email protected] Cc: [email protected] Subject: Re: reading an identity column and inserting it in to other table Aside to mysql identity semantics, in all cases iBatis will return the db generated value as the return of the sqlmap.insert() call. Additionally in your use case below, if the 'RegisteredUser' object has a 'ID' attribute, ibatis will set it to the db generated value. You can also control the attribute that ibatis will set the value into using 'keyProperty' of <selectkey> Mario -- -- Chris O'Connell Application Developer Gorilla 312.243.8777 x19
