ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles SCHLIENGER <gilles.schlien...@cncc.fr>
Subject Using a user variable in a request with MySQL
Date Thu, 11 Jun 2009 13:42:53 GMT
Hello,

I'm using iBATIS (2.3.4.726) integrated with Spring, MySQL 5.0 (iBATOR with Eclipse) and I
love it.

I'm faced with a specific need where I have to use a MySQL user variable.

I need to execute the following (simplified) request from my java code:

SET @NUM=0;
SELECT (@NUM:=@NUM+1), JET_ID FROM JETON
    WHERE JET_FK_ABO_ID = 3;

If I put this inside a <select> tag in my SqlMap, it complains
If I put this in 2 successive queries, the user variable might not be reset if it's not in
the same connexion

Ideally, I would even like to have my variable use a different custom name everytime, just
in case of concurrent calls.

Would anyone have any idea as to how to do that ?
Thanks a lot in advance!
Regards
Gilles


Mime
View raw message