Hi,
i use Zeos 6.5.1 with BCB6 & mysql 4.1.15.
I have a simple project for testing master/detail functionality!
My master table has a column "MasterLink" wich is filled by a "select UUID()" statement. Column type is varchar(36). The detail table has a equivalent column. The value of the detail field is set in the "OnNewRecord" event of an Clientdataset.
Adding new records works very well. After calling the ApplyUpdates method of the masters clientdataset the master and the detail record will be inserted correctly.
If i refresh the masters clientdataset via Close() and Open() method, only the master records will be displayed in dbgrid!
The TZSQLMonitor logs the following:
CONNECT TO "DBX" AS USER "mt"
select Bez,Masterlink from Tab1
SHOW TABLES FROM DBX LIKE 'Tab1'
SHOW COLUMNS FROM DBX.Tab1 LIKE '%'
select Bez,MasterLink from Tab2 where MasterLink=NULL
SHOW TABLES FROM DBX LIKE 'Tab2'
SHOW COLUMNS FROM DBX.Tab2 LIKE '%'
msg: select UUID();
mysql-4.1, msg: select Bez,Masterlink from Tab1
INSERT INTO DBX.Tab1 (Bez,Masterlink) VALUES ('Master1','3bdbc9fc-8083-1028-9017-0002b38d6c88')
select Bez,MasterLink from Tab2 where MasterLink=NULL
INSERT INTO DBX.Tab2 (Bez,MasterLink) VALUES ('Detail1','3bdbc9fc-8083-1028-9017-0002b38d6c88')
mysql-4.1, msg: select Bez,Masterlink from Tab1
select Bez,MasterLink from Tab2 where MasterLink=NULL
mysql-4.1, msg: DISCONNECT FROM "DBX"
Why is is the value of "MasterLink" = NULL?
THX
Hetfield
select ... where MasterLink=:MasterLink
Moderators: gto, cipto_kh, EgonHugeist