Hi Folks,
I'm not able to create a function using named parameters with the "CREATE
EDGE" sql syntax. I have previously been able to use named parameters with
a SELECT query, (for example: select path,name, @rid as tagrid from Tag
where path containstext :pathpart ) so I think I'm doing the parameter
names correctly.
Below are two examples. The first example errors when using named
parameters. The second example hard-codes the RID values, so it succeeds.
I want something like the first one to work.
I enter the below values in the studio, and I can get it to fail in studio.
It also fails when I call it from REST client.
==================
This function errors in the OrientDB studio functions tab and in the REST
interface with this message:
Function:
Name: tagDoc
Language: SQL
Idempotent: NO
parameter: tagRID
parameter: docRID
Body:
create edge TaggedBy from :tagRID to :docRID set name = 'created by
tagDoc'
Calling the function:
parameter values:
parameter[0]: #15:6
parameter[1]: #12:6
returns==>
java.lang.NumberFormatException: For input string: ""
and in the log is
2014-10-01 16:52:18:843 SEVE Internal server error:
java.lang.NumberFormatException: For input string: ""
[ONetworkProtocolHttpDb]
==== VERSUS ====
This function succeeds because the rid's are hard-coded in the function and
I ignore the input parameters.
Function
Name: tagDoc_hardcoded
Languate: SQL
Idempotent: NO
parameter: tagRID
parameter: docRID
create edge TaggedBy from #15:6 to #12:6 set name = 'created by
tagDoc_hardcoded'
==>
[{"@type":"d","@rid":"#14:15","@version":2,"@class":"TaggedBy","name":"created
by tagDoc_hardcoded","out":"#15:6","in":"#12:6"}]
======================
FYI, here is part of my schema:
create class Tag extends V;
create property Tag.name string;
create property Tag.path string;
create property Tag.caption string;
create property Tag.type string;
create property Tag.aliases embeddedmap Tag;
create class Doc extends V;
create property Doc.name string;
create property Doc.mimetype string;
create property Doc.url string;
create class TaggedBy extends E;
create property TaggedBy.name string;
======================================
I'm using a bleeding edge build from git:
INFO OrientDB Server v2.0-SNAPSHOT (build 2) is starting up... [OServer]
Please let me know what I'm doing wrong.
Thanks,
Laramie
--
---
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.