Right I did a similar work by using * created = ifnull(created, created, sysdate()) *in the update statement. This is another option. Thanks.
On Thursday, May 21, 2015 at 9:36:23 PM UTC+5:30, Ziink A wrote: > > Also if you want to set a field only when it's first inserted, try > something like > > *update Test set test = 'b4', created = if(@version, created, sysdate()) > upsert where test = 'b4'* > > In the above statement, the 'created' field is set only when the record is > first created. On updates, it's left alone. > > > On Thursday, May 14, 2015 at 12:29:24 AM UTC-7, Snigdha Batra wrote: >> >> Is there a way to know whether UPDATE UPSERT created the record or >> updated it? >> We have a use case that needs separate operations on create and match - >> something like Neo4j's Merge - ON CREATE & ON MATCH. >> How can we do such a thing in 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
