delphi programming forums mysql charset mget recursive synonimos
free ventrilo servers hosting cs javascript delay python find in list
Back Forum New
abstract:

                    while (sqlResultsetOwners.next()) {
                        currentAction.addOwner(String.valueOf(sqlResultsetOwners.getInt(1)));
                    }
                    sqlResultsetOwners.close();
                */
                addAction(currentAction);
            }
            sqlResultset.close();
        }
        catch (SQLException E) { return -1; }


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; }

TOP

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

TOP

Ok, people, it is NOT possible to imbricate request this way. You must split your requests in two distinct ones.
::c ya!



                    while (sqlResultsetOwners.next()) {
                        currentAction.addOwner(String.valueOf(sqlResultsetOwners.getInt(1)));
                    }
                    sqlResultsetOwners.close();
                */
                addAction(currentAction);
            }
            sqlResultset.close();
        }
        catch (SQLException E) { return -1; }

TOP

Back Forum