Subject Re: [IBO] Problems updating a cursor
Author Helen Borrie
At 05:31 PM 22/05/2004 +0200, you wrote:
>hello all,
>
>I'm having some troubles trying to enter into update state with a
>TIB_Query. The SQL property of this query is the following:
>
>SELECT CMPL.COMPLAIN_DATE CMPL_DATE, COMP.Call_Sign COLL_CALL,
>CMPL.Complainer_Call_Sign_In_Qso COLL_CALL_QSO, ANAG.Call_Sign
>CMPL_CALL,
>
>CMPL.Call_Sign_In_Qso CMPL_CALL_QSO, CMPL.Qso_Date, CMPL.Qso_Time,
>
>ENT.Entity_Name, CMPL.Contibution, ANAG.Qsl_Manager STD_QMAN,
>
>CMPL.Qsl_Manager ALT_QMAN, ANAG.Mail_Manager STD_MMAN,
>
>CMPL.Mail_Manager ALT_MMAN, CMPL.Rejected, CMPL.Rejection_Reason,
>
>CMPL.Checked FROM TEMP_COMPLAINS CMPL
>
>JOIN TEMP_COMPLAINERS COMP ON COMP.ID_TEMP_COMPLAINER =
>CMPL.ID_COMPLAINER
>
>JOIN TEMP_ANAGRAPHICS ANAG ON ANAG.ID_TEMP_ANAGRAPHIC =
>CMPL.ID_ANAGRAPHIC
>
>JOIN ENTITIES ENT ON ENT.ID_ENTITY = CMPL.ID_ENTITY
>
>ORDER BY CMPL.COMPLAIN_DATE, COMP.PREFIX, COMP.GROUP_SKIP, COMP.UNIT,
>
>ANAG.PREFIX, ANAG.UNIT
>
>FOR UPDATE OF CMPL.Rejected, CMPL.Rejection_Reason, CMPL.Checked
>
>The query has the property RequestLive = True, it is under a
>read/write transaction and a read/write connection and has an
>associated TIB_DataSource. It works just fine displaying all the
>selected fields into an TIB_Grid, but the buttons in the EditBar (only
>Update, Cancel and Post are visible) are always disabled.
>
>Am I missing something?

Yes: it's not an updatable query, because of derived fields and
joins. The only way you could get this particular query to be live is to
define stored procedures for the insert, update and delete operations and
apply their EXECUTE calls to the xxxxxSQL properties. By nature, only
single-table queries are updatable, and only natural output columns.

Helen