繁体   English   中英

WSO2 CEP和SQL Server插入SQL Server端设置的主键

[英]WSO2 CEP and SQL Server insert into with primary keys set on the SQL Server side

我在SQL Server上有一个数据库,该数据库的表具有以下结构:

ID has IDENTITY set to true. 

当我进入WSO2 CEP并尝试使流将其事件转储到表中时,出现以下错误:

from MessageStream
insert into msg;

Error while dispatching events: Error while adding events to event table, Cannot insert explicit value for identity column in table 'EDS_MSG' when IDENTITY_INSERT is set to OFF.

org.wso2.siddhi.core.exception.ExecutionPlanRuntimeException: Error while adding events to event table, Cannot insert explicit value for identity column in table 'EDS_MSG' when IDENTITY_INSERT is set to OFF.

有没有一种方法可以使用SiddhiQL不发送ID并让SQL Server以自动递增的方式处理该主键

尝试从define table msg删除ID int

@From(eventtable='rdbms', datasource.name='WSO2_TRX_DB', table.name='EDS_MSG')
define table msg (Descri string, StartDate long, EndDate long, UpdateDate long, LastUser string);

from MessageStream
insert into msg;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM