[fdo-trac] #80: Incomplete DELETE SQL

FDO trac_fdo at osgeo.org
Thu May 31 16:52:39 EDT 2007


#80: Incomplete DELETE SQL
-----------------------------------+----------------------------------------
   Reporter:  mloskot              |       Owner:  haris
       Type:  defect               |      Status:  new  
   Priority:  major                |   Milestone:  3.3.0
  Component:  KingOracle Provider  |     Version:  3.2.0
   Severity:  3                    |    Keywords:       
External_id:                       |  
-----------------------------------+----------------------------------------
 According to my knowledge about Oracle SQL syntax, I'm inclined to judge
 there is a bug in the implementation of FdoIDelete command in the King
 Oracle.

 In file [source:trunk/Providers/KingOracle/src/Provider/c_KgOraDelete.cpp
 c_KgOraDelete.cpp], line 60, the SQL command is built as follows:

 {{{
 sqlstr.AppendString("DELETE ");
 sqlstr.AppendString(fultablename);
 sqlstr.AppendString(" ");
 sqlstr.AppendString(table_alias);
 }}}

 IMO, there is missing '''FROM''' token.

 It's possible to use
 {{{
 DELETE <table>;
 }}}

 syntax but only if all rows are being deleted, as equivalent to

 {{{
 DELETE FROM <table>;
 }}}

 But, in the provider, it's possible to have filter, so the syntax should
 always use '''FROM''' token, to make the SQL working with deletions of
 both, all and selected rows.

 Summarizing, IMO the code should look as follows:

 {{{
 sqlstr.AppendString("DELETE FROM ");
 sqlstr.AppendString(fultablename);
 sqlstr.AppendString(" ");
 sqlstr.AppendString(table_alias);
 }}}

-- 
Ticket URL: <http://trac.osgeo.org/fdo/ticket/80>
FDO <http://fdo.osgeo.org/>
Feature Data Objects


More information about the fdo-trac mailing list