Best way to do SQL UPDATE when reference to target record

19 views
Skip to first unread message

Eric24

unread,
Jan 20, 2018, 3:46:44 PM1/20/18
to OrientDB
I'm running a query that sets a field in a target record to a calculated value based on another field in that same record. This is a simplified version of my query:

UPDATE #25:0 SET publish = eval('@this.expires + 2')

This works, but I just wanted to see if using the eval() function in this way was the best/preferred way to do this.

Luca Garulli

unread,
Jan 20, 2018, 5:45:41 PM1/20/18
to OrientDB
Hi Eric,

With v3.0 you can avoid the eval and doing:

UPDATE #25:0 SET publish = expires + 2


Best Regards,

Luca Garulli
Founder OrientDB

--

---
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 orient-database+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages