开发者社区> 问答> 正文

Mycat批量插入报错?报错

批量插入使用注解

/*!mycat:catlet=demo.catlets.BatchInsertSequence */
INSERT INTO unit (id,name)
VALUES
(next VALUE FOR UNIT,'1'),
(next VALUE FOR UNIT,'2'),
(next VALUE FOR UNIT,'3'),
(next VALUE FOR UNIT,'4')
查看日志报错
05/19 10:20:10.034  ERROR [$_NIOREACTOR-4-RW] (BatchInsertSequence.java:119) -BatchInsertSequence.route(......)
java.lang.NullPointerException
	at demo.catlets.BatchInsertSequence.route(BatchInsertSequence.java:87)
	at org.opencloudb.route.handler.HintCatletHandler.route(HintCatletHandler.java:52)
	at org.opencloudb.route.RouteService.route(RouteService.java:107)
	at org.opencloudb.server.ServerConnection.routeEndExecuteSQL(ServerConnection.java:201)
	at org.opencloudb.server.ServerConnection.execute(ServerConnection.java:154)
	at org.opencloudb.server.ServerQueryHandler.query(ServerQueryHandler.java:120)
	at org.opencloudb.net.FrontendConnection.query(FrontendConnection.java:319)
	at org.opencloudb.net.handler.FrontendCommandHandler.handle(FrontendCommandHandler.java:71)
	at org.opencloudb.net.FrontendConnection.rawHandle(FrontendConnection.java:456)
	at org.opencloudb.net.FrontendConnection.handle(FrontendConnection.java:434)
	at org.opencloudb.net.AbstractConnection.onReadData(AbstractConnection.java:307)
	at org.opencloudb.net.NIOSocketWR.asynRead(NIOSocketWR.java:186)
	at org.opencloudb.net.AbstractConnection.asynRead(AbstractConnection.java:268)
	at org.opencloudb.net.NIOReactor$RW.run(NIOReactor.java:96)
	at java.lang.Thread.run(Thread.java:745)
05/19 10:20:10.035  ERROR [$_NIOREACTOR-4-RW] (BatchInsertSequence.java:131) -BatchInsertSequence.getRoute(String sql)
java.lang.NullPointerException
05/19 10:20:10.036  ERROR [$_NIOREACTOR-4-RW] (BatchInsertSequence.java:64) -BatchInsertSequence.processSQL(String sql, EngineCtx ctx)
java.lang.NullPointerException
	at demo.catlets.BatchInsertSequence.processSQL(BatchInsertSequence.java:52)
	at org.opencloudb.route.handler.HintCatletHandler.route(HintCatletHandler.java:53)
	at org.opencloudb.route.RouteService.route(RouteService.java:107)
	at org.opencloudb.server.ServerConnection.routeEndExecuteSQL(ServerConnection.java:201)
	at org.opencloudb.server.ServerConnection.execute(ServerConnection.java:154)
	at org.opencloudb.server.ServerQueryHandler.query(ServerQueryHandler.java:120)
	at org.opencloudb.net.FrontendConnection.query(FrontendConnection.java:319)
	at org.opencloudb.net.handler.FrontendCommandHandler.handle(FrontendCommandHandler.java:71)
	at org.opencloudb.net.FrontendConnection.rawHandle(FrontendConnection.java:456)
	at org.opencloudb.net.FrontendConnection.handle(FrontendConnection.java:434)
	at org.opencloudb.net.AbstractConnection.onReadData(AbstractConnection.java:307)
	at org.opencloudb.net.NIOSocketWR.asynRead(NIOSocketWR.java:186)
	at org.opencloudb.net.AbstractConnection.asynRead(AbstractConnection.java:268)
	at org.opencloudb.net.NIOReactor$RW.run(NIOReactor.java:96)
	at java.lang.Thread.run(Thread.java:745)
何解?求大神解答,是我的语句有问题吗

展开
收起
爱吃鱼的程序员 2020-06-09 14:30:02 790 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    不支持insertinto

    可能是没找到对应的序列值,你用的本地文件方式还是数据库的方式?

    2020-06-09 14:30:21
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
MySQL表和索引优化实战 立即下载
SQL Sever迁移PG经验 立即下载
低代码开发师(初级)实战教程 立即下载