db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean T. Anderson" <...@bristowhill.com>
Subject Re: cant' get user defined function to work
Date Mon, 26 Sep 2005 16:27:58 GMT
Erik.Bengtson@intl.westernunion.com wrote:
> Hi,
>  
> I’ve created the following function:
>  
> DROP FUNCTION JPOX_ASCII; 
> CREATE FUNCTION JPOX_ASCII(C CHAR(1)) RETURNS INTEGER 
> EXTERNAL NAME 'org.jpox.store.rdbms.adapter.Function.ascii' 
> CALLED ON NULL INPUT 
> LANGUAGE JAVA PARAMETER STYLE JAVA;
> 
> package org.jpox.store.rdbms.adapter;
> 
> public final class Function
> 
> { 
>     /** 
>      * ASCII conversion code 
>      * @param code 
>      * @return 
>      */
> 
>     public static int ascii(String code)
> 
>     { 
>         return (int)code.charAt(0); 
>     } 
> }
>

Erik's function worked for me when I changed this:

    public final class Function

to this:

    public class Function


ij> values jpox_ascii('c');
1
-----------
99

1 row selected


  -jean

Mime
View raw message