Reputation: 7228
I am using Jdbctemplate to execute the queries with spring. My database is informix. when i execute the query get the follwing error.
The specified table (t_all) is not in the database.
I think it is because of session disconnection and eventually temp table has gone but i don't know how to fix it.
Does anyone know what is the actual cause and how to fix this?
SELECT
mutto ,
apto ,
over ,
brrnon ,
katy ,
sum(e_b-e_re+aan) nettito
FROM muttito_new
WHERE
aar = 2019 AND
aand = 04 AND
jd = 1 AND
vpl_vr = 1 AND (bro < 500 and (mutto < 751 or (mutto > 900 and mutto < 952))) GROUP BY 1,2,3,4,5
INTO TEMP t_all;
SELECT mutto aluta,
sum(nettito) nettitos
FROM t_all
GROUP BY 1 INTO TEMP t_sel;
jdbcTemplate.execute(selectieQuery());
Upvotes: 1
Views: 1130
Reputation: 1451
Apparently each statement on your SQL string is executed on it's own connection ( I am not sure about this, I am no expert with Spring ). Check using Spring JdbcTemplate for multiple database operations where they suggest the use of Transactions.
Upvotes: 1