I've done further tests.
If my esql code is:
<esql:execute-query>
<esql:call>CALL GET_PERSONS(1)</esql:call>
</esql:execute-query>
I get:
org.apache.cocoon.ProcessingException: Exception in
ServerPagesGenerator.generate(): java.lang.RuntimeException: Error executing
statement: CALL GET_PERSONS(1):
com.sap.dbtech.jdbc.exceptions.DatabaseException: [-1015] (at 18): Too many
values
So it seems that the driver recognize I intend to use a callable statement.
However if do:
<esql:execute-query>
<esql:call>CALL GET_PERSONS(1)</esql:call>
</esql:execute-query>
http-0.0.0.0-8080-Processor25/AbstractJdbcConnection: Could not prepare test
statement, connection recycled on basis of time.
com.sap.dbtech.jdbc.exceptions.DatabaseException: [-5015] (at 9): Missing
keyword:FROM
Here, I use the same callable code that works when called directly from java,
it seems the driver doesn't recognize it as a call to a stored procedure.
Any idea?
--- Oscar Picasso <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have trouble with esql when calling a stored procedure in MaxDB (formerly
> SAP
> DB).
>
> I have tried to adapt the examples in the "ESQL Taglib" documentation and
> tried
> many combinations of esql tags and attributes but cannot make it work.
>
> I always get some kind of exception or nothing.
>
> I can connect to database and execute sql statements with esql. I only have
> problems with stored procedures. On the other hand if I execute the call
> statement directly from java it just work fine.
>
> Here is an example of java code that works fine.
>
> ...
> Class.forName ("com.sap.dbtech.jdbc.DriverSapDB");
> String url = "jdbc:sapdb:///ADS";
> Connection con = DriverManager.getConnection(url, "scott", "scott-password");
> CallableStatement p = con.prepareCall("CALL GET_PERSONS");
> ResultSet result = p.executeQuery();
> result.first();
> while(!result.isAfterLast())
> {
> System.out.println(result.getInt("ID") + ", " +
> result.getString("FIRST_NAME") + ", " + result.getString("LAST_NAME"));
> result.next();
> }
> con.close();
> ...
>
> RESULTS:
> 3, John, Smith
> 4, Javier, Perez
>
> The stored procedure doesn't use any parameter (either IN or OUT) and just
> returns a cursor.
>
> Could someone show me how the same procedure call should be done with esql?
>
> Thanks.
>
>
>
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!
> http://promotions.yahoo.com/new_mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]