db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-231) "FOR UPDATE" required for updatable result set to work
Date Tue, 23 Aug 2005 20:57:09 GMT
    [ http://issues.apache.org/jira/browse/DERBY-231?page=comments#action_12319792 ] 

Rick Hillegas commented on DERBY-231:
-------------------------------------

Roy Lyseng has traced the tortuous path through the SQL spec which allows this syntax:

part 3 - "Call level interface" chapter 6.50 Prepare, says that the statement text can (among
other things) be a <dynamic select statement> which is defined in part 5 - "Host language
bindings" chapter 15.6 Prepare statement as a <cursor specification>, which is defined
in part 2 "Foundation", chapter 14.1 Declare cursor as:

<cursor specification> ::=
  <query expression> [ <order by clause> ] [ <updatability clause> ]

and

<updatability clause> ::=
  FOR { READ ONLY | UPDATE [OF <column name list> ] } 

> "FOR UPDATE" required for updatable result set to work
> ------------------------------------------------------
>
>          Key: DERBY-231
>          URL: http://issues.apache.org/jira/browse/DERBY-231
>      Project: Derby
>         Type: Improvement
>   Components: SQL
>     Versions: 10.0.2.1
>     Reporter: Dag H. Wanvik
>     Priority: Minor
>  Attachments: fff
>
> To get an updatable result set, the JDBC 3.0 spec, section 14.2.4 
> "Modifying ResultSet Objects" states: 
>     "ResultSet objects with concurrency CONCUR_UPDATABLE can be updated
>      using ResultSet objects".
> In addition, Derby requires the SQL SELECT statement to have a "FOR
> UPDATE" clause for updates to be allowed. This may be a usability issue, as
> many examples, e.g. in "JDBC API tutorial and reference and reference"
> book and the JDBC 3.0 Specification (14.2.4.1) do not include a "FOR
> UPDATE" clause in the SQL SELECT.
> Mamta Satoor says:
> "Derby implements the JDBC updatable resultset by using the existing
>  updatable cursor implementation. And in order to do that, it requires
>  that the SELECT statement should include the FOR UPDATE clause. One
>  can change the Derby implementation so that it does not require FOR
>  UPDATE clause to piggyback on updatable cursor implementation."
> Dan DeBrunner says:
> "Technically I wonder if this is covered by the JDBC standard, I see
>  nothing in the JDBC 3.0 that states any requirements for the SQL
>  statement for an updateable result set. I know the JDBC tutorial book
>  has some guidelines as to what will typically work, but isn't it up to
>  the database engine to define what works here?
>  Having said that I think that not requiring the FOR UPDATE would be a
>  useful improvement."

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message