[TYPO3-english] Insert statement for DB Integration - Foreign key

Per Inge Håland pihaaland at yahoo.com
Wed Dec 3 14:47:34 CET 2008


Hi,
I have created three tables relating to eachother.
- tx_table_01 - information
    - pk pktbl01 - autoincremented

- tx table_02 - selection 1-m to information
    - pk pktabl02

- tx table 03 - due to normalization
    - fk pktabl 01
    - fk pktabl 02
    - pk = pktabl01 + pktabl02

The following insert stmt populates the tables tx table 01 and tx table 03:
INSERT INTO `tx_LB_avvik` (`Dato`, `Prosjektnr`, `Prosjektnavn`, 
`Firma`, `Kostnad`, `Beskrivelse`, `Avvik_fra`) VALUES ('08.12.12', 816, 
'HED', 'Tømmermannen', 45000, 'Nok ett avvik', '');
INSERT INTO `tx_LB_avvikomrade` (`ao_omradeID`, `ao_avvikID`) VALUES 
('K1601', LAST_INSERT_ID());

Is there a possibility to build this insert with DB Integration?
Then the first column of tx table 03 would be a selection from the 
content of tx table 02.

Attached the datamodell as png.

Regards
Per Inge Håland


More information about the TYPO3-english mailing list