Re: retrieve esql return code or output paramter

2002-06-26 Thread Christian Haul

On 25.Jun.2002 -- 03:08 PM, Naquin, Beth wrote:
 Hello,
 
 This is probably obvious, but I just haven't been able to figure it out.
 
 I have a stored procedure that returns a return code, but not a resultset.
 The return codes are 0-4 and each mean something specific.
 When I execute the stored procedure, I need to be able to retrieve the
 return code and use it in my xsl stylesheet.
 
 I can't figure out what to put inside esql:call-results to retrieve this
 return code.

Try esql:get-int column=1 from-call=yes/

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]




RE: retrieve esql return code or output paramter

2002-06-26 Thread Naquin, Beth
Title: RE: retrieve esql return code or output paramter





Thanks for the suggestion, but I am still having problems.


I tried:


esql:execute-query
!-- Call sproc to launch cold/reverse finger search --
 esql:call
  {call LaunchSearches(
 esql:parameter direction=in type=Stringxsp-request:get-parameter name=xlpin//esql:parameter,2)}
 /esql:call
 
 esql:call-results
  outputhello!/output
  outputjesql:get-int column=1 from-call=yes/s/output
  outputHello2!/output
 /esql:call-results 



/esql:execute-query



But I end up with:


outputhello!/output
outputj


 
  /output
- 



when I expected:


outputhello!/output
outputj2s/output
outputHello2!/output
--


Not only do I not see the 0-4 return code, but everything after the esql:get-int ...line is 'gone.' I have also tried esql:get-string and have tried other column numbers column=2, column=0, but the results are the same.

Any ideas or suggestions would be appreciated.


Thanks,
Beth


-Original Message-
From: Christian Haul [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 25, 2002 11:48 PM
To: [EMAIL PROTECTED]
Subject: Re: retrieve esql return code or output paramter



On 25.Jun.2002 -- 03:08 PM, Naquin, Beth wrote:
 Hello,
 
 This is probably obvious, but I just haven't been able to figure it out.
 
 I have a stored procedure that returns a return code, but not a resultset.
 The return codes are 0-4 and each mean something specific.
 When I execute the stored procedure, I need to be able to retrieve the
 return code and use it in my xsl stylesheet.
 
 I can't figure out what to put inside esql:call-results to retrieve this
 return code.


Try esql:get-int column=1 from-call=yes/


 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]





SOLVED: retrieve esql return code or output paramter

2002-06-26 Thread Naquin, Beth
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=Stringxsp-request:get-parameter name=xlpin//esql:parameter,

  xsp-request:get-parameter name=search_type/)}
 /esql:call
 esql:call-results
  outputesql: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]





retrieve esql return code or output paramter

2002-06-25 Thread Naquin, Beth
Title: retrieve esql return code or output paramter





Hello,


This is probably obvious, but I just haven't been able to figure it out.


I have a stored procedure that returns a return code, but not a resultset. The return codes are 0-4 and each mean something specific.

When I execute the stored procedure, I need to be able to retrieve the return code and use it in my xsl stylesheet.


I can't figure out what to put inside esql:call-results to retrieve this return code.


I have this code:


xsl:template match=db_query:launch_search_xlpin
 esql:execute-query
 !-- Call sproc to launch cold/reverse finger search --
 esql:call
  {call LaunchSearches(
  esql:parameter direction=in type=Stringxsp-request:get-parameter name=xlpin//esql:parameter,

  2)}
 /esql:call
 esql:call-results


  launch_searches_xlpin
  
    how to access the return code
  /launch_searches_xlpin
  
 /esql:call-results


 /esql:execute-query
/xsl:template


The procedure is executing correctly, but I can't seem to get the return code. Any help/suggestions would be appreciated. Is there something to use beside esql:call-results??

thanks,



Beth Naquin
SAGEM MORPHO Inc.
1145 Broadway Plaza STE 200
Tacoma, WA 98402


253-597-8245