Search code examples
orientdbgraph-databasesorientdb2.2

OrientDB Creating an edge using select statement to set property


I want to create an edge using a sub query to set a property. The following is the query i am using:

create edge HAS from #57:0 to #80:3 set Type = (select from A where ID = 1)

This gives me the following error:

OvalidationException:
The field 'HAS.Type' has been declared as LINK but the 
value is not a record or a record-id

Please note the Type is a property of type LINK. Any help is appreciated thanks!


Solution

  • The following is the answer:

    create edge HAS from #57:0 to #80:3 set Type = first((select from A where ID = 1))