简体   繁体   English

Oriendb从表中选择@ rid返回-2:0

[英]Oriendb Select @ rid from table returning -2:0

On Executing the following query in Oriendb(2.1.2),@rid is returning negative rid and actually rid is present in a rid key.Please refer below for the more explanation 在Oriendb(2.1.2)中执行以下查询时,@ rid返回负rid,而rid键中实际存在rid。请参阅下面的更多说明

Sub Query : 子查询:

select @rid from actions

OP : OP:

{
    "result": [
        {
            "@type": "d",
            **"@rid": "#-2:0",**
            "@version": 0,
            **"rid": "#12:24",**
            "@fieldTypes": "rid=x"
        }
    ],
    "notification": "Query executed in 0.026 sec. Returned 1 record(s)"
}

Main Query : 主要查询:

INSERT INTO activityDetails SET name = "Dummy",actionMap ={"1":(**select  @rid from action where start is not null**-->Returns a invalid Rid),"2":(select * from action where stop is not null)};

Op: OP:

com.orientechnologies.orient.core.exception.OValidationException: The field 'activityDetails.actionMap' has been declared as LINKMAP but the value is not a record or a record-id

How to substitute rid in place of @rid in subquery? 如何在子查询中用rid代替@rid?

The negative RID means that is temporary. 负RID表示这是暂时的。 When the transaction is committed a real RID will be assigned this beacause after the commit the RID is changed and it's updated in the object. 提交事务后,将因为此原因而更改了RID并在对象中对其进行了更新,因此将分配一个真正的RID。

when you make the insert, only one record is returned from the selects? 当您进行插入时,选择中仅返回一条记录? you could do a test by putting in the select "limit 1") 您可以通过选择“限制1”进行测试)

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

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