Hi,

I found this way the query works well

    val rid3 = reqdoc3.toMap.get("@rid").toString

   db.command(new OCommandSQL(s"update (select expand(millis[2]) from 
Second)" +
     s" add requests = $rid3")).execute()

Regards



On Saturday, May 2, 2015 at 12:14:00 AM UTC+3, [email protected] wrote:
>
> Hi,
>
> It looks like  
>
>     db.command(new OCommandSQL("update (select expand(millis[2]) from 
> Second)" +
>           " add requests = ?")).execute(reqdoc3)
>
> doesn't work at all. The only way I found is to get requests from the node 
> ODocument, put a new ODocument into requests and update the node ODocument -
>
>     val requests2 = 
> millidoc.field[java.util.HashSet[ODocument]]("requests").asScala.asJava
>     
>     requestsm.add(reqdoc3)
>         
>     db.command(new OCommandSQL("update (select expand(millis[2]) from 
> Second)" +
>           " set requests = ?")).execute(requests2)
>
> But I think it must be better solution. Any idea?
>
>
>
>
>
> On Friday, May 1, 2015 at 11:21:31 PM UTC+3, [email protected] wrote:
>>
>> Thank you Paul, the error message disappeared, but  SQL does not update 
>> the 
>> linkset (very curiously because it does from console), will dig further. 
>> Anyway, thank you very much indeed for your help.
>>
>> Regards,
>> Sergei
>>  
>>
>> On Friday, May 1, 2015 at 6:34:40 PM UTC+3, Paul Scott wrote:
>>>
>>> Sorry, on mobile and typing is hard (I'm a big dude with big thumbs)
>>>
>>> graph.command(
>>>           new OCommandSQL("UPDATE...."));
>>>
>>> If you follow the source to OCommandSQL() you will see that there are 2 
>>> query types, one for idempotent and another for non idempotent queries.
>>>
>>> -- Paul
>>>
>>> On Fri, 01 May 2015, 17:20  <[email protected]> wrote:
>>>
>>>> Sorry, what do you mean? Could you provide an example, please? Thank 
>>>> you.
>>>>
>>>>
>>>>
>>>> On Friday, May 1, 2015 at 4:48:30 PM UTC+3, Paul Scott wrote:
>>>>
>>>>> Use the Raw sql query. Update is idempotent.
>>>>>
>>>>> -- Paul
>>>>>
>>>>> On Fri, 01 May 2015, 15:45  <[email protected]> wrote:
>>>>>
>>>> Hi,
>>>>>>
>>>>>> I am just starting to explore the usage of orient database.
>>>>>>
>>>>>> In the query
>>>>>>
>>>>>>     db.command(new OSQLSynchQuery[ODocument]("update (select 
>>>>>> expand(milli[2]) from Second)" +
>>>>>>       " add request = ?")).execute(reqdoc3)
>>>>>>
>>>>>> I got - Cannot execute non idempotent command, while running the same 
>>>>>> query from console -
>>>>>>
>>>>>>     update (select expand(milli[2]) from Second) add request = #13:2
>>>>>>
>>>>>> everything is ok. Where is my mistake? Thank you.
>>>>>>  
>>>>>>
>>>>>> -- 
>>>>>>
>>>>>> --- 
>>>>>> 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.
>>>>>>
>>>>>  -- 
>>>>
>>>> --- 
>>>> 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.
>>>>
>>>

-- 

--- 
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.

Reply via email to