Re: to get output parameter from the stored procedure



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)
.



Relevant Pages

  • Re: another docs problem - imp
    ... > The first sentence says that the _path_ argument is a search path. ... Correct it does not say it's a string. ... > technical documentation a bit more carefully. ... Yes, read it a second time, didn't see the alternate interpretation. ...
    (comp.lang.python)
  • Re: Reading a line of text from a stream
    ... * Reads a line of text from a stream and returns the string on * ... If maxRead is NULL then SIZE_MAX-1 is * considered ... You've accidentally left out documentation that if maxRead is not NULL, ... It is not possible to distinguish between I/O failures and allocation ...
    (comp.lang.c)
  • Re: empty vs null
    ... The documentation you refer to is for the System.String type, ... though they moved to being immutable reference types. ... to Vb.NET, suddenly we could actually compare string references, and at the same ... > references compare equal to each other. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Reading a line of text from a stream
    ... Reads a line of text from a stream and returns the string on ... If maxRead is NULL then SIZE_MAX-1 is ... The documentation above is also a bit hard to read; ... You've also neglected to explicitly specify that the terminating "\n" ...
    (comp.lang.c)
  • Re: Help with double arithmetic
    ... The call to printwill convert the double to String using: ... The documentation on String.valueOfindicates it is the same as: ... rather than letting println() convert ... DecimalFormat documentation if you want to format it differently. ...
    (comp.lang.java.programmer)