Clint Hyde
unread,Jul 18, 2012, 1:22:57 AM7/18/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to h2-da...@googlegroups.com
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