Subject Re: Cursor not updatable ???
Author Svein Erling Tysvær
Hi Eyal!

Does the error occur if you explicitly set KeyLinks? I'm not saying
that there is no error to be fixed, just that if there is an error,
then maybe it hasn't been discovered since most people tend to set
KeyLinks. Without KeyLinks or KeyLinksAutoDefine, I'm even surprised
to learn that IBO tries the update.

(and then just a little check to rule out plain stupidity: We're not
talking about rows that have just been inserted and where the PK is
assigned through a trigger?)

Set

--- In IBObjects@yahoogroups.com, "Eyal" wrote:
> > Put in your own EditSQL and use it instead of the one that is
> > created for your automatically.
>
> Jason,
>
> That works, but defeats my goal of updating only changed columns (or
> no update if nothing changed).
>
> Also why don't the update statements that IBO generates work? I
> traced the code to the point where IBO calls the API, and the query
> seems to be ok, something like:
>
> UPDATE table SET col=? WHERE CURRENT OF cursor_id
>
> I also tried with SearchedEdits=TRUE and KeyLinksAutoDefine=TRUE, so
> the resulting update statement uses the "normal" method of updating
> a row based on the ID column. The query passed to the API looks
> like:
>
> UPDATE table SET col=? WHERE table.ID=?
>
> This looks ok, and doesn't trigger any exception, but it also
> doesn't work!
>
> Although I'm not really familiar with the API level, I may have
> figured out what is wrong. It seems that the parameter block for the
> search column (in this case ASQLDA.SQLVAR[1]) - always contains a
> zero value for the column. If this is indeed the case then the
> search fails and so the update never happens.
>
> Unfortunately, I can't get non-prepared-edits mode to work. There's
> a problem in case of a cursor update, and another problem in case of
> a searched update.
>
> Is there any way to get this working? I really like the idea of IBO
> taking care to update the required columns, or not update at all, as
> needed.
>
> Regards,
>
> Eyal.