You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Daniel John Debrunner (JIRA)" <ji...@apache.org> on 2007/10/12 18:03:51 UTC

[jira] Commented: (DERBY-3125) registerOutputParameter with a specified scale does not adjust the scale of the output parameter

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

Daniel John Debrunner commented on DERBY-3125:
----------------------------------------------

It would be good to get some clarification on what the scale set by registerOutParameter should affect. E.g.

   - should decimal digits be modified on a setBigDecimal for INOUT parameters ?

   - should parameter meta data reflect the scale of the declared parameter of the procedure or of the scale set by registerOutParameter?

   - how does getBigDecimal() that takes a scale value behave?
  

> registerOutputParameter with a specified scale does not adjust the scale of the output parameter
> ------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-3125
>                 URL: https://issues.apache.org/jira/browse/DERBY-3125
>             Project: Derby
>          Issue Type: Bug
>          Components: JDBC
>    Affects Versions: 10.4.0.0
>            Reporter: Kathey Marsden
>            Priority: Minor
>
> Running the following program with either embedded or client does not adjust the scale of the output parameter.
> public class DecimalOutParam {
>     public static void main(String[] args) throws Exception
>     {
> 	//Class.forName("org.apache.derby.jdbc.ClientDriver").newInstance();
> 	//Connection conn = DriverManager.getConnection("jdbc:derby://localhost:1527/wombat;create=true");
>         Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
>         Connection conn = DriverManager.getConnection("jdbc:derby:wombat;create=true");
> 	Statement s = conn.createStatement();
> 	try 
> 	    {
> 	    s.executeUpdate("DROP PROCEDURE DECPROC");
> 	    } 
> 	catch (SQLException se)
> 	    {
> 		
> 	    }
> 	s.executeUpdate("CREATE PROCEDURE DECPROC(OUT DECIMAL(10,2))  parameter style java language java NO SQL external name 'DecimalOutParam.decProc'");
> 	
> 	CallableStatement cs = conn.prepareCall("CALL DECPROC(?)");
>     cs.registerOutParameter(1,java.sql.Types.DECIMAL, 0);
>     cs.executeUpdate();
>     System.out.println(cs.getBigDecimal(1));    
>        
>     }
>     public static void decProc(BigDecimal [] outDec)
>     {
>         outDec[0] = new BigDecimal("123.45");
>     }
> }
> C:/kmarsden/repro/DERBY-2073] java DecimalOutParam
> 23.45
> Should be 
> 23

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.