Re: getting Multiple resultsets in java using stored procedure in MS SQL Server 2000
- From: "anil" <anilraghavan@xxxxxxxxx>
- Date: 4 Mar 2006 01:43:46 -0800
Hi Joe and Subhash, thank you for your replies.
I am using a comma seperated value string as the parameter viz
'aaa','bbb','ccc'
variable defined in sp is varchar(4000).
the query used in the procedure is a select statement with an IN clause
eg. select field_name from table where field_name IN (<csv string>)
just executing the query with a csv string as parameter works fine, but
the procedure fails.
I found out that if the parameter is a single string 'aaa', i'm getting
the resultset with records, but if its a csv string, its returning an
empty resultset.
I tried printing out the input variable in the sp and it looks
fine...it prints viz 'aaa','bbb','ccc'
did any of you came across this problem, any pointers would help.
Thank you.
-Anil
Joe Weinstein wrote:
anil wrote:
I have a stored procedure with multiple (two) queries in MS-SQL 2000
Server,
I'm trying to get the resultset in java
like
cStmt = conn.prepareCall("{ call spXXX (?)}");
cStmt.setString(1, val);
What is the variable defined as in the procedure?
What is the column type that the variable is
used to compare to? I suspect you're trying to rely
on the DBMS doing implicit conversion, which it will
do for fresh SQL, but not parameters.
Joe Weinstein at BEA Systems.
.
- Follow-Ups:
- References:
- Prev by Date: Re: getting Multiple resultsets in java using stored procedure in MS SQL Server 2000
- Next by Date: Re: getting Multiple resultsets in java using stored procedure in MS SQL Server 2000
- Previous by thread: Re: getting Multiple resultsets in java using stored procedure in MS SQL Server 2000
- Next by thread: Re: getting Multiple resultsets in java using stored procedure in MS SQL Server 2000
- Index(es):
Relevant Pages
|