ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <larry.mead...@gmail.com>
Subject Re: Multiple queries in one call
Date Mon, 11 Jul 2005 21:04:31 GMT
try a ";" between the sql stmts.

On 7/11/05, Barnett, Brian W. <brian.barnett@pearson.com> wrote:
> Anyone know how to make something like this work in MS SQL Server? I have
> two select statements, the first selects into a temp table and the second
> selects from the temp table. I want to do it in one call to the db. I need
> help with the SQL. I can execute both queries in SQL Query Analyzer just
> fine, but I can't when I use iBATIS. Is there a different syntax I need to
> use?
> 
> The SQL is something like this:
> SELECT col1, col2 FROM table1 INTO ##mytemptable
> JOIN table2 ON blah blah
> JOIN table3 ON blah blah
> WHERE blah blah
> 
> SELECT DISTINCT col1, col2 FROM ##mytemptable
> 
> 
> SQL Map snippet:
> <select id="getData" resultMap="result_map"
> parameterClass="java.util.HashMap">
>         $sql$
> </select>
> 
> TIA,
> Brian Barnett
> 
> ****************************************************************************
> This email may contain confidential material.
> If you were not an intended recipient,
> Please notify the sender and delete all copies.
> We may monitor email to and from our network.
> ****************************************************************************
>

Mime
View raw message