|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
imbricated SQL requests possible?
Hi all!
I'm trying to make a code like this work: sqlRequest = "request" try { sqlResultset = sqlStatement.executeQuery(sqlRequest); while (sqlResultset.next()) { /* s'y a ces lignes il ne met que la première action dans l'objet. sinon ça marche, il met les 5. String actID = String.valueOf(sqlResultset.getInt(1)); sqlRequest = "SELECT actionowner.employeeID " + "FROM actionowner WHERE actionowner.meetingID = '" + id + "' " + "AND actionowner.actionID = '" + actID + "';"; sqlResultsetOwners = sqlStatement.executeQuery(sqlRequest); while (sqlResultsetOwners.next()) { currentAction.addOwner(String.valueOf(sqlResultsetOwners.getInt(1))); } sqlResultsetOwners.close(); */ addAction(currentAction); } sqlResultset.close(); } catch (SQLException E) { return -1; } |
|
#2
|
|||
|
|||
|
Sorry!
Sorry, I posted without finishing to write!!
In fact the question is if it is possible to imbricate two statements. If you look the code I posted, you'll see commented lines. If I don't put these lines I got all the "actions" I want, but if I do, it gets only one action. (Every action has owners in a separated table). By the way, what are the (html?) tags to post code here? Thanks a lot! Tiago |
|
#3
|
|||
|
|||
|
found the answer
Ok, people, it is NOT possible to imbricate request this way. You must split your requests in two distinct ones.
::c ya! ![]() |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > imbricated SQL requests possible? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|