ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher.Mathru...@sybase.com
Subject Re: DELETE statement deletes all rows in table
Date Thu, 12 Feb 2009 20:44:19 GMT
I've been using iBatis with ASE for quite some time now and I have never 
encountered this issue with delete. If it works via iSQL then it should 
work via JDBC. You can always enable tracing in the JConnect driver to 
ensure that the SQL being executed is what you expect. You can even 
intercept the SQL with a tool like Ribo, playing a proxy between your app 
and the database.  Other than that, I really have no suggestions other 
than to look closely at your SQL.

Per the ASE documentation:
A simplified version of delete syntax is: 
delete table_name 
     where column_name = expression 
Here is the complete syntax statement, which shows that you can remove 
rows either on the basis of specified expressions or based on data from 
other tables: 
delete [from] 
     [[database.]owner.]{view_name | table_name}
     [where search_conditions]
delete [[database.]owner.] {table_name | view_name} 
     [from [[database.]owner.]{view_name | table_name          [(index {
index_name | table_name }
               [prefetch size ] [ lru | mru])]} 
          [, [[database.]owner.] {view_name | table_name          (index {
index_name | table_name }
               [prefetch size ] [lru | mru])]}]...] 
     [where search_conditions] 
delete [from] 
     [[database.]owner.] {table_name | view_name}
     where current of cursor_name 
The where clause specifies which rows are to be removed. When no where 
clause is given in the delete statement, all rows in the table are 
removed.





Larry Meadors <larry.meadors@gmail.com> 
02/12/2009 12:08 PM
Please respond to
user-java@ibatis.apache.org


To
user-java@ibatis.apache.org
cc

Subject
Re: DELETE statement deletes all rows in table






On Thu, Feb 12, 2009 at 11:16 AM, Burke.Kevin <Kevin.Burke@cic.gc.ca> 
wrote:
> Hmmm...I have the iBatis source.  I think I will have to step down and
> get dirty to see what is happening.  I know how to avoid this side
> effect, but curiousity has me now.  From the replies, it doesn't sound
> like anyone else running Sybase with iBatis has experienced this.

That's a good idea.

We do have a few sybase users (I think one may be a sybase employee)
on the list.

They might have some ideas, but I think one of them is on a cruise this 
week.

I'm not jealous or anything. ;-)

Larry



Mime
View raw message