Re: Invalid parameter binding

From: Earl Hokens (earl.hokensREMOVETHIS_at_chi.frb.org)
Date: 11/16/04


Date: Tue, 16 Nov 2004 09:10:23 -0600
To: Bjorn Abelli <bjorn_abelli@hotmail.com>

Thanks Bjorn, that did the trick. Thanks for the extra set of eyes.

I'm still a bit puzzled though, I know this code was working before as
it successfully made it through test and QA and it wouldn't have made it
  without being able to insert records. So, something must've changed
either in the DB, appserver, or driver. All the proper admins tell me
nothing's changed. I'll chalk this one up to one of the great mysteries
of computer development.

I had also tried ? = proc_name(?, ?, ?, ?, ?) and proc_name(?, ?, ?, ?,
?, ?) as you suggested but they originally didn't work. When you posted
your solution I looked a little closer and noticed the {} and that did
the trick. Interesting.

Thanks again.

Bjorn Abelli wrote:
> "Earl Hokens" wrote...
>
>
>>I am having a problem with calling a stored procedure.
>
>
>>CREATE PROCEDURE dbo.updateDistrictFiles
>>@brochureId int,
>>@districtId int,
>>@contactTypeId int,
>>@fileDesc varchar(50),
>>@filePath varchar(100),
>>@brochureIdOut int OUTPUT
>>....
>
>
> Looks like SQL Server?
>
> I'm not quite familiar with the creation of stored procedures in SQL Server,
> but I can count to 6 arguments.
>
>
>
>>The java code invoking the SP is as follows:
>>
>> CallableStatement c = connection.
>>prepareCall("? = call updateDistrictFiles(?, ?, ?, ?, ?, ?)";
>
>
> ...but here I find 7 question marks...
>
> Even the first one counts, so my guess is you could just try to change it
> to:
>
> CallableStatement c =
> connection.prepareCall
> ("{call updateDistrictFiles(?, ?, ?, ?, ?, ?)}";
>
>
> // Bjorn A
>
>



Relevant Pages

  • Re: Invalid parameter binding
    ... Thanks Bjorn, that did the trick. ... >>I am having a problem with calling a stored procedure. ... >>@brochureId int, ...
    (comp.lang.java.databases)
  • Programming SSIS
    ... Exporting Stored Procedure Results w/ SSIS? ... display_row int, ...
    (microsoft.public.sqlserver.programming)
  • Re: Intercepting invalid parameters to a stored procedure
    ... cuts up the query string into pieces and barks if the input ... idiot-proof stored procedure. ... @OrderNumber int output ... SET @OrderNumber = @@IDENTITY ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Ignore SQL Server 2000 store proc errors and still get results?
    ... is occurring in ADO.NET when I try to execute that stored procedure. ... > The problem is in the way you are handling errors in your sproc code. ... > DECLARE @Rows int ... >> BEGIN SETUP TEST - run this script in Query Analyzer ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Ignore SQL Server 2000 store proc errors and still get results?
    ... DECLARE @Rows int ... > BEGIN SETUP TEST - run this script in Query Analyzer ... Create the console app ... >> temp table in your stored procedure to handle the collection of valid ...
    (microsoft.public.dotnet.framework.adonet)