ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Campbell" <michael.campb...@gmail.com>
Subject Re: dynamic script's
Date Thu, 24 Aug 2006 13:46:36 GMT
Does this not depend on how Prepared Statements are implemented?  As I
recall, one of the big db's does them as a stored proc.  In that
light, multiple statements seems reasonable, but this sort of behavior
(like most things) might not valid across all the dbs that one might
consider.

I guess the answer is, "try it".  =)

On 8/24/06, Larry Meadors <lmeadors@apache.org> wrote:
> This works perfectly in Oracle:
>
> <delete id="delete">
>   BEGIN
>     DELETE FROM Child WHERE childId = #parentId#;
>     DELETE FROM Parent WHERE parentId = #parentId#;
>   END;
> </delete>
>
> It is a single prepared statement, and performs great.
>
> Larry
>
>
> On 8/23/06, Daniel Pitts <Daniel.Pitts@cnet.com> wrote:
> > Is there a way to run an SQL "script" from iBATIS?
> > Such as:
> > INSERT INTO foo (#bar#, #baz#);
> > INSERT INTO ho (#hum#);
> >
> >
> > Also, if there is, is it possible to dynamically generate the SQL to do
> > so?
> > Eg:
> > INSERT INTO foo (#bar#, #baz#);
> > <iterate property="hos">INSERT INTO ho (#bar#, #hos[]#);</iterate>
> >
> > Thanks.
> >
> >
> >
> >
>


-- 
If you're as clever as you can be when you write it, how will you ever
debug it?  -- Brian Kernighan

Mime
View raw message