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.