Batch SQL Command Fails

未关闭
#369 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
sql
领域
documentation

调研方向

首先,将所引用的 3.0.x 文档中的批量 SQL 示例与此处显示的命令和解析器错误进行比较。如果有可用的相关 OrientDB 设置,请重现该命令,然后验证文档或报告的语法是否不正确。当文档中的示例与受支持的行为一致,或清楚地说明该限制时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

I wanted to insert a record into Another_Class if Check_Class exists and I wrote the following batch SQL command but it failed with the error below. I have used the next line character (\n) around the IF as required in doc 3.0.x but it is still not working.

session.command("LET $a = (SELECT from V WHERE @class = 'Check_Class' limit 1); \n if($a.size() = 0) { \n INSERT INTO CLASS Another_Class SET name = 'test'; \n }");

xxxxxxxxxxx ERROR xxxxxxxxxxxxxxxxxxxxxx
Exception in thread "main" com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error parsing query:
LET $a = (SELECT from V WHERE @class = 'Check_Class' limit 1);
if($a.size() = 0) {
^
INSERT INTO CLASS Another_Class SET name = 'test';
} 
Encountered " "if "" at line 2, column 2.
Was expecting:

主要语言
CSS
星标
59
派生
164
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

orientechnologies/orientdb-docs 的其他 Issue

查看 orientechnologies/orientdb-docs 的全部 Issue

相似的 Issue

更多 Documentation Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。