Code: Select all
CREATE TABLE inouts (dmid int not null AUTO_INCREMENT, proj_id smallint(8) unsigned default NULL, name VARCHAR(35),a DECIMAL(6,3),b DECIMAL(6,3),c DECIMAL(6,3),d DECIMAL(6,3),PRIMARY KEY (`dmid`,`proj_id`), FOREIGN KEY (proj_id) REFERENCES projects (proj_id) ON UPDATE CASCADE ON DELETE CASCADE ) ENGINE=InnoDB
Code: Select all
INSERT INTO inouts (`dmid`,`name`,`a`,`b`,`c`,`d`) VALUES ('1' ,'name' ,'1,5' ,'0,2' ,'1,4' ,'0,35');
I've tried some tricks, like declaring the decimals as varchar at the create statement, and then updating the fields as decimals, but then i get
Code: Select all
('name' ,'1,00' , '0,00' , '1,00' , '0,00'); Thanks in advance!