Re: to get output parameter from the stored procedure
- From: Juha Laiho <Juha.Laiho@xxxxxx>
- Date: Thu, 9 Feb 2006 21:38:01 +0000 (UTC)
sent1729@xxxxxxxxx said:
Yes, I did try ,
CallableStatement s = c.prepareCall("{call spGetGrid(?,?)}");
s.setString(1,"PRJ-001-A");
s.setClob(2, null);
s.registerOutParameter(2, java.sql.Types.CLOB);
ResultSet r = s.executeQuery();
Ok, step slightly back. If the string to be passed in is truly
a constant, then by all means provide it within the SQL. Only bind
things that are prone to change.
Then, if the second parameter is just for output, don't set it
to any value. Just register it as an output parameter with
a suitable type.
but now im getting the error message:
Implicit conversion from data type xml to nvarchar(max) is not allowed.
use convert function to run this query.
Based on MS documentation (see
http://msdn2.microsoft.com/en-us/library/ms378813.aspx), the
bind type should be LONGVARCHAR. You should be able to get
the value then as a Java String.
getting xml out of a database in the MS documentation - see:
I am not sure what has to be done to convert this output type (xml) to
clob.
I hope you find relevant info frmo the MS pages; they took a while
to find, but should contain the info you're looking for.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
.
- Follow-Ups:
- Re: to get output parameter from the stored procedure
- From: sent1729
- Re: to get output parameter from the stored procedure
- References:
- to get output parameter from the stored procedure
- From: sent1729
- Re: to get output parameter from the stored procedure
- From: Juha Laiho
- Re: to get output parameter from the stored procedure
- From: sent1729
- to get output parameter from the stored procedure
- Prev by Date: Re: Need help regarding JDBC
- Next by Date: Re: Please Help - Java, Database oracle or sybase
- Previous by thread: Re: to get output parameter from the stored procedure
- Next by thread: Re: to get output parameter from the stored procedure
- Index(es):
Relevant Pages
|
|