Alex
From UG
Contents |
Current Work
- 0002237: [SmartPhone App] ............. <proj parent>
- 0002515: [Estim P&L / Accruals] .......<parent>
Code Reviews
Acc
- tblCurrency
tbl Currency
-- Table "tblCurrency" DDL CREATE TABLE `tblCurrency` ( `Id` int(10) NOT NULL AUTO_INCREMENT, `Name` varchar(50) NOT NULL, `Abbreviation` varchar(3) NOT NULL, `IsMain` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`Id`) ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=latin1 COMMENT='InnoDB free: 9216 kB'; DELIMITER ;; CREATE TRIGGER `tblCurrency_after_ins_tr` AFTER INSERT ON `tblCurrency` FOR EACH ROW BEGIN INSERT INTO `tblCurrencyExchangeRate` (FromCurrencyId, ToCurrencyId, OfficeId) SELECT NEW.Id, `tblCurrency`.Id, `tblOffice`.Id FROM tblCurrency, tblOffice WHERE NOT `tblCurrency`.Id=NEW.Id; INSERT INTO `tblCurrencyExchangeRate` (FromCurrencyId, ToCurrencyId, OfficeId) SELECT `tblCurrency`.Id, NEW.Id, `tblOffice`.Id FROM tblCurrency, tblOffice WHERE NOT `tblCurrency`.Id=NEW.Id; END;; DELIMITER ;
+--------------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------+-------------+------+-----+---------+----------------+ | Id | int(10) | NO | PRI | NULL | auto_increment | | Name | varchar(50) | NO | | NULL | | | Abbreviation | varchar(3) | NO | | NULL | | | IsMain | tinyint(1) | NO | | 0 | | +--------------+-------------+------+-----+---------+----------------+ 4 rows in set