我需要文件:batchFile.bat和sqlFile.sql
batchFile.bat包含以下代码:
@echo OFF
set host=localhost
set user=root
set pass=123
set dbname=db_prod
set dbname_hist=db_prod_hist
mysql -u %user% -h %host% -D %dbname% -p%pass% -v < sqlFile.sql
sqlFile.sql包含以下代码:
delimiter //
DROP TRIGGER IF EXISTS tri_tableA1//
CREATE TRIGGER tri_tableA1
AFTER INSERT ON tableA1
FOR EACH ROW
BEGIN
INSERT INTO *{dbname_hist}*.tableA1 (id, prixAchatUnitaireHT, montantAchat, duree)
select NEW.id, NEW.prixAchatUnitaireHT, NEW.montantAchat, NEW.duree;
END//
delimiter ;
我的问题是:如何将.bat文件中的 {dbname_hist} 参数传递给.sql文件?