Quantcast
Channel: NI TestStand topics
Viewing all articles
Browse latest Browse all 6524

Using MySQL with exiting schema

$
0
0

Hi all,

 

I have to log result into an existing MySQL database (I can't modify schema) : 


CREATE TABLE `produits` (
`Pr_Id` int(10) NOT NULL AUTO_INCREMENT,
`Pr_Num_Serie` int(10) DEFAULT NULL,
`Pr_Designation` varchar(128) DEFAULT NULL,
PRIMARY KEY (`Pr_Id`),
KEY `Num_Serie` (`Pr_Num_Serie`)
) ENGINE=InnoDB AUTO_INCREMENT=1337786388 DEFAULT CHARSET=latin1;

 

CREATE TABLE `passage_baie` (
`Pb_Id` int(10) NOT NULL AUTO_INCREMENT,
`Pb_Pr_Id` int(10) DEFAULT NULL,
PRIMARY KEY (`Pb_Id`),
KEY `ProduitsPassage_Baie` (`Pb_Pr_Id`),
KEY `Pb_Id` (`Pb_Id`,`Pb_Pr_Id`),
CONSTRAINT `FK_passage_baie_produits` FOREIGN KEY (`Pb_Pr_Id`) REFERENCES `produits` (`Pr_Id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=462299 DEFAULT CHARSET=latin1;

 

I have some issues linked to "auto_increment" and "foreign key".

I see other discussions for this kind of issue, but quite old.

 

How can I resolve my issues?

 

Thanks

Maxime

 

 


Viewing all articles
Browse latest Browse all 6524

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>