Subject Re: [IBO] Editing a TIB_Query
Author Lucas Franzen
gsbrown@... schrieb:
>
> I have a TIB_Query component on a form that has the following SQL:
> SELECT
> GDATE
> , GTIME
> , GLEVEL
> ,Finger
> ,GEvent
> , (select finger.finger
> from finger
> where
> finger.idx_finger = glucose.finger) as luFinger
> , (select gevent.gevent
> from gevent
> where gevent.idx_gevt = glucose.gevent) as luEvent
> FROM GLUCOSE
> for update
>
> to that I have a DataSource component connected and to the DS I have
> an TIB_Update bar. The bar only has the "Edit, Delete, Post & Cancel"
> buttons visible. When I compile and run my app the Update bar is
> greyed out and I cannot edit the data.
>
> The embeded select statements are linked to 2 lookup tables. I tried
> to follow the examples in the GSG but it looks like I am doing
> something wrong.
>
> Any ideas what it might be that I am missing????
>

By default queries are only updatable when selecting from a single
table.

Thanks to Jason this is not necessarily true in IBO.

You need to supply an EditSQL-statement.
If you enter:

UPDATE GLUCOSE SET
GDATE=:GDATE,
GTIME=:GTIME,
GLEVEL=:GLEVEL,
Finger=:FINGER,
GEvent=:Gevent
WHERE
YOU_PK_FIELD_OR_STH_ELSE_THAT_UNIQUELY_IDENTIFIES_YOUR_RECORD =
:VALUE_OF_IT_THIS

in the EDITSQL property you should be able to edit the data.

By the way:
- i don't see any primary key field for GLUCOSE
(shouldn't there be sth. like IDX_C6-H12-O6 ??? <g>)

- wouldn't
SELECT G.GDATE, G.GTIME, G.GLEVEL,
F.Finger AS luFINGER,
V.GEVENT AS luEVENT
FROM GLUCOSE G
LEFT JOIN FINGER F ON G.FINGER=F.IDX_FINGER
LEFT JOIN EVENT V ON G.GEVENT=V.IDX_GEVT

be a better sql syntax ???

Regards
Luc.