0 Replies Latest reply on Aug 23, 2002 1:52 PM by 3542

    Bug in updatability rules checking ?

    3542
      MS NT4.0SP6
      Oracle Client 9.0.2

      I appear to have found a bug in oo4o concerning the updatability rules checking.

      The SQL updatability rules state (among other things) that a query will not be updatable if the outermost SELECT clause contains a FUNCTION call.

      I opened a ODynaset using the SQL "SELECT TRIM(FIELD1) FROM TBLTEST".

      The CanUpdated() method returns TRUE. However, attempting to add a record using the AddNewRecord() / SetFieldValue() / Update() methods results in the error "ORA-00928: missing SELECT keyword".

      After switching on tracing I found why the error was being reported....

      (291) [23-AUG-2002 14:41:24:752] nspsend: 01 00 00 00 00 20 49 4E |......IN|
      (291) [23-AUG-2002 14:41:24:752] nspsend: 53 45 52 54 20 49 4E 54 |SERT.INT|
      (291) [23-AUG-2002 14:41:24:752] nspsend: 4F 20 74 62 6C 74 65 73 |O.tbltes|
      (291) [23-AUG-2002 14:41:24:752] nspsend: 74 20 28 29 20 56 41 4C |t.().VAL|
      (291) [23-AUG-2002 14:41:24:752] nspsend: 55 45 53 20 28 29 01 00 |UES.()..|
      (291) [23-AUG-2002 14:41:24:752] nspsend: 00 00 01 00 00 00 00 00 |........|
      (291) [23-AUG-2002 14:41:24:752] nspsend: 00 00 00 00 00 00 00 00 |........|
      (291) [23-AUG-2002 14:41:24:752] nspsend: 00 00 00 00 00 00 00 00 |........|
      (291) [23-AUG-2002 14:41:24:752] nspsend: 00 00 04 00 00 00 00 00 |........|
      (291) [23-AUG-2002 14:41:24:752] nspsend: 00 00 00 00 00 00 00 00 |........|
      (291) [23-AUG-2002 14:41:24:752] nspsend: 00 00 00 00 00 00 |...... |

      Basically, the INSERT statement being built in the background is incorrectly formatted, presumably because of the FUNCTION in the select list.

      Am I right in thinking that CanUpdate should return FALSE in the above scenario ?

      Thanks

      Adrian
      LBS Ltd, UK
      www.lbs-ltd.com