How do you deal with return statements in SQL? I have stor procs that return
as well as select to allow for better error reporting. I thought that this
would allow me to check the return value, but it does not.

Stor proc:

select 1
return 1

CallableStatement cs = con.prepareCall("{? = call P_dindin}"); //Also tried
{call P_dindin(?)} as some code suggests

cs.registerOutParameter(1, java.sql.Types.INTEGER);

ResultSet rs = cs.exececuteQuery()

int n = cs.getInt(1);

if (n == 1) {
while (rs.next()) {
                        str = str + rs.getInt(1);
                        System.out.println(rs.getString(1));
}
}

n is always 0, or whatever the null value is for the data type that I am
returning (I've tried returning a string as well).
Please could you help with this?
Thank you very much
Jimmi Dyson

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to