Subject update problem
Author martinknappe
hi,

my database contains the following two tables:

CREATE TABLE DICENTRIES (
...
ASDSKRPT1 S_CHAR_15 COLLATE PXW_INTL850,
ZSDSKRPT1 T_CHAR_15 COLLATE PXW_INTL850,
...
);

CREATE TABLE DSKRPTS (
ASDSKRPT S_CHAR_15 NOT NULL COLLATE PXW_INTL850,
ZSDSKRPT T_CHAR_15 NOT NULL COLLATE PXW_INTL850,
...
);

also, i have the following:

ALTER TABLE DICENTRIES ADD CONSTRAINT FK_DICENTRIES_5 FOREIGN KEY
(ASDSKRPT1, ZSDSKRPT1) REFERENCES DSKRPTS (ASDSKRPT, ZSDSKRPT) ON
UPDATE CASCADE;

now, in my delphi application, i have 2 forms displaying the data of
these two tables respectively. the form that displays the data from
dicentries does so via the execution of a select stored procedure. the
other via a simple 'select * from dskrpts' (not much data in there).
so both have their own dataset components (dataset_dicentries and
dataset_dskrpts)
now the trouble is as follows: when i update a record in
dataset_dskrpts which happens to be referenced from any of the records
currently loaded into dataset_dicentries, this update is
(understandably) not automatically applied to the respective record in
dataset_dicentries. i thought i could just browse through
dataset_dicentries from my delphi application and check whether any of
the records has to be refreshed but it seems like a bit unelegant so i
thought maybe there's a way to automatise this in the database. i'm
having something like this in mind:

let's assume the select procedure for the selection of entries from
dicentries is called select_procedure(params)
when an update on dskrpts is taking place, the server could check
whether this updates is to do with the fields dskrpts.asdskrpt or
dskrpts.zsdskrpt. let's assume dskrpts.asdskrpt was changed from 'a'
to 'b'
now the server could check to see if there is any open connection
where data was sent to via select_procedure(params) and
"where 'a' in select asdskrpt1 from select_procedure(params)"
if that is so, the respective record could be refreshed (don't know
whether that's possible at all w/o the respective dataset first
requesting a refresh)

thanx for any replies,

martin