[ 
https://issues.apache.org/jira/browse/DERBY-6511?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13937717#comment-13937717
 ] 

Rick Hillegas commented on DERBY-6511:
--------------------------------------

Thanks, Knut. Yes, given these functions...

{noformat}
public class zz
{
    public  static  Integer intToInteger( int val )
    {
        return new Integer( val );
    }

    public  static  int     integerToInt( Integer val )
        throws Exception
    {
        if ( val == null )  { throw new Exception( "This method does not allow 
nulls!" ); }
        else { return val.intValue(); }
    }
}
{noformat}

...I see this behavior:

{noformat}
connect 'jdbc:derby:memory:db;create=true';

create function intToInteger( val int ) returns int
language java parameter style java deterministic no sql
external name 'zz.intToInteger';

create function integerToInt( val int ) returns int
language java parameter style java deterministic no sql
external name 'zz.integerToInt';

-- succeeds
values intToInteger( integerToInt( 1 ) );

-- succeeds
values intToInteger( intToInteger( 1 ) );

-- fails
values integerToInt( integerToInt( 1 ) );

-- succeeds
values integerToInt( intToInteger( 1 ) );
{noformat}



> java.lang.NoSuchMethodError chaining a function and procedure
> -------------------------------------------------------------
>
>                 Key: DERBY-6511
>                 URL: https://issues.apache.org/jira/browse/DERBY-6511
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.11.0.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-6511.sql, derby-6511.sql
>
>
> java.lang.NoSuchMethodError is raised when calling a procedure which takes an 
> Integer argument and passing it the result of a function which returns an 
> int. The error is raised in generated code.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to