db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel John Debrunner <...@apache.org>
Subject Re: unable to execute procedure
Date Tue, 04 Apr 2006 16:28:06 GMT
Anil Samuel wrote:

> 4. Tried to execuet this procedure by doing
> CALL dtp.TOTAL_LEAVE_FOR_TYPE('TOM',3);
> but it results
> ERROR 42Y03: 'SQLJ.INSTALL_JAR' is not recognized as a function or
> procedure.
> 
> How do I get this working ?

Did you create the SQL function using CREATE FUNCTION?

The wiki has a page on this:

http://wiki.apache.org/db-derby/DerbySQLroutines

For this routine it would be something like:

CREATE FUNCTION
dtp.TOTAL_LEAVE_FOR_TYPE(NAME VARCHAR(20), LEAVE_TYPE INT)
RETURNS INTEGER
LANGUAGE JAVA PARAMETER STYLK JAVA
READS SQL DATA
EXTERNAL NAME 'oracle.dtp.derby.sample.TotalLeaveForType'

This is a function not a procedure because it returns a value.

To execute it it can be called like any othjer function.

VALUES dtp.TOTAL_LEAVE_FOR_TYPE(?, ?)

or

SELECT dtp.TOTAL_LEAVE_FOR_TYPE(E.NAME, ?) from employees E


Dan.



Mime
View raw message