I have 2 OrientDB questions.
For example I have Function called getAll
"SELECT FROM V WHERE name =:name"
I wish to retrive result in simple SQL Query Something liket his
SELECT type FROM (getAll("Test"))
How I can accomplish this ?
Is it possiable to run new SQL SELECT Query with new parameters based on previous queries? For Example
SELECT $C FROM V LET $A = (SELECT FROM V WHERE name = 'Test1') , $B = (SELECT FROM V WHERE type = 'Type1') , $C = (SELECT FROM V WHERE type = $B and name = $A)
This case is working but takes a lot of time (as i understands this happens because it runs on all content of V)
Thanks in advance.
To call a function try this:
SELECT getAll("Test")
with this you retrieve only the RID, if you want all the properties try this:
SELECT expand(getAll("Test"))
if you want to only retrieve the type property, you can do it in 2 ways:
select type from(SELECT expand(getAll("Test")))
SELECT type FROM V WHERE name = :name
For your second question you were pretty close, I've just modify it a little bit:
SELECT $C FROM V
LET $A = (SELECT FROM V WHERE name = 'Test1') ,
$B = (SELECT FROM V WHERE type = 'Type1') ,
$C = (SELECT FROM V WHERE type contains $B.type and name contains $A.name)
Hope it helps
Regards