Hi,
acording to documentation this should work:
begin
> let $user = UPDATE User SET user_id = 'userX' UPSERT RETURN AFTER @rid
> WHERE user_id = 'userX'
> let $service = UPDATE Service SET service = 'serviceX' UPSERT RETURN AFTER
> @rid WHERE service = 'serviceX'
> CREATE EDGE link FROM $user TO $service
> commit
>
But it doesn't work. It seems like value is never assigned in "LET" block.
2015-09-21 08:10:15:808 FINE [ONetworkProtocolHttpAbstract.execute]
Requested: POST /batch/mydb [ONetworkProtocolHttpDb]
2015-09-21 08:10:15:818 FINE {db=mydb} Read record #18:15 v.29 size=90
bytes [OLocalPaginatedStorage]
2015-09-21 08:10:15:820 FINE {db=mydb} Read record #22:11 v.23 size=18
bytes [OLocalPaginatedStorage]
2015-09-21 08:10:15:822 FINE {db=mydb} Read record #25:2 v.3 size=19 bytes
[OLocalPaginatedStorage]
2015-09-21 08:10:15:823 FINE {db=mydb} Read record #25:3 v.23 size=22
bytes [OLocalPaginatedStorage]Caught exception
com.orientechnologies.orient.core.exception.OCommandExecutionException:
Error on execution of command: sql.CREATE EDGE link FROM $user TO $service
RETRY 100
at
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.executeCommand(OAbstractPaginatedStorage.java:1482)
at
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:1450)
at
com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:63)
at
com.orientechnologies.orient.core.command.script.OCommandExecutorScript.executeCommand(OCommandExecutorScript.java:319)
at
com.orientechnologies.orient.core.command.script.OCommandExecutorScript.executeSQLScript(OCommandExecutorScript.java:258)
at
com.orientechnologies.orient.core.command.script.OCommandExecutorScript.executeSQL(OCommandExecutorScript.java:142)
at
com.orientechnologies.orient.core.command.script.OCommandExecutorScript.executeInContext(OCommandExecutorScript.java:87)
at
com.orientechnologies.orient.core.command.script.OCommandExecutorScript.execute(OCommandExecutorScript.java:76)
at
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.executeCommand(OAbstractPaginatedStorage.java:1469)
at
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.command(OAbstractPaginatedStorage.java:1450)
at
com.orientechnologies.orient.core.command.OCommandRequestTextAbstract.execute(OCommandRequestTextAbstract.java:63)
at
com.orientechnologies.orient.server.network.protocol.http.command.post.OServerCommandPostBatch.execute(OServerCommandPostBatch.java:195)
at
com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.service(ONetworkProtocolHttpAbstract.java:180)
at
com.orientechnologies.orient.server.network.protocol.http.ONetworkProtocolHttpAbstract.execute(ONetworkProtocolHttpAbstract.java:627)
at
com.orientechnologies.common.thread.OSoftThread.run(OSoftThread.java:77)
Caused by: java.lang.IllegalArgumentException: source record is not a vertex
at
com.tinkerpop.blueprints.impls.orient.OrientVertex.addEdge(OrientVertex.java:906)
at
com.orientechnologies.orient.graph.sql.OCommandExecutorSQLCreateEdge$1.call(OCommandExecutorSQLCreateEdge.java:181)
at
com.orientechnologies.orient.graph.sql.OCommandExecutorSQLCreateEdge$1.call(OCommandExecutorSQLCreateEdge.java:140)
at
com.orientechnologies.orient.graph.sql.OGraphCommandExecutorSQLFactory.runInTx(OGraphCommandExecutorSQLFactory.java:130)
at
com.orientechnologies.orient.graph.sql.OGraphCommandExecutorSQLFactory.runInTx(OGraphCommandExecutorSQLFactory.java:150)
at
com.orientechnologies.orient.graph.sql.OCommandExecutorSQLCreateEdge.execute(OCommandExecutorSQLCreateEdge.java:140)
at
com.orientechnologies.orient.core.sql.OCommandExecutorSQLDelegate.execute(OCommandExecutorSQLDelegate.java:90)
at
com.orientechnologies.orient.core.storage.impl.local.OAbstractPaginatedStorage.executeCommand(OAbstractPaginatedStorage.java:1469)
... 14 more
2015-09-21 08:10:15:826 SEVER Internal server error:
java.lang.IllegalArgumentException: source record is not a vertex
[ONetworkProtocolHttpDb]
2015-09-21 08:10:15:826 SEVER Internal server error:
java.lang.IllegalArgumentException: source record is not a vertex
[ONetworkProtocolHttpDb]
--
---
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.