db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik.Bengt...@intl.westernunion.com
Subject cant' get user defined function to work
Date Mon, 26 Sep 2005 08:52:42 GMT
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);

    }

}

        

When I try to use the function, I get the following:

 

'JPOX_ASCII' is not recognized as a function or procedure.

ERROR 42Y03: 'JPOX_ASCII' is not recognized as a function or procedure.

 

It works when the EXTERNAL NAME refers to a java.lang.* operation. I've
tried several other combinations on external name, and the function
parameters, and none of them was good.

 

1 - Is there another way where I can get the ASCII value for a CHAR(1)
column?

2 - How can I make the above function to work?

 

Thanks,

 

Erik Bengtson

 


Mime
View raw message