,,,
:
, 2005 .
, .
, , . , . , . . : , ; , , ..
, , . , , . : , , ?. .
, , , . : , , , , (1, 2, 3).
, , . :
1) :
1.1) ;
1.2) , ;
1.3) , ;
2) ;
3) .
() . : , , . . . .
, , ( ) , .
, . , . .
, , - .
: , . . . , .
: . . , - .
, : , , . :
1) :
1.1) ;
1.2) ( ( ) , , );
1.3) ;
2) :
2.1) ( );
2.2) ;
2.3) , ;
2.4) (, ..)
3) : .
. , ( ), . .
:
.
.
:
) : , , . , : , , . , , , , .
, - . , , , . , : ; . . , , .
, : .
) : , . , : . .
, . , , . : ; . , .
) : . , . : . , , . , . : . , , .
1) :
) .
TRIGGER PROCEDURE FOR DELETE OF Product.
IF CAN-FIND(FIRST Recipe WHERE
Recipe.prod_code = Product.prod_code)
THEN DO:
MESSAGE , , ..
RETURN ERROR.
END.
) .
TRIGGER PROCEDURE FOR WRITE OF Product
NEW inserted OLD deleted.
IF deleted.prod_code <> 0 AND
deleted.prod_code <> inserted.prod_code
THEN DO:
MESSAGE " ; ."
RETURN ERROR.
END.
IF inserted.prod_code = 0
THEN DO:
ESSAGE " ."
RETURN ERROR.
END.
2) :
) .
TRIGGER PROCEDURE FOR DELETE OF Dish.
IF CAN-FIND(FIRST Recipe WHERE
Recipe.dish_code = Dish.dish_code)
THEN DO:
MESSAGE . ..
RETURN ERROR.
END.
) .
TRIGGER PROCEDURE FOR WRITE OF Dish
NEW inserted OLD deleted.
IF deleted.dish_code <> 0 AND
deleted.dish_code <> inserted.dish_code
THEN DO:
MESSAGE " ; ."
RETURN ERROR.
END.
IF inserted.dish_code = 0
THEN DO:
MESSAGE " .".
RETURN ERROR.
END.
3) .
) .
TRIGGER PROCEDURE FOR WRITE OF Recipe
NEW inserted OLD deleted.
IF NOT(CAN-FIND(FIRST Dish WHERE
inserted.dish_code = Dish.dish_code))
THEN DO:
MESSAGE . , , ..
RETURN ERROR.
END.
IF NOT(CAN-FIND(FIRST Product WHERE
inserted.prod_code = Product.prod_code))
THEN DO:
MESSAGE . , , .
RETURN ERROR.
END.
Table Name Description
----------------------------------------------------------------------------
Dish
Product
Recipe
=========================================================================
============================= Table: Dish ===============================
Table Flags: "f" = frozen, "s" = a SQL table
Table Dump Table Field Index Table
Name Name Flags Count Count Label
----------------------------- -------- ----- ----- ----- -------------------
Dish Dish 4 1 ?
Storage Area: N/A
Trigger Event Trigger Procedure Overridable? Check CRC?
------------- -------------------- ------------ ---------
DELETE D_Dish.p no no
WRITE W_Dish.p no no
============================= FIELD SUMMARY =============================
============================= Table: Dish ===============================
Flags: <c>ase sensitive, <i>ndex component, <m>andatory, <v>iew component
Order Field Name Data Type Flags Format Initial
----- ------------------------- ----------- ----- --------------- ----------
10 dish_code inte i ->,>>>,>>9 0
20 dish_name char X(18)
30 level inte ->,>>>,>>9 0
40 feature char X(18)
Field Name Label Column Label
------------------------------ ---------------------- ----------------------
dish_code
dish_name
level
feature
============================= INDEX SUMMARY =============================
============================= Table: Dish ===============================
Flags: <p>rimary, <u>nique, <w>ord, <a>bbreviated, <i>nactive, + asc, - desc
Flags Index Name Cnt Field Name
----- -------------------------------- --- ---------------------------------
pu XPKDish 1 + dish_code
** Index Name: XPKDish
Storage Area: N/A
============================= FIELD DETAILS =============================
============================= Table: Dish ===============================
=========================================================================
============================= Table: Product ============================
Table Flags: "f" = frozen, "s" = a SQL table
Table Dump Table Field Index Table
Name Name Flags Count Count Label
----------------------------- -------- ----- ----- ----- -------------------
Product Product 3 1?
Storage Area: N/A
Trigger Event Trigger Procedure Overridable? Check CRC?
------------- -------------------- ------------ ----------
DELETE D_Product.p no no
WRITE W_Product.p no no
============================= FIELD SUMMARY =============================
============================= Table: Product ============================
Flags: <c>ase sensitive, <i>ndex component, <m>andatory, <v>iew component
Order Field Name Data Type Flags Format Initial
----- ------------------------- ----------- ----- --------------- ----------
10 prod_code inte i ->,>>>,>>9 0
20 prod_name char X(18)
30 unit_price deci-2 ->>,>>9.99 0
Field Name Label Column Label
------------------------------ ---------------------- ----------------------
prod_code
prod_name
unit_price
============================= INDEX SUMMARY =============================
============================= Table: Product ============================
Flags: <p>rimary, <u>nique, <w>ord, <a>bbreviated, <i>nactive, + asc, - desc
Flags Index Name Cnt Field Name
----- -------------------------------- --- ---------------------------------
pu XPKProduct 1 + prod_code
** Index Name: XPKProduct
Storage Area: N/A
============================= FIELD DETAILS =============================
============================= Table: Product ============================
=========================================================================
============================= Table: Recipe =============================
Table Flags: "f" = frozen, "s" = a SQL table
Table Dump Table Field Index Table
Name Name Flags Count Count Label
----------------------------- -------- ----- ----- ----- -------------------
Recipe Recipe 3 1?
Storage Area: N/A
Trigger Event Trigger Procedure Overridable? Check CRC?
------------- -------------------- ------------ ----------
CREATE C_Recipe.p no no
WRITE W_Recipe.p no no
============================= FIELD SUMMARY =============================
============================= Table: Recipe =============================
Flags: <c>ase sensitive, <i>ndex component, <m>andatory, <v>iew component
Order Field Name Data Type Flags Format Initial
----- ------------------------- ----------- ----- --------------- ----------
10 prod_code inte im ->,>>>,>>9 0
20 dish_code inte im ->,>>>,>>9 0
30 needed_amount deci-2 ->,>>>,>>9.99 0
Field Name Label Column Label
------------------------------ ---------------------- ----------------------
prod_code
dish_code
needed_amount
============================= INDEX SUMMARY =============================
============================= Table: Recipe =============================
Flags: <p>rimary, <u>nique, <w>ord, <a>bbreviated, <i>nactive, + asc, - desc
Flags Index Name Cnt Field Name
----- -------------------------------- --- ---------------------------------
pu XPKRecipe 2 + prod_code
+ dish_code
** Index Name: XPKRecipe
Storage Area: N/A
============================= FIELD DETAILS =============================
============================= Table: Recipe =============================
============================= SEQUENCES =================================
:
Copyright (c) 2024 Stud-Baza.ru , , , .