Hello Christian,
�������, 1 ������� 2002 �., you wrote:
CH> Please see your MS docs whether your call will return a ResultSet
CH> or not. The syntax depends on that, see Apache Cocoon docs for
CH> details.
CH> In addition, return parameters from CallableStatements are never
CH> named. They are *only* accessible by number.
CH> Chris.
CH> Please follow up summarizing your problem and which suggested solution
CH> / information worked for you when you consider your problem
CH> solved. Add "SUMMARY: " to the subject line. This will make FAQ
CH> generation and searching the list easier. In addition, it makes
CH> helping you more fun. Thank you.
Thanks for you reply.
I changed code in compliance with MS docs and JDBC driver syntax and
now script fails with error:
org.apache.cocoon.ProcessingException: Exception in ServerPagesGenerator.generate():
java.lang.RuntimeException: Error getting clob data: ResultSet is closed
the code snipped is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:esql="http://apache.org/cocoon/SQL/v2">
<page>
<title>dbTest</title>
<content>
<esql:connection>
<esql:pool>sqlserver</esql:pool>
<esql:execute-query>
<esql:call needs-query="true">{call
Rp_OperDocs(<esql:parameter direction="in"
type="Int"><xsp:expr>37521</xsp:expr></esql:parameter>)}</esql:call>
<esql:call-results>
<esql:row-results>
<para><esql:get-string
column="1"/></para>
</esql:row-results>
</esql:call-results>
<esql:no-results>
<para>No results</para>
</esql:no-results>
<esql:error-results>
<esql:get-message/><br/>
</esql:error-results>
</esql:execute-query>
</esql:connection>
</content>
</page>
</xsp:page>
The stored procedure is:
CREATE PROCEDURE Rp_OperDocs @DayDate int
AS
CREATE TABLE #OperDocs(
Kind INT,
FileNo INT,
CurrencyTag CHAR(4) ,
Code CHAR(32),
SourceCode CHAR(32),
TargetCode CHAR(32),
DebitCode CHAR(32),
CreditCode CHAR(32),
Amount MONEY ,
UserId INT ,
Invert TINYINT NULL
)
INSERT INTO #OperDocs (
Kind,
FileNo,
CurrencyTag,
Code,
SourceCode,
TargetCode,
DebitCode,
CreditCode,
Amount,
UserId,
Invert
) EXEC Rp_DayDocs @DayDate, 0
INSERT INTO #OperDocs (
Kind,
FileNo,
CurrencyTag,
Code,
SourceCode,
TargetCode,
DebitCode,
CreditCode,
Amount,
UserId,
Invert
) EXEC Rp_DayDocs @DayDate, 1
SELECT Kind, SUM(Amount) AS 'RepAmount' FROM #OperDocs GROUP BY Kind
DROP TABLE #OperDocs
in generated test_xsp.java I found this lines:
do {
if (_esql_query.hasResultSet()) {
_esql_query.getResultRows();
if (_esql_query.nextRow()) {
switch (_esql_query.getResultCount()) {
}
} else {
switch (_esql_query.getUpdateCountCount()) {
case 1:
default:
this.characters("\n\t\t\t\t\t\t\t");
this.contentHandler.startElement(
"",
"para",
"para",
xspAttr
);
xspAttr.clear();
this.characters("No results");
this.contentHandler.endElement(
"",
"para",
"para"
);
this.characters("\n\t\t\t\t\t\t");
break;
}
}
_esql_query.getResultSet().close(); // it seems that ResultSet
// is closed there
} else {
if (_esql_query.getUpdateCount() > 0) {
switch (_esql_query.getUpdateCountCount()) {
}
} else {
switch (_esql_query.getUpdateCountCount()) {
case 1:
default:
this.characters("\n\t\t\t\t\t\t\t");
this.contentHandler.startElement(
"",
"para",
"para",
xspAttr
);
xspAttr.clear();
this.characters("No results");
this.contentHandler.endElement(
"",
"para",
"para"
);
this.characters("\n\t\t\t\t\t\t");
break;
}
}
}
} while(_esql_connection.multipleResults() && _esql_query.getMoreResults());
// call results
// call results2
this.characters("\n\t\t\t\t\t\t\t");
this.contentHandler.startElement("http://apache.org/cocoon/SQL/v2",
"row-results",
"esql:row-results",
xspAttr
);
xspAttr.clear();
this.characters("\n\t\t\t\t\t\t\t\t");
this.contentHandler.startElement(
"",
"para",
"para",
xspAttr
);
xspAttr.clear();
XSPObjectHelper.xspExpr(contentHandler,
EsqlHelper.getAscii(_esql_query.getResultSet(),1) // ResultSet
// already
// closed
);
Why? Where my mistake? Please help.
Best regards,
fcbc mailto:[EMAIL PROTECTED]
---------------------------------------------------------------------
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]>