problem with TZUpdateSQL in combination with as in select

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

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
vincentfranssen
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 08.09.2005, 09:57

problem with TZUpdateSQL in combination with as in select

Post by vincentfranssen »

Hi,

I seem to have problems with our TZUpdateSQL component. Queries
arent updated when I use as in my select statement. Currently using
ZEOSLIB_TRUNK_REV210.zip

My example postgresql tables

CREATE TABLE membership
(
id int4 NOT NULL,
id_person int4,
id_groupofpersons int4,
dateofregistration date,
dateofactivation date,
dateofdeactivation date,
CONSTRAINT pk_membership PRIMARY KEY (id),
CONSTRAINT fk_groupofpersons FOREIGN KEY (id_groupofpersons)
REFERENCES groupofpersons (id) MATCH SIMPLE
ON UPDATE SET NULL ON DELETE SET NULL,
CONSTRAINT fk_person FOREIGN KEY (id_person)
REFERENCES person (id) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
)

CREATE TABLE groupofpersons
(
id int4 NOT NULL,
id_groupofpersonsschedule int4,
description varchar(30),
dateofregistration date,
test varchar(10),
CONSTRAINT pk_groupofpersons PRIMARY KEY (id)
)

This doesnt work.
ZQuery.sql = select m.*, g.description, g.test as gtest from membership m, groupofpersons g where m.id_person = :id and m.id_groupofpersons = g.id
ZUpdateSQL.RefreshQSL = select m.*, g.description, g.test as gtest from membership m, groupofpersons g where m.id = :OLD_ID and m.id_groupofpersons = g.id

When i change m.id_groupofpersons (with a dblookupcombobox) ... gtest (dbedit) isnt updated.

This works:
ZQuery.sql = select m.*, g.description, g.test from membership m, groupofpersons g where m.id_person = :id and m.id_groupofpersons = g.id
ZUpdateSQL.RefreshQSL = select m.*, g.description, g.test from membership m, groupofpersons g where m.id = :OLD_ID and m.id_groupofpersons = g.id

When i change m.id_groupofpersons (with a dblookupcombobox) ... g.test (dbedit) is updated.
Post Reply