You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michael Raffenberg <mi...@t-online.de> on 2002/04/12 02:00:57 UTC

ESQL Oracle StoredProcedues

Hi,
   I am using C2.0.1 with JDK1.3.1 and TOmcat 4.0.3
   I have problems with calling oracle stored procedures from ESQL.
   I have this simple Code:
     <esql:execute-query>
       <esql:call>
         {call sp_proc(<esql:parameter direction="inout" type="String">bullshit</esql:parameter>)}
       </esql:call>
       <esql:call-results>
         <esql:results>
           <esql:result>
             <esql:get-string column="1" from-call="true"/></esql:result>
           </esql:results>
         </esql:call-results>
     </esql:execute-query>

     ,followed by this error:
Language Exception

More precisely:

org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling Merci_Dics_xsp:
Line 463, column -1: inconvertible types
Line 0, column 0:

I already searched the mail-archives, but didn't find a right solution.

-- 
Best regards,
 Michael                          mailto:michael.raffenberg@t-online.de



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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: ESQL Oracle StoredProcedues

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 13.Apr.2002 -- 02:25 PM, Michael Raffenberg wrote:
> >org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling Merci_Dics_xsp:
> >Line 470, column -1: inconvertible types
> >Line 0, column 0:
> >1 errorHere is the code:
> 
> Here is Code from Merci_dics_xsü.java
> 464-493
>   // nested result set
>     if (_esql_query != null) {
>       _esql_queries.push(_esql_query);
>     }
>   _esql_query = new EsqlQuery((ResultSet) 
>         
>         (test)
>       );

Any idea where this "(test)" might come from? The resulting code seems
not to by in sync with the example you posted.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    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/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: ESQL Oracle StoredProcedues

Posted by Michael Raffenberg <mi...@t-online.de>.
>org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling Merci_Dics_xsp:
>Line 470, column -1: inconvertible types
>Line 0, column 0:
>1 errorHere is the code:

Here is Code from Merci_dics_xsü.java
464-493
  // nested result set
    if (_esql_query != null) {
      _esql_queries.push(_esql_query);
    }
  _esql_query = new EsqlQuery((ResultSet) 
        
        (test)
      );
    {
      if (_esql_query.hasResultSet()) {
        do {
          _esql_query.getResultRows();

          if (_esql_query.nextRow()) {
            
          } else {
            
          }
          _esql_query.getResultSet().close();

        } while(_esql_query.getMoreResults());
      } else {
        
      }
    }
    if (_esql_queries.empty()) {
      _esql_query = null;
    } else {
      _esql_query = (EsqlQuery)_esql_queries.pop();
    }

Thanks for help.

-- 
Best regards,
 Michael                            mailto:michael.raffenberg@t-online.de



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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: ESQL Oracle StoredProcedues

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 15.Apr.2002 -- 02:17 PM, Michael Raffenberg wrote:
> OK, once again. Here is actual code:
> 
>      <esql:execute-query>
>        <esql:call>{call cocoon_proc(<esql:parameter direction="inout" type="String">'123'</esql:parameter>)}
>        </esql:call>
>        <esql:call-results>
>          <esql:results>
>            <esql:result><esql:get-string column="1" from-call="true"/></esql:result>
>          </esql:results>
>        </esql:call-results>
>      </esql:execute-query>
> 
> returns:
> org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling Merci_Dics_xsp:
> Line 451, column -1: inconvertible types
> Line 0, column 0:
> Here is the Code from merci_dics.xsp (445-470):
> 
>   // nested result set
>     if (_esql_query != null) {
>       _esql_queries.push(_esql_query);
>     }
>   _esql_query = new EsqlQuery((ResultSet) 
>         
>         (_esql_query.getCallableStatement().getString(1)   <-- 451
>     )
>       );

OK, I've been blind (and you've been stupid ;-) 

You try to construct a result set from a string. That is obviously
impossible. So, if you want to use the above syntax *and* your SP does
return a result set object for that parameter, you'd need to
<esql:get-object/> inside <esql:result/>. Please be aware that line
breaks inside <esql:result/> could spoil your party. But then you'd
need to have another <esql:results/> nested inside your
<esql:results/>... 

If your SP does not return a ResultSet for that parameter, use
<esql:call-results/> which are executed regardless of the result
returned by the SP. Use <esql:get-string from-call="yes" column="1"/>
to access it.

If your SP returns exactly one ResultSet through e.g. parameter 1, you
could use <esql:call resultset-from-object="1">{.....}</esql:call> and
save yourself the trouble of constructing a new query result.

Your example code mixes two of these approaches. 

HTH

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    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/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: ESQL Oracle StoredProcedues

Posted by Michael Raffenberg <mi...@t-online.de>.
OK, once again. Here is actual code:

     <esql:execute-query>
       <esql:call>{call cocoon_proc(<esql:parameter direction="inout" type="String">'123'</esql:parameter>)}
       </esql:call>
       <esql:call-results>
         <esql:results>
           <esql:result><esql:get-string column="1" from-call="true"/></esql:result>
         </esql:results>
       </esql:call-results>
     </esql:execute-query>

returns:
org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling Merci_Dics_xsp:
Line 451, column -1: inconvertible types
Line 0, column 0:
Here is the Code from merci_dics.xsp (445-470):

  // nested result set
    if (_esql_query != null) {
      _esql_queries.push(_esql_query);
    }
  _esql_query = new EsqlQuery((ResultSet) 
        
        (_esql_query.getCallableStatement().getString(1)   <-- 451
    )
      );
    {
      if (_esql_query.hasResultSet()) {
        do {
          _esql_query.getResultRows();

          if (_esql_query.nextRow()) {
            
          } else {
            
          }
          _esql_query.getResultSet().close();

        } while(_esql_query.getMoreResults());
      } else {
        
      }
    }
   
The sp_Proc on Oracle_Side is just for testing:
Procedure cocoon_proc (intext in out varchar2)
IS
BEGIN
  intext:='Erzaehl doch keinen '||intext;
END;
-- 
Best regards,
 Michael                            mailto:michael.raffenberg@t-online.de



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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: ESQL Oracle StoredProcedues

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 12.Apr.2002 -- 02:00 AM, Michael Raffenberg wrote:
> Hi,
>    I am using C2.0.1 with JDK1.3.1 and TOmcat 4.0.3
>    I have problems with calling oracle stored procedures from ESQL.
>    I have this simple Code:
>      <esql:execute-query>
>        <esql:call>
>          {call sp_proc(<esql:parameter direction="inout" type="String">bullshit</esql:parameter>)}
>        </esql:call>
>        <esql:call-results>
>          <esql:results>
>            <esql:result>
>              <esql:get-string column="1" from-call="true"/></esql:result>
>            </esql:results>
>          </esql:call-results>
>      </esql:execute-query>
> 
>      ,followed by this error:
> Language Exception
> 
> More precisely:
> 
> org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling Merci_Dics_xsp:
> Line 463, column -1: inconvertible types
> Line 0, column 0:

Could you please show us the code around line 463?
(Merci_Dics_xsp.java)

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    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/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>