ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Schall" <mike.sch...@gmail.com>
Subject Re: create table in a mapping file??
Date Mon, 07 Jul 2008 15:43:01 GMT
I think you will have to escape the # in #temp

So references to your temp table would be ##temp.  In some databases ##
means something, but if trace what is actually sent to the database and it
should be a single #.  If you need ## sent to the database, you will have
double each so you would have #### in the statement.

Your map should look like

<insert id="xxx" parameterClass="xxx">
       create table if not exist ##temp
       (
       ...
       )
       INSERT INTO ##temp
       (...)
       VALUES(...)
 </insert>


On Mon, Jul 7, 2008 at 10:10 AM, Larry Meadors <larry.meadors@gmail.com>
wrote:

> How doesn't it work? Silent failure? SQLException?
>
> Larry
>
>
> On Mon, Jul 7, 2008 at 9:08 AM, mimy17 <ninny12@hotmail.com> wrote:
> >
> > Yes, I tried like this:
> >
> > <insert id="xxx" parameterClass="xxx">
> >        create table if not exist #temp
> >        (
> >        ...
> >        )
> >
> >        INSERT INTO #temp
> >        (...)
> >        VALUES(...)
> > </insert>
> >
> > But it doesn't work.
> > I looked in the documentation, but I didn't find a tag like "<create id""
> > ...>
> >
> >
> >
> > Larry Meadors wrote:
> >>
> >> If you can do it with JDBC, you can probably do it with iBATIS.
> >>
> >> Did you try it?
> >>
> >> Larry
> >>
> >>
> >> On Mon, Jul 7, 2008 at 3:46 AM, mimy17 <ninny12@hotmail.com> wrote:
> >>>
> >>> Hi,
> >>>
> >>> I would like to know if it's possible to create a temporary table in
> >>> mapping
> >>> file and how?
> >>>
> >>> Thanks
> >>> --
> >>> View this message in context:
> >>>
> http://www.nabble.com/create-table-in-a-mapping-file---tp18313227p18313227.html
> >>> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> >>>
> >>>
> >>
> >>
> >
> > --
> > View this message in context:
> http://www.nabble.com/create-table-in-a-mapping-file---tp18313227p18318965.html
> > Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> >
> >
>

Mime
View raw message