"John T. Dow" <[email protected]> writes: > I get this error message: > > 'updateString' not allowed because the ResultSet is not an updatable > ResultSet. > > It happens after creating a result set with this query: > > select * from orders where (orders.recordno = (select max(orders.recordno) > from orders)) > > The problem does not occur with this query: > > select * from orders where (orders.recordno = '1234') > > The program has one connection to the database but several > simultaneous statements and result sets, basically doing data entry > and display for different tables in different frames. > > Statements are created like this: > > stmt = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, > ResultSet.CONCUR_UPDATABLE); > > I know there are conditions that have to be met for an updatable > result set (eg no ORDER BY), but I don't see how this query violates > any of the conditions.
Hi John, I think the problem is the subquery in the WHERE clause. This restriction is not listed in the documentation (the reference manual only mentions subqueries in the FROM clause), but the code actually makes the cursor read-only if it finds a subquery in a WHERE clause. It would be great if you could log this in the bug tracker (https://issues.apache.org/jira/browse/DERBY) so that we can get the documentation fixed or, if there's no need for the restriction, get the restriction lifted. Thanks, -- Knut Anders
