IT运维流程库历史主题 · 只读
← 返回目录

系统管理-管理员手册-OQL查询语言-已知问题和限制


已知问题和限制

从2.3.0新内容:优化了请求时,对OQL的新约束:

如果用户定义了允许的组织,则此查询将失败


不支持 ! 操作符。

!ISNULL(start_date) 等价于解释成 ISNULL(start_date) != 1

不支持true 和 false,

  • 使用 1 代替 true
  • 使用 !=1 代替 false

不支持null ,使用函数 ISNULL(attribute) 代替
外键不可以为NULL,没有定义的话设置为0

LIKE
语法 LIKE is LIKE “%abc%”.

逃脱一个字符,你前缀字符。

例如:

SELECT Contact WHERE name LIKE "%d\"a%"
The _ and % in the MySQL Like statement have special meanings, as documented in the [ /doc/refman/5.7/en/pattern-matching.html]MySQL documentation :

  • _ to match any single character
  • % to match an arbitrary number of characters (including zero characters)

如果你需要搜索这些字符,在SQL中要避免单个字符,

例如:

SELECT VirtualMachine WHERE name LIKE "%with\\_undescore%"
SELECT VirtualMachine WHERE name LIKE "%100\\% total%"

LIMIT, ORDER, GROUPBY, COUNT, SUM
当前OQL不支持 LIMIT, ORDER, GROUPBY, COUNT, SUM,还有许多其他的函数