something different had trouble today:
I need to do something that is called cross-table updating, in which I
select rows in one table by using TWO values from another table, and
then I modify a value in the rows that are returned.
H2 seems to have no such functionality
It would be like this (I think mysql can do this)
update table1,table2 set table1.columnX=some_Value where
table1.columnA=table2.columnA and table2.columnQ=5
what I have is that I know a value in table 2, querying using it gets me
40 rows, those rows contain pairs of values I need to use to look in
another table.
but, no can do.
--------------
related: to solve the above problem, I have to do my own loop, get the
value pairs, and use that in a second query to get the correct rows that
I then update.
I wanted to do this:
query = "select ...";
statement.executeQuery(query);
resultSet = statement.getResultSet(params about allowing positioning);
int ct = 0;
while (resultSet.next()) {ct++;} //so I know how many records I have.
for now, this is a small number
resultSet.absolute(0); //back to the beginning
int g1 = resultSet.getInt(1);
and right there I get an Exception about no data, suggesting that
"absolute()" didn't work, so I'm at the end of the dataset and there is
no next record.
Any suggestions? I realize I could execute the query again, but I should
not have to.
-- clint
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.