ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barnett, Brian W." <brian.barn...@pearson.com>
Subject Multiple queries in one call
Date Mon, 11 Jul 2005 20:28:37 GMT
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

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"

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. 

View raw message