(
ID INTEGER NOT NULL,
NAME VARCHAR (50) NOT NULL,
PLO ??INTEGER NOT NULL,
ID_ITAZH INTEGER NOT NULL, PK_POM PRIMARY KEY (ID)
); TABLE POM ADD CONSTRAINT FK_POM FOREIGN KEY (ID_ITAZH) REFERENCES ITAZH (ID); TERM ^;
/* Triggers only will work for SQL triggers */TRIGGER POM_BI FOR POM BEFORE INSERT POSITION 0
IF (NEW.ID IS NULL) THEN
NEW.ID=GEN_ID (GEN_POM_ID, 1);
^ WORK ^ TERM; ^
/* Table: PROIZ, Owner: SYSDBA */TABLE PROIZ
(
ID INTEGER NOT NULL,
NAME VARCHAR (60) NOT NULL, PK_PROIZ PRIMARY KEY (ID)
); TERM ^;
/* Triggers only will work for SQL triggers */TRIGGER PROIZ_BI FOR PROIZ BEFORE INSERT POSITION 0
IF (NEW.ID IS NULL) THEN
NEW.ID=GEN_ID (GEN_PROIZ_ID, 1);
^ WORK ^ TERM; ^
/* Table: PROV, Owner: SYSDBA */TABLE PROV
(
ID INTEGER NOT NULL,
DATA TIMESTAMP NOT NULL,
OPIS VARCHAR (100) NOT NULL,
ID_LIST_UST INTEGER NOT NULL,
ID_SOTR INTEGER NOT NULL, PK_PROV PRIMARY KEY (ID)
); TABLE PROV ADD CONSTRAINT FK1_PROV FOREIGN KEY (ID_LIST_UST) REFERENCES LIST_UST (ID); TABLE PROV ADD CONSTRAINT FK2_PROV FOREIGN KEY (ID_SOTR) REFERENCES SOTR (ID); TERM ^;
/* Triggers only will work for SQL triggers */TRIGGER PROV_BI FOR PROV BEFORE INSERT POSITION 0
IF (NEW.ID IS NULL) THEN
NEW.ID=GEN_ID (GEN_PROV_ID, 1);
^ WORK ^ TERM; ^
/* Table: SOTR, Owner: SYSDBA */TABLE SOTR
(
ID INTEGER NOT NULL,
FIO VARCHAR (100) NOT NULL,
POST VARCHAR (50) NOT NULL, PK_SOTR PRIMARY KEY (ID)
); TERM ^;
/* Triggers only will work for SQL triggers */TRIGGER SOTR_BI FOR SOTR BEFORE INSERT POSITION 0
IF (NEW.ID IS NULL) THEN
NEW.ID=GEN_ID (GEN_SOTR_ID, 1);
^ WORK ^ TERM; ^
/* Table: STAT, Owner: SYSDBA */TABLE STAT
(
ID INTEGER NOT NULL,
NAME VARCHAR (50) NOT NULL, PK_STAT PRIMARY KEY (ID)
); TERM ^;
/* Triggers only will work for SQL triggers */TRIGGER STAT_BI FOR STAT BEFORE INSERT POSITION 0
IF (NEW.ID IS NULL) THEN
NEW.ID=GEN_ID (GEN_STAT_ID, 1);
^ WORK ^ TERM; ^
/* Table: TIP_DATCHIKA, Owner: SYSDBA */TABLE TIP_DATCHIKA
(
ID INTEGER NOT NULL,
NAME VARCHAR (50) NOT NULL, PK_TIP_DATCHIKA PRIMARY KEY (ID)
); TERM ^;
/* Triggers only will work for SQL triggers */TRIGGER TIP_DATCHIKA_BI FOR TIP_DATCHIKA BEFORE INSERT POSITION 0
IF (NEW.ID IS NULL) THEN
NEW.ID=GEN_ID (GEN_TIP_DATCHIKA_ID, 1);
^ WORK ^ TERM; ^
Додаток Б
(обов'язковий)
Текст програми
unit datchik;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, IBCustomDataSet, IBQuery, StdCtrls, DBCtrls, Grids, DBGrids;
type
TForm7=class (TForm)
DataSource1: TDataSource;
DBGrid1: TDBGrid;
DBLookupComboBox1: TDBLookupComboBox;
DBLookupComboBox2: TDBLookupComboBox;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
IBQuery1: TIBQuery;
IBQuery2: TIBQuery;
IBQuery3: TIBQuery;
IBQuery4: TIBQuery;
procedure Butto...