0

I am unable to use temporary tables in my ibatis SQL Query (#table). This query is executed on SQL Server.

DECLARE @file_id int
SET @file_id  = 38--#FileID# 
SELECT * INTO #NotFinishedRecords FROM TABLE
Ishan Adarsh
  • 151
  • 1
  • 7

1 Answers1

0

Here is the example of creating temp table in IBATIS using xml mapper:

<sqlMap namespace="xxx" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <select id="GetTempTableData" resultClass="xxx" parameterClass="System.String">
      Create table ##TestTable(ID varchar(20), Name varchar(100))
      Insert into ##TestTable values('1001-101','ABC')
      Insert into ##TestTable values('1001-102','XYZ')
      Select * from ##TestTable
  </select> 
</sqlMap>