Subject Re: [IBO] Re : cannot edit row error(because of fieldnames like t.field1,t.field2)
Author Helen Borrie
At 01:54 PM 14/11/2003 +0000, you wrote:
>Hi,
>I found that the problem is DISTINCT keyword. I realised that I have
>no problem if I say
>SELECT t.field1,t.field2 FROM table t
>but error occurs if
>SELECT DISTINCT t.field1,t.field2 FROM table t .
>Is there a solution for that?

Well, select DISTINCT is not an updatable query, since the returned rows
are aggregated. To update from a row, you would have to provide custom SQL
to the EditSQL property that would perform this multiple row update.


>I have to use aliasing syntax format because I need to add another
>table to
>where condition (no change in columns). and still have to edit.

That's fine.


>If there is no solution for that how to do it with DML?And where
>would I put
>that DML;in editsql part?

DML is an UPDATE, INSERT or DELETE statement. Use the EditSQL property for
updates, the others are obvious. IBO takes parameter values from the
fields[] array of the select statement automatically, if you match
parameter names to field names. Can be an EXECUTE PROCEDURE statement
(executable SP) if you need that. Provided you have these properties
filled, your non-updatable query becomes updatable, for searched updates only.

HB