Subject RE: [IBO] Data Aware components - question
Author Helen Borrie
At 12:15 PM 19/10/2004 +1000, you wrote:

>Helen,
>
>I'm writing this on behalf of Daniel (my co-worker) to try and explain what
>he is trying to achieve.
>
>In Daniel's GUI he has a number of TIB_Edit components that display data
>from the current row of the TIB_Cursor.
>
>Let's assume he has the RequestLive property to true - under these
>circumstances the user can edit the contents of the TIB_Edit controls and
>have the changes posted back to the database. In Daniel's case, he cannot
>use 'RequestLive = true' because of multiple tables etc.
>
>When using 'RequestLive = false' the TIB_Edit controls become disabled and
>therefore the user is not able to edit the contents of the fields.
>
>Daniel is basically asking how can he enable the controls so the data can be
>edited, followed by a manual construction of the required xxxxSQL statement.
>If this is not possible, is his only alternative approach to use non-db
>aware controls. Other than that, what other choices does he have ?

As has already been explained at length, the way to make a non-editable set
"live" is to provide xxxxSQL properties for it. To be more explicit, since
there might be a language problem here, the properties are called EditSQL
(for a custom update statement), InsertSQL (for a custom Insert statement)
and DeleteSQL (for a custom Delete statement). There is also LockSQL (for
a custom pessimistic locking statement, if PessimisticLocking is wanted.)

Since a DML statement cannot update multiple tables, the normal way to use
these xxxxSQL properties is to write parameterised stored procedures to get
the effect you want. Match the input parameter names of the EXECUTE
PROCEDURE statement with the names of the keys in the ib_query or iboquery,
and IBO will automatically match them up when it's about to post the DML
request.

Perhaps it hasn't been clear that the "live" condition is determined by the
ability of the query to be updated. For the "simple" query (single table,
no grouping, all keys present and accounted for in KeyLinks) it's enough to
set RequestLive true. IBO will construct the xxxxSQL.

If you provide valid xxxxSQL properties then the dataset will be "live" for
the xxxx operations. It makes no difference then whether you set the
RequestLive property or not, the "liveness" applies to the xxxx that you
have an xxxxSQL for. So, for example, if you provide EditSQL and InsertSQL
but no DeleteSQL, then you will be able to update and insert, but not delete.

The setting of RequestLive is also irrelevant if you have bad keylinks or
any dataset that is not updatable with custom xxxxSQL.

If you're really this "stuck", phone me if you like. (02) 4389 1685.

Helen