I am absolutely gob-smacked to find that (apparently) nobody, in the entire
IT-Industry World-wide, uses a Master/Detail relationhips in a GDB database.This just can't be true!! :-(
So there must be a way of handling it.
In none of the (pretty expensive) books which I have is it handled either. :-(
Come on guys and dolls!! Surely somebody must be handling this problem???
In which event please refer to my thread102-296246 written on 18 Jun 2000 already and let's have some kind guru give us feedback. Even kinder - a solution.
With regard to my thread102-296246 I might mention that
1.
I am unhappy about the use of ApplyDates ( as I do there) simply
because of the traffic created to the Server (possibly in Sydney) -
every time some pretty little thing (in Perth) scrolls in the ParentGrid in her GUI.
2.
The Delete problem is solved by creating a Procedure for it. As in
CREATE EXCEPTION CHILD_EXISTS 'Children exist for this parent.';
CREATE PROCEDURE DELETE_PARENT
(
PARENT_NUM SMALLINT
)
AS
BEGIN EXIT; END ^
And ....
ALTER PROCEDURE DELETE_PARENT
(
PARENT_NUM SMALLINT
)
AS
DECLARE VARIABLE any_child INTEGER;
BEGIN
any_kids = 0;
/*
* If there are any children records referencing this parent,
* can't delete the parent until the children are re-assigned
* to another parent or changed to NULL.
*/
SELECT count(PARENT_NO)
FROM CHILD
WHERE PARENT_NO = ARENT_NUM
INTO :any_kids;
IF (any_kids > 0) THEN
BEGIN
EXCEPTION CHILD_EXISTS;
SUSPEND;
END
/*
* Delete the parent from any projects.
*/
DELETE FROM parent_proj
WHERE parent_no = arent_num;
/*
* Delete old parent records.
*/
DELETE FROM PARENT
WHERE PARENT_NO = ARENT_NUM;
SUSPEND;
END
^
IT-Industry World-wide, uses a Master/Detail relationhips in a GDB database.This just can't be true!! :-(
So there must be a way of handling it.
In none of the (pretty expensive) books which I have is it handled either. :-(
Come on guys and dolls!! Surely somebody must be handling this problem???
In which event please refer to my thread102-296246 written on 18 Jun 2000 already and let's have some kind guru give us feedback. Even kinder - a solution.
With regard to my thread102-296246 I might mention that
1.
I am unhappy about the use of ApplyDates ( as I do there) simply
because of the traffic created to the Server (possibly in Sydney) -
every time some pretty little thing (in Perth) scrolls in the ParentGrid in her GUI.
2.
The Delete problem is solved by creating a Procedure for it. As in
CREATE EXCEPTION CHILD_EXISTS 'Children exist for this parent.';
CREATE PROCEDURE DELETE_PARENT
(
PARENT_NUM SMALLINT
)
AS
BEGIN EXIT; END ^
And ....
ALTER PROCEDURE DELETE_PARENT
(
PARENT_NUM SMALLINT
)
AS
DECLARE VARIABLE any_child INTEGER;
BEGIN
any_kids = 0;
/*
* If there are any children records referencing this parent,
* can't delete the parent until the children are re-assigned
* to another parent or changed to NULL.
*/
SELECT count(PARENT_NO)
FROM CHILD
WHERE PARENT_NO = ARENT_NUM
INTO :any_kids;
IF (any_kids > 0) THEN
BEGIN
EXCEPTION CHILD_EXISTS;
SUSPEND;
END
/*
* Delete the parent from any projects.
*/
DELETE FROM parent_proj
WHERE parent_no = arent_num;
/*
* Delete old parent records.
*/
DELETE FROM PARENT
WHERE PARENT_NO = ARENT_NUM;
SUSPEND;
END
^