简体   繁体   English

无法在2.2.16中使用OrientDB序列

[英]Can't use OrientDB sequence in 2.2.16

I've download community 2.2.16 and I'm trying to use sequence in the following way: 我已经下载了社区2.2.16,并尝试通过以下方式使用序列:

DROP SEQUENCE idseq
CREATE SEQUENCE idseq TYPE CACHED START 1 INCREMENT 1 CACHE 20
SELECT SEQUENCE('idseq').next() from V LIMIT 20

But I can't get any values (it's working on 2.2.15) In addition, I know the sequence created since when I'm trying to recreate the index it throws me an error: 但是我无法获得任何值(在2.2.15上有效)。此外,我知道创建的序列,因为当我尝试重新创建索引时会引发错误:

Sequence 'IDSEQ' already exists 序列“ IDSEQ”已存在

My problem was that because my DB was empty the way I tried to select values from sequence didn't work and retunes an empty result set. 我的问题是,因为我的数据库是空的,所以我尝试从序列中选择值的方式不起作用并重新调整了空的结果集。

Since there isn't DUAL table like in Oracle, 由于没有像Oracle中那样的DUAL表,
I changed the query to be: 我将查询更改为:

SELECT SEQUENCE('idseq').next() from OIdentity LIMIT 20

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

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