Title: SOLVED: retrieve esql return code or output paramter

Thanks to all who offered help!!

I figured this one out, and the problem was due to my own lack of knowledge about jdbc and stored procedures in general.  But thought I'd write up the answer just in case anyone else makes the same mistake.

Apparently, you can execute your stored procedure without registering an output parameter, but if you want to use that output parameter you have to register it with <esql:parameter direction="out" type="appropriate_type"/>.

Cocoon 2.0.2
Tomcat 4.0.1
JDK 1.3
Sybase Database

There were no errors/other info in the logs, but upon adding an <esql:error-results>.. block to my logicsheet, I saw the SQL exception JZ0SB Parameter index out of range: 0

The solution was to call the stored procedure differently using:

<esql:execute-query>
        <!-- Call sproc to launch cold/reverse finger search -->
        <esql:call>
        {<esql:parameter direction="out" type="Int"/> = call LaunchSearches(
                        <esql:parameter direction="in" type="String"><xsp-request:get-parameter name="xlpin"/></esql:parameter>,

                        <xsp-request:get-parameter name="search_type"/>)}
       </esql:call>
        <esql:call-results>
                <output><esql:get-int column="1" from-call="yes"/></output>
        </esql:call-results>                           
       
        <esql:error-results>
                <esql:get-message/><br/>
                <esql:get-stacktrace/>
        </esql:error-results>                  

</esql:execute-query>


-----Original Message-----
From: Christian Haul [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 26, 2002 12:12 PM
To: [EMAIL PROTECTED]
Subject: Re: retrieve esql return code or output paramter


On 26.Jun.2002 -- 09:51 AM, Naquin, Beth wrote:
> Thanks for the suggestion, but I am still having problems.

OK, I need more info to investigate further:

a) which version of Cocoon do you use
b) sitemap.log / error.log / core.log for this page
   (look for error messages / stacktraces)
c) complete <esql:connection> snippet
d) complete java source generated from that snippet
e) sample java code that works with this procedure

        Chris.

--
C h r i s t i a n       H a u l
[EMAIL PROTECTED]
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to