Hi,

Registration of function via *registerFunction* is different from its
registration in OFunction. *registerFunction*() is rather for native java
functions, while *OFunction* is for functions on dynamic languages (sql,
JS).

You might call *registerFunction* on client, so the server know nothing
about your function, so when query is executed it can't find your function.

To make server see your function you have 2 options:

   1. create function with dynamic language. You can use for example *CREATE
   FUNCTION* command
   2. create a plugin with your function implemented in Java and registered
   via registerFunction() and put this plugin into plugins directory on server.





Best regards,
Artem Orobets

*Orient Technologies the Company behind OrientDB*


2014-06-06 23:00 GMT+03:00 <[email protected]>:

> Thanks for the response, Artem. I have copy/pasted the example code to
> register the bigger() function, and run it. I don't get any errors calling
> it from a select statement in Java, but it is not recognized as a valid
> function name if I start up the console after.
>
> I am running  v.1.7-SNAPSHOT (build 22). Here is pseudocode of what I'm
> attempting:
>
> // open connection to database
> // registerFunction()
> // execute query with function
> // close database
>
> After this, I connect to the database with console.sh, but the function I
> registered above is not in OFunction. Am I misunderstanding the
> registration step, or the registration process?
>
> thanks,
> Eff
>
>
>
> On Thursday, June 5, 2014 4:16:21 AM UTC-4, Artem Orobets wrote:
>
>> Hi,
>>
>> The following step is a registration of function:
>>
>> OSQLEngine.getInstance().registerFunction(...)
>>
>> It is present in a an example, you may be missed that.
>>
>> Best regards,
>> Artem Orobets
>>
>> * Orient Technologiesthe Company behind OrientDB*
>>
>>
>> 2014-06-04 20:39 GMT+03:00 <[email protected]>:
>>
>>>  I am trying to write a custom function in Java that can be called from
>>> the console. I have seen https://github.com/orientechnologies/orientdb/
>>> wiki/SQL-Functions#custom-functions-in-java as a simple example, but
>>> there is no mention of how to register the function so that it can be
>>> called from the console later. Does anyone have an example or guidance on
>>> the registration step?
>>>
>>> --
>>>
>>> ---
>>> 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.
>>>
>>
>>  --
>
> ---
> 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.
>

-- 

--- 
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.

Reply via email to