Re: passing parameters to function
От | Dave Cramer |
---|---|
Тема | Re: passing parameters to function |
Дата | |
Msg-id | 08F64608-CC33-4347-8CC4-31C0D3A469DF@fastcrypt.com обсуждение исходный текст |
Ответ на | passing parameters to function ("Srivats" <scshekaran@riskspan.com>) |
Список | pgsql-jdbc |
You would have to set them to NULL
Dave
On 8-Nov-05, at 7:31 AM, Srivats wrote:
Hi All,Suppose I have a store proc which accepts 4 input parametersand I do a CallableStatement.setObject( 1, "..,,," );and execute the query .CallableStatement functionCall = dbCon_.prepareCall("{call test1( ?,?,?,?) }");
functionCall.setObject( "param1","A10001" );
functionCall.setObject( "param2","19830529" );
functionCall.execute();Exception raisedjava.sql.SQLException: No value specified for parameter 3
at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:1253)
at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:1201)
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:710)
at com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:520)
during runtime. Should i set the other 2 input parameters to null,even when I dont want to pass these parameters to the SP.In this statement call test1( ?,?,?,?), should the number of parameters be the numberof parameters which the store procedure accepts or the number of parameters that i wantto pass. How should this be done when my SP accepts 4 parameters and i want to passonly any two of themThksPS: Looking for an early reply
В списке pgsql-jdbc по дате отправления: