Just to get some context, how many records do you insert in the temp table? 10? 100? 1000? Millions?
Is $input_data, not #input_data
Use $tmpTable NOT #tmpTable
Hi Frank,I am pretty new to MyBatis and would need to do the same stuff as discussed in this post.The backend Database I am using is SQL Server 2008. But I am facing a concern. When I create a temp table using :CREATE TABLE #tmpTable ( .. )and in the next statement, I try to populate the temp table using:INSERT INTO #tmpTable VALUES (#{val1}, #{val2}),I get an exception that Object #tmpTable not found. Although I am using the same connection .If I use ##tmpTable, it works fine. But here the issue is SQL Server creates a Global Temp table which is not session specific.Could you please help me in this. I googled that using MyBatis, you need to escape #, else it takes it as a parameter argument.Is it you cannot create Local temp tables with MyBatis on SQL Server.Thanks in advance.
Sorry, try ${tmpAssignment}
Please read the docs, it is very well explained there how and when to use string intetpolation ${...} instead of parameter binding #{...}