Ah so. Good catch. Yes, the position of the RETURN clause does appear to
matter. So making this change does eliminate the exception, but
unfortunately, it doesn't produce the desired result. In this case, no
record is returned *except *when the UPDATE succeeds. What I need is
essentially the opposite: If the update doesn't succeed (because the target
key already exists), I want to get the record back (if I also get back the
newly inserted item when the update does succeed, that's fine, but not
really necessary). With MSSQL, I can do this easily in a single atomic
operation, but so far, I've not been able to come up with a solution for
OrientDB. I suppose a function or batch that executes the update followed
by a select would work, but I was hoping to find something more efficient.


On Wed, Jun 1, 2016 at 9:45 AM, <alessandrorot...@gmail.com> wrote:

> Hi Eric,
> according to the documentation
> http://orientdb.com/docs/2.2/SQL-Update.html you shoud use where
> condition after return.
> If the condition is not satisfied the update will not be executed so it
> will not return anything.
>
> Kind regards,
> Alessandro
>
> --
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "OrientDB" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/orient-database/x3idVPiMylw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> orient-database+unsubscr...@googlegroups.com.
> 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 orient-database+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to