Search code examples
orientdborientdb2.2

Updating value in OrientDB set an array like value


I tried to run the following command:

UPDATE EN190 
set Sys_DisplayTitle = (SELECT EP190_1 FROM EN190 WHERE Sys_ID = 4705)
WHERE Sys_ID = 4706

The value of (SELECT EP190_1 FROM EN190 WHERE Sys_ID = 4705) is a string:

SomeValue

and that what I expected to be in (SELECT EP190_1 FROM EN190 WHERE Sys_ID = 4706)
but the value in this field is now the following string:

[SomeValue]

How can I solve this?


Solution

  • not a really "clean" solution, but it works.

    UPDATE EN190 set Sys_DisplayTitle = (SELECT EP190_1 FROM EN190 WHERE Sys_ID = 4705),
    Sys_DisplayTitle= Sys_DisplayTitle.replace("[","").replace("]","")
    WHERE Sys_ID = 4706
    

    (see https://stackoverflow.com/a/30724286/5778523)