db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel John Debrunner (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-448) delete on an empty table generates warning
Date Fri, 08 Jul 2005 15:12:11 GMT
    [ http://issues.apache.org/jira/browse/DERBY-448?page=comments#action_12315314 ] 

Daniel John Debrunner commented on DERBY-448:
---------------------------------------------

For some background, ij is just doing its job as a simple JDBC scripting tool.

JDBC reports an update count for DML statements, such as your delete, this is what ij is reporting,
and since it's just a count of modified rows ij (through JDBC) cannot know if the rows were
inserted/updated or deleted, so it reports the generic message.

For the warnings, ij displays any warning that is raised through JDBC, e.g. ResultSet,getWarnings(),
Statement.getWarnings() etc. So if the JDBC driver (and it can be any JDBC driver, not just
Derby's) raises an exception, ij will display it. That is correct, the driver raised the warning
for a reason and so ij displays it.

If you think  the warning should not be raised at all, that is not an ij (tools) issue, but
a Derby engine issue. This SQLState (02000) is part of the SQLStandard ('no data')  and certain
conditions require it to be raised. I do think some cleanup & investigation is needed
in this area, e.g. Derby does not have a FETCH statement so the text of the warning is misleading.
The warning does not seem to be raised 'if the result of a query is an empty table' so again
the text is misleading,  it doesn't seem like an empty SELECT statement should raise such
a warning.

> delete on an empty table generates warning
> ------------------------------------------
>
>          Key: DERBY-448
>          URL: http://issues.apache.org/jira/browse/DERBY-448
>      Project: Derby
>         Type: Bug
>   Components: Build tools
>     Versions: 10.0.2.1
>  Environment: Solaris
>     Reporter: simmi iyer

>
> 1. Launch ij to connect to Derby using embedded driver.
> 2. Issue delete command at ij prompt
> ij>delete from table ;
> 3. This generates a warning
> 0 rows inserted/updated/deleted
> WARNING 02000: No row was found for FETCH, UPDATE or DELETE; or the result of a query
is an empty table.
> There are two issues here:
> 1. It should say 0 rows deleted instead of 0 rows inserted/deleted/updated.
> 2. WARNING should not be shown.
> thx
> Simmi.

-- 
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