INSERT INTO black_warn_list (black_warn_list.C_ID, black_warn_list.C_SERIA_NO)values ('10010', '1111'),('10011', '2222') > ORA-00933: SQL command not properly ended
时间: 2023-11-27 13:04:44 浏览: 112
这是一个 SQL 语句,但是它的格式有问题。正确的格式应该是:
```
INSERT INTO black_warn_list (C_ID, C_SERIA_NO) VALUES ('10010', '1111'), ('10011', '2222');
```
这样可以将两条记录插入到 `black_warn_list` 表中。注意,不需要在列名前面加上表名。同时,在多条记录时,需要在每条记录后面加上逗号。
相关问题
优化这段代码: IF VR(v_alarm1).0 <> ax_alarm.ax_dial THEN VR(v_alarm1).0 = ax_alarm.ax_dial IF VR(v_alarm1).1 <> ax_alarm.ax_scr1_updown THEN VR(v_alarm1).1 = ax_alarm.ax_scr1_updown IF VR(v_alarm1).2 <> ax_alarm.ax_scr1_halftone THEN VR(v_alarm1).2 = ax_alarm.ax_scr1_halftone IF VR(v_alarm1).3 <> ax_alarm.ax_scr1_scraper THEN VR(v_alarm1).3 = ax_alarm.ax_scr1_scraper IF VR(v_alarm1).4 <> ax_alarm.ax_scr2_updown THEN VR(v_alarm1).4 = ax_alarm.ax_scr2_updown IF VR(v_alarm1).5 <> ax_alarm.ax_scr2_halftone THEN VR(v_alarm1).5 = ax_alarm.ax_scr2_halftone IF VR(v_alarm1).6 <> ax_alarm.ax_scr2_scraper THEN VR(v_alarm1).6 = ax_alarm.ax_scr2_scraper IF VR(v_alarm1).7 <> ax_alarm.ax_scr3_updown THEN VR(v_alarm1).7 = ax_alarm.ax_scr3_updown IF VR(v_alarm1).8 <> ax_alarm.ax_scr3_halftone THEN VR(v_alarm1).8 = ax_alarm.ax_scr3_halftone IF VR(v_alarm1).9 <> ax_alarm.ax_scr3_scraper THEN VR(v_alarm1).9 = ax_alarm.ax_scr3_scraper IF VR(v_alarm1).10 <> ax_alarm.ax_goin_spin THEN VR(v_alarm1).10 = ax_alarm.ax_goin_spin IF VR(v_alarm1).11 <> ax_alarm.ax_output_spin THEN VR(v_alarm1).11 = ax_alarm.ax_output_spin IF VR(v_alarm1).12 <> ax_alarm.ax_tl THEN VR(v_alarm1).12 = ax_alarm.ax_tl IF VR(v_alarm1).13 <> ax_alarm.ax_work1 THEN VR(v_alarm1).13 = ax_alarm.ax_work1 IF VR(v_alarm1).14 <> ax_alarm.ax_work2 THEN VR(v_alarm1).14 = ax_alarm.ax_work2 IF VR(v_alarm1).15 <> ax_alarm.ax_work3 THEN VR(v_alarm1).15 = ax_alarm.ax_work3 IF VR(v_alarm2).0 <> ax_alarm.ax_work4 THEN VR(v_alarm2).0 = ax_alarm.ax_work4 IF VR(v_alarm2).1 <> ax_alarm.ax_work5 THEN VR(v_alarm2).1 = ax_alarm.ax_work5 IF VR(v_alarm2).2 <> ax_alarm.ax_work6 THEN VR(v_alarm2).2 = ax_alarm.ax_work6 IF VR(v_alarm2).3 <> ax_alarm.ax_work7 THEN VR(v_alarm2).3 = ax_alarm.ax_work7 IF VR(v_alarm2).4 <> ax_alarm.ax_work8 THEN VR(v_alarm2).4 = ax_alarm.ax_work8 IF VR(v_alarm2).5 <> ax_alarm.ax_work9 THEN VR(v_alarm2).5 = ax_alarm.ax_work9 IF VR(v_alarm2).6 <> ax_alarm.ax_work10 THEN VR(v_alarm2).6 = ax_alarm.ax_work10 IF VR(v_warn1).0 <> ax_warn.ax_dial THEN VR(v_warn1).0 = ax_warn.ax_dial IF VR(v_warn1).1 <> ax_warn.ax_scr1_updown THEN VR(v_warn1).1 = ax_warn.ax_scr1_updown IF VR(v_warn1).2 <> ax_warn.ax_scr1_halftone THEN VR(v_warn1).2 = ax_warn.ax_scr1_halftone IF VR(v_warn1).3 <> ax_warn.ax_scr1_scraper THEN VR(v_warn1).3 = ax_warn.ax_scr1_scraper IF VR(v_warn1).4 <> ax_warn.ax_scr2_updown THEN VR(v_warn1).4 = ax_warn.ax_scr2_updown IF VR(v_warn1).5 <> ax_warn.ax_scr2_halftone THEN VR(v_warn1).5 = ax_warn.ax_scr2_halftone IF VR(v_warn1).6 <> ax_warn.ax_scr2_scraper THEN VR(v_warn1).6 = ax_warn.ax_scr2_scraper IF VR(v_warn1).7 <> ax_warn.ax_scr3_updown THEN VR(v_warn1).7 = ax_warn.ax_scr3_updown IF VR(v_warn1).8 <> ax_warn.ax_scr3_halftone THEN VR(v_warn1).8 = ax_warn.ax_scr3_halftone IF VR(v_warn1).9 <> ax_warn.ax_scr3_scraper THEN VR(v_warn1).9 = ax_warn.ax_scr3_scraper IF VR(v_warn1).10 <> ax_warn.ax_goin_spin THEN VR(v_warn1).10 = ax_warn.ax_goin_spin IF VR(v_warn1).11 <> ax_warn.ax_output_spin THEN VR(v_warn1).11 = ax_warn.ax_output_spin IF VR(v_warn1).12 <> ax_warn.ax_tl THEN VR(v_warn1).12 = ax_warn.ax_tl IF VR(v_warn1).13 <> ax_warn.ax_work1 THEN VR(v_warn1).13 = ax_warn.ax_work1 IF VR(v_warn1).14 <> ax_warn.ax_work2 THEN VR(v_warn1).14 = ax_warn.ax_work2 IF VR(v_warn1).15 <> ax_warn.ax_work3 THEN VR(v_warn1).15 = ax_warn.ax_work3 IF VR(v_warn2).0 <> ax_warn.ax_work4 THEN VR(v_warn2).0 = ax_warn.ax_work4 IF VR(v_warn2).1 <> ax_warn.ax_work5 THEN VR(v_warn2).1 = ax_warn.ax_work5 IF VR(v_warn2).2 <> ax_warn.ax_work6 THEN VR(v_warn2).2 = ax_warn.ax_work6 IF VR(v_warn2).3 <> ax_warn.ax_work7 THEN VR(v_warn2).3 = ax_warn.ax_work7 IF VR(v_warn2).4 <> ax_warn.ax_work8 THEN VR(v_warn2).4 = ax_warn.ax_work8 IF VR(v_warn2).5 <> ax_warn.ax_work9 THEN VR(v_warn2).5 = ax_warn.ax_work9 IF VR(v_warn2).6 <> ax_warn.ax_work10 THEN VR(v_warn2).6 = ax_warn.ax_work10
可以将代码优化为:
FOR i = TO 6
IF VR(v_alarm1).i <> ax_alarm.ax_scr1_updown+i THEN VR(v_alarm1).i = ax_alarm.ax_scr1_updown+i
IF VR(v_alarm1).i+3 <> ax_alarm.ax_scr2_updown+i THEN VR(v_alarm1).i+3 = ax_alarm.ax_scr2_updown+i
IF VR(v_alarm1).i+6 <> ax_alarm.ax_scr3_updown+i THEN VR(v_alarm1).i+6 = ax_alarm.ax_scr3_updown+i
IF VR(v_warn1).i <> ax_warn.ax_scr1_updown+i THEN VR(v_warn1).i = ax_warn.ax_scr1_updown+i
IF VR(v_warn1).i+3 <> ax_warn.ax_scr2_updown+i THEN VR(v_warn1).i+3 = ax_warn.ax_scr2_updown+i
IF VR(v_warn1).i+6 <> ax_warn.ax_scr3_updown+i THEN VR(v_warn1).i+6 = ax_warn.ax_scr3_updown+i
NEXT i
FOR i = 10 TO 15
IF VR(v_alarm1).i <> ax_alarm.ax_goin_spin+i-10 THEN VR(v_alarm1).i = ax_alarm.ax_goin_spin+i-10
IF VR(v_alarm1).i+2 <> ax_alarm.ax_tl+i-10 THEN VR(v_alarm1).i+2 = ax_alarm.ax_tl+i-10
IF VR(v_alarm1).i-10 <> ax_alarm.ax_work1+i-10 THEN VR(v_alarm1).i-10 = ax_alarm.ax_work1+i-10
IF VR(v_alarm1).i-7 <> ax_alarm.ax_work4+i-10 THEN VR(v_alarm1).i-7 = ax_alarm.ax_work4+i-10
IF VR(v_warn1).i <> ax_warn.ax_goin_spin+i-10 THEN VR(v_warn1).i = ax_warn.ax_goin_spin+i-10
IF VR(v_warn1).i+2 <> ax_warn.ax_tl+i-10 THEN VR(v_warn1).i+2 = ax_warn.ax_tl+i-10
IF VR(v_warn1).i-10 <> ax_warn.ax_work1+i-10 THEN VR(v_warn1).i-10 = ax_warn.ax_work1+i-10
IF VR(v_warn1).i-7 <> ax_warn.ax_work4+i-10 THEN VR(v_warn1).i-7 = ax_warn.ax_work4+i-10
NEXT i
这样可以减少代码行数,提高代码的可读性和可维护性。
if (cmd_vel.linear.x < vp_min+1500) cmd_vel.linear.x = vp_min+1500; if (mapPathNum <= 0) { //if now the path is empty then v=kv ROS_WARN("---------------NO PATH TO GO"); cmd_vel.linear.x = 115; //cmd_vel.angular.z = anglelast + 0.1; } if (cmd_vel.linear.x > vp_max_base+1500) cmd_vel.linear.x = vp_max_base+1500; if (cmd_vel.angular.z > 135) cmd_vel.angular.z = 135; else if (cmd_vel.angular.z < 45) cmd_vel.angular.z = 45;
这段代码实现了对小车控制指令的限制,以确保小车的运动安全、稳定、高效。
具体来说,代码中包含了以下几个条件限制:
- 如果小车的线速度低于最小线速度 `vp_min+1500`,则将其设置为 `vp_min+1500`。
- 如果小车的线速度高于最大线速度 `vp_max_base+1500`,则将其设置为 `vp_max_base+1500`。
- 如果小车的角速度大于 135 度,则将其设置为 135 度。
- 如果小车的角速度小于 45 度,则将其设置为 45 度。
这些限制条件可以保证小车在行驶过程中不会过快或过慢,同时能够避免出现超速或失速等危险情况。
另外,当路径规划模块输出的路径为空时,代码中会将小车的线速度设置为一个较小的值 115,以便小车能够停止运动并等待新的路径规划结果。在这种情况下,代码中还会输出一条警告信息,提示路径为空的情况。
阅读全文