Hi, I'm trying to run a simple update with a sub-select query, but it is
just not taking the value from the sub query. I found few examples on
google, but for some reason mine still not working no matter what I try.
Here is my query:
orientdb {db=Customers}> update #69:0 set meta.ownerId = (select id from
Account where @rid = #25:1) Updated record(s) '1' in
0.003000 sec(s).
orientdb {db=Customers}> select meta from #69:0
+----+-----------------------------------------------------------------------------------+
|# |meta
|
+----+-----------------------------------------------------------------------------------+
|0 |LeadMeta{creator:
#25:0,leadCampaign:#149:0,category:#45:1,owner:#25:1,ownerId:null}|
+----+-----------------------------------------------------------------------------------+
As you can see it sets "ownerId" to null. I tried get id as id[0] but
didn't help. The meta.ownerId and the id are both Integers. The sub-query
on its own is returning the id just fine:
orientdb {db=Customers}> select id from Account where @rid = #25:1
+----+----+
|# |id |
+----+----+
|0 |21 |
+----+----+
Even when I tried with the hard coded id in the sub-query, it still results
in null:
orientdb {db=Customers}> update #69:0 set meta.ownerId = (select 21 from
Account where @rid = #25:1)
Updated record(s) '1' in 0.002000 sec(s).
orientdb {db=Customers}> select meta from #69:0
+----+-----------------------------------------------------------------------------------+
|# |meta
|
+----+-----------------------------------------------------------------------------------+
|0 |LeadMeta{creator:
#25:0,leadCampaign:#149:0,category:#45:1,owner:#25:1,ownerId:null}|
+----+-----------------------------------------------------------------------------------+
I'm sure I'm doing something wrong, since this is a very trivial operation.
Just can't see what.
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.