Re: Invalid parameter binding
From: Earl Hokens (earl.hokensREMOVETHIS_at_chi.frb.org)
Date: 11/16/04
- Next message: Greg Smith: "Re: I need a hint"
- Previous message: witichis: "ojb setup-db problem with current ojb-blank.jar"
- In reply to: Bjorn Abelli: "Re: Invalid parameter binding"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
>
>
- Next message: Greg Smith: "Re: I need a hint"
- Previous message: witichis: "ojb setup-db problem with current ojb-blank.jar"
- In reply to: Bjorn Abelli: "Re: Invalid parameter binding"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|