Problem with TZTable ( MySQL )

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
rodo
Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 21.10.2007, 07:57

Problem with TZTable ( MySQL )

Post by rodo »

Hi,

Let me explain my configuration.

Zeos: 6.6.1 - beta

Table description:
a) clients (id,name,street,city,state)
DataSource: DS_Clients
b) clients_phones (id,client_id,phonenumber) -
DataSource: DS_Clients_Phones


Properties ( clients_phones )
MasterSource: DS_Clients
MasterFields: id
LinkedFields: client_id

Everything work fine, both tables are linked i can get the
infomation of ( clients_phones ) when a record of ( clients )
is selected.

But when a new record is being inserted ( clients_phones ) show
the last record viewed in ( clients ).

Example:

Table clients (records)
1, name one, street one, city one, state one
2, name two, street two, city two, state two

Table clients_phones (records)
1, 1, 1111
2, 2, 2222


sql query: select * from clients where id = 1

clients_phones = ( 1,1,1111)

and if a new record is being inserted in ( clients )
clients_phones still show ( 1,1,1111 ), only when i post
clients_phones show a empty record.

My question is in the moment i start a new record in ( clients ),
( clients_phones ) should start a new record too or i am wrong ?

I tried to explain the best i can.

Greetings!!
kmr
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 12.06.2006, 22:18
Location: Northern Germany (really northern)

Post by kmr »

My question is in the moment i start a new record in ( clients ),
( clients_phones ) should start a new record too or i am wrong ?
Depends on the constraints you set in your create table statements.
Could you post the create statements for detailed information?

If there is no constraint, which I assume, you have to run insert for the client_phones table. The advantage of Master/Child tables is, that you don't have to set the client_id in client_phones during inserts, because it is linked to clients id. And you don't have to use findfirst or whatever to scroll to the corresponding clients_phones entries when scrolling in clients.
Post Reply