db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John English <john.fore...@gmail.com>
Subject Re: deleting a record - still a problem
Date Wed, 23 Oct 2013 10:05:59 GMT
On 23/10/2013 06:44, Bob M wrote:
> The error is that my SELECT can not have "For UPDATE" ????
>
> s.setCursorName("MYCURSOR");
> rs = s.executeQuery("SELECT * FROM tablename ORDER BY Date ASC, Time ASC
> FETCH FIRST ROW ONLY FOR UPDATE");

So it *can* have FOR UPDATE...

> rs.next();
>
> psDelete = conn.prepareStatement("DELETE FROM tablename WHERE CURRENT OF
> MYCURSOR");
> statements.add(psDelete);

Why not just use rs.deleteRow() instead of using a cursor?

-- 
John English

Mime
View raw message