我正在尝试在liquibase中执行以下查询,但我收到错误消息。
<changeSet author="AW001TI (generated)" id="1492080265432-37" objectQuotingStrategy="QUOTE_ALL_OBJECTS" context="snd,dev,dev1,qa,qa1,qa2,prv,stg">
<sql dbms="mysql"
splitStatements="true"
stripComments="true">
USE gpptrackingbarcode;
select @trackingrangeid := (select max(trackingrangeid) from trackingrangeintegrated) + 1;
INSERT INTO `gpptrackingbarcode`.`trackingrangeintegrated` (`destcountrycode`, `carrier`, `mailservicename`, `mailserviceoptionname`, `shipmenttype`, `custom`, `appidentifier`, `secondaryappidentifier`, `trackingrangeid`, `partnerid`, `region`, `specialservicename`, `mailerid`, `senderuserid`)
VALUES ('US', 'usps', 'IMB', 'ALL', 'outbound', 'dispense', '00', '310', @trackingrangeid, '0', 'domestic', 'ALL', '902097365', '0') ;
INSERT INTO `gpptrackingbarcode`.`trackingrangeuspsdomestic` (`trackingrangeid`, `rangesequence`, `startsequence`, `endsequence`, `sequencewidth`, `nextnumber`, `alertthreshold`, `alertinterval`, `lifespan`, `lastrolloverdate`, `activeflag`, `recyclableflag`)
VALUES (@trackingrangeid , '1', '1', '999999', '6', '1', '100000', '1000', '120', '2017-06-13 00:00:00', 1,1);
</sql>
</changeSet>
在上面的变更集中,问题是使用变量@trackingrangeid。我想当我在liquibase中使用sql标签时,上面的查询将起作用,但它无法正常工作。我不确定我做错了什么,但我需要在liquibase中运行这种类型的查询。
感谢任何帮助。
谢谢, Awadhendra