Arnaud,
Thanks

I did this:
on error call - just make the error go away
for every table
  for every field
    is this my "primary key' field?
     sql command as text to set primary key on the field
     execute immediate(above sql command)
       (trying to set a primary key, as primary key generates an error 
which is suppressed by the above on error call)
   

it works to do what I needed, it is fast, and it is done  :)

Chip

On Sun, 5 Aug 2018 12:28:39 +0200, Arnaud de Montard via 4D_Tech wrote:
> 
>> Le 3 août 2018 à 18:12, Chip Scheide via 4D_Tech 
>> <4d_tech@lists.4d.com> 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:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************
---------------
Gas is for washing parts
Alcohol is for drinkin'
Nitromethane is for racing 
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to