X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 847B9D7E67 for ; Tue, 8 Nov 2005 08:31:59 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 71362-06 for ; Tue, 8 Nov 2005 12:31:51 +0000 (GMT) X-Greylist: delayed 00:07:10.730222 by SQLgrey- Received: from mail.dmz.newbreak.com (mail.newbreak.com [206.65.185.78]) by svr1.postgresql.org (Postfix) with ESMTP id 6573FD7B44 for ; Tue, 8 Nov 2005 08:31:52 -0400 (AST) Received: from sysadminbox.dev02.newbreak.com (chat.dev02.newbreak.com [202.54.186.227]) by mail.dmz.newbreak.com (8.12.11/8.12.10) with ESMTP id jA8CVqGN015910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 8 Nov 2005 07:31:55 -0500 Received: from NBINDIAXP0133 ([10.1.30.133]) by sysadminbox.dev02.newbreak.com (8.12.11/8.12.11) with SMTP id jA8CVk5B028162 for ; Tue, 8 Nov 2005 18:01:46 +0530 Message-ID: <005901c5e460$6273d980$851e010a@NBINDIAXP0133> From: "Srivats" To: Subject: passing parameters to function Date: Tue, 8 Nov 2005 18:01:46 +0530 Organization: NewBreak MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0056_01C5E48E.7C275A90" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.001 required=5 tests=[HTML_MESSAGE=0.001] X-Spam-Score: 0.001 X-Spam-Level: X-Archive-Number: 200511/46 X-Sequence-Number: 14144 This is a multi-part message in MIME format. ------=_NextPart_000_0056_01C5E48E.7C275A90 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi All, Suppose I have a store proc which accepts 4 input parameters and I do a CallableStatement.setObject( 1, "..,,," ); and execute the query .=20 CallableStatement functionCall =3D dbCon_.prepareCall("{call test1( = ?,?,?,?) }"); =20 functionCall.setObject( "param1","A10001" ); functionCall.setObject( "param2","19830529" ); functionCall.execute(); Exception raised java.sql.SQLException: No value specified for parameter 3 at = com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:12= 53) at = com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:12= 01) at = com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:710) at = com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:520) =20 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 number=20 of parameters which the store procedure accepts or the number of = parameters that i want=20 to pass. How should this be done when my SP accepts 4 parameters and i = want to pass only any two of them Thks PS: Looking for an early reply ------=_NextPart_000_0056_01C5E48E.7C275A90 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 
Hi All,
 
Suppose I have a store proc which = accepts 4 input=20 parameters
and I do a CallableStatement.setObject( = 1, "..,,,"=20 );
and execute the query .
 
 
 CallableStatement = functionCall =3D=20 dbCon_.prepareCall("{call test1( ?,?,?,?)=20 }");  
  functionCall.setObject( = "param1","A10001"=20 );
  functionCall.setObject( "param2","19830529"=20 );
  functionCall.execute();
Exception raised
 
java.sql.SQLException: No value = specified for=20 parameter 3
        at=20 com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:12= 53)
       =20 at=20 com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:12= 01)
       =20 at=20 com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:710)
&= nbsp;      =20 at=20 com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:520)
<= /FONT> 
 
during runtime. Should i set the=20 other 2 input parameters to null,
even when I dont want to pass these = parameters to=20 the SP.
In = this statement call=20 test1( ?,?,?,?), should the number of parameters be the number=20
of parameters which the store procedure = accepts or=20 the number of parameters that i want
to pass.  How should this be done = when my SP=20 accepts 4 parameters and i want to pass
only any two of them
 
Thks
 
PS: Looking for an early = reply
 
 
 
 
 
------=_NextPart_000_0056_01C5E48E.7C275A90--