Subject RE: [IBO] continue of my problem AND edit_mode of the grid is false
Author Meir Kalter
I do the next settings, and i can not edit nothing in the grid,.
I Must say that i aw working from CBuilder, may be this is the problem?



[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[

This is my query:
SELECT person_info.*, event_type
FROM PERSON_INFO
JOIN EVENTS
on person_info.person_info_id = events.person_info_id


(person_info_id on events is foreign_key)

This is my KeyRelation
person_info
This is my KeyLinks
person_info.person_info_id

I put sometyhing which update the row: (EditSQL)
update person_info set first_name = '????' where person_info_id = 27

Now ican:
1. Add a new row to the DataSet, with the IB_UpdateBar
2. Edit a row. There are errors , of course , because i need to create a
StoredProcedure,
But when i want to edit (sett mode of the dataset to edit
with the IB_UpdateBar)
The grid change the sign of the line to '|'
instead of a triangle, but i
can not edit no field , or from the person info
, or from the events.

]]]]]]]]]]]]]]]]

-----Original Message-----
From: Claudio Valderrama C. [mailto:cvalde@...]
Sent: Monday, January 22, 2001 2:47 AM
To: IBObjects@egroups.com
Subject: RE: [IBO] continue of my problem AND edit_mode of the grid is false


> -----Original Message-----
> From: Meir Kalter [mailto:meir_klt@...]
> Sent: Domingo 21 de Enero de 2001 18:38
>
> Hello!
> I did not use procedure.
> i have person_info on one table, and in the second i have events number.
> event relation to person_info is many to one.
> I remove all my work. This was something like this:
>
> SELECT events.* , first_name, last_name FROM events
join person_info on

All from events and names from person. I assume events has a PK. However,
the same events will happen more than one time, since more than one person
can share the same event type (assuming this is your model), so there's no
unique values in this side. Please, include the PK fields for table
person_info.

> events.person_id = person_info.person_info_id.
> I set RequestLive to true, and KeyRelation to
> person_info.person_info_id (or events.person_id).

No, KeyLinks should be set to person_info.person_info_id and include this
column in the SELECT part.
KeyRelation is the relation that you want to update when you have a join.
Then IBO can work automatically. If you need to apply changes to both sides,
you'll have to call a stored procedure in the *SQL properties. (EditSQL,
DeleteSQL and InsertSQL if I remember the names well.)


> And put some SQL for the update and insert SQL.
> could i put in this table other join to the names of the events
> from other
> table, and select the type of the event with lookup?

I don't see an obstacle if you set the right properties.


> I Would want edit data from the query inside the grid itself.
> Coulf it be done?
> I am sorry about my english.

Yes, but to my knowledge, you can't edit both sides of a join if you don't
write code for the *SQL properties I told you above. If you only want to
edit people, you can set KeyRelation to person_info and voila, IBO will do
the rest.

If you only want to select events for each person but not edit the
properties of the events themselves, then you need a subquery to bind it to
the lookup instead of a join.

C.