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 99219D8B20 for ; Tue, 8 Nov 2005 23:44:28 -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 40292-02 for ; Wed, 9 Nov 2005 03:44:22 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.dmz.newbreak.com (mail.newbreak.com [206.65.185.78]) by svr1.postgresql.org (Postfix) with ESMTP id E9C48D8A37 for ; Tue, 8 Nov 2005 23:44:24 -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 jA93iOCP028269 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 8 Nov 2005 22:44:27 -0500 Received: from NBINDIAXP0133 ([10.1.30.133]) by sysadminbox.dev02.newbreak.com (8.12.11/8.12.11) with SMTP id jA93iJ5L002015 for ; Wed, 9 Nov 2005 09:14:19 +0530 Message-ID: <010501c5e4df$dd1f67b0$851e010a@NBINDIAXP0133> From: "Srivats" To: References: <005901c5e460$6273d980$851e010a@NBINDIAXP0133> <08F64608-CC33-4347-8CC4-31C0D3A469DF@fastcrypt.com> Subject: Re: passing parameters to function Date: Wed, 9 Nov 2005 09:14:18 +0530 Organization: NewBreak MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0102_01C5E50D.F6BD64F0" 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/66 X-Sequence-Number: 14164 This is a multi-part message in MIME format. ------=_NextPart_000_0102_01C5E50D.F6BD64F0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi All,=20 Is there anyway i can get the list of parameters which the store proc = accepts from the java end after i make the prepareCall. Thks ----- Original Message -----=20 From: Dave Cramer=20 To: Srivats=20 Cc: pgsql-jdbc@postgresql.org=20 Sent: Tuesday, November 08, 2005 9:21 PM Subject: Re: [JDBC] passing parameters to function=20 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 parameters and I do a CallableStatement.setObject( 1, "..,,," ); and execute the query . 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 of parameters which the store procedure accepts or the number of = parameters that i want 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_0102_01C5E50D.F6BD64F0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi All,
 
Is there anyway i can get the list of = parameters=20 which the store proc accepts from the java end after i make the=20 prepareCall.
 
Thks
 
----- Original Message -----
From:=20 Dave = Cramer=20
To: Srivats
Sent: Tuesday, November 08, = 2005 9:21=20 PM
Subject: Re: [JDBC] passing = parameters to=20 function

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=20 which accepts 4 input parameters
and I do a=20 CallableStatement.setObject( 1, "..,,," );
and execute the query=20 .
 
 
 CallableStatement=20 functionCall =3D dbCon_.prepareCall("{call test1( ?,?,?,?)=20 }");    functionCall.setObject(=20 "param1","A10001" );  functionCall.setObject(=20 "param2","19830529" );  functionCall.execute();
Exception=20 raised
 
java.sql.SQLException: = No value=20 specified for parameter 3       =20 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)       =20 at=20 = com.mysql.jdbc.CallableStatement.execute(CallableStatement.java:520) 
 
during runtime. Should = i set the=20 other 2 input parameters to null,
even when I dont want = to pass=20 these parameters to the SP.
In=20 this statement call test1(=20 ?,?,?,?), should the number of = parameters=20 be the number
of parameters which = the store=20 procedure accepts or the number of parameters that i=20 want
to pass.  How = should this=20 be done when my SP accepts 4 parameters and i want to=20 pass
only any two of=20 them
 
Thks
 
PS: Looking for an = early=20 reply
 
 
 
 
 

------=_NextPart_000_0102_01C5E50D.F6BD64F0--