> Le 3 août 2018 à 18:12, Chip Scheide via 4D_Tech <[email protected]> a > écrit : > > Thanks, > I do not really use the online docs.... > but it is nice to know
SQL script example. ++++++++++ /* tables and primary keys */ CREATE TABLE Agence ( PK INT32 NOT NULL UNIQUE AUTO_INCREMENT, raisonSociale VARCHAR(80), complementAdresse VARCHAR(80), email VARCHAR(80), comments TEXT, PRIMARY KEY (PK) ); CREATE TABLE ContactAgence ( PK INT32 NOT NULL UNIQUE AUTO_INCREMENT, nom VARCHAR(80), prenom VARCHAR(80), fonction VARCHAR(80), email VARCHAR(80), FK_agence INT32, comments TEXT, PRIMARY KEY (PK) ); /* indexes */ CREATE INDEX idx1 ON Agence (PK); CREATE INDEX idx2 ON ContactAgence (PK); /* relation */ ALTER TABLE ContactAgence ADD CONSTRAINT rel1 FOREIGN KEY (FK_agence) REFERENCES Agence (PK); ++++++++++ Note: I never create such relations… -- Arnaud de Montard ********************************************************************** 4D Internet Users Group (4D iNUG) Archive: http://lists.4d.com/archives.html Options: https://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

