Pass let binding to increment statement inside transaction

20 views
Skip to first unread message

Jonathan Kienzle

unread,
May 7, 2015, 1:58:04 AM5/7/15
to orient-...@googlegroups.com
Hello,

I have a transaction where I want to refer to a let binding in an increment statement.
I am using OrientDB 2.0.8.

This is a simplified version of the query that I want to execute, but it results in a OCommandExecutionException:

BEGIN
  LET destPositionCount = SELECT count(*) FROM containsContainer WHERE (out.@rid = :parentId AND position = :destPosition)
  LET updateContainerPositions = UPDATE containsContainer INCREMENT position = $destPositionCount WHERE position >= :lowerBound
COMMIT
RETURN $updateContainerPositions

The interesting part is "INCREMENT position = $destPositionCount". This is the reason it fails.
I also tried casting $destPositionCount to an int using "$destPositionCount.asInteger()", but it didn't help.


Is there something I am doing wrong or is this a limitation with OrientDB. Do you have any suggestions how I could solve this?

Best regards,
Jonathan
Reply all
Reply to author
Forward
0 new messages