DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10596>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10596

Database Tutorial generates SQL error when using Sybase Database

           Summary: Database Tutorial generates SQL error when using Sybase
                    Database
           Product: Cocoon 2
           Version: 2.0.3
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: general components
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]
                CC: [EMAIL PROTECTED]


System Parameters:
RedHat 7.2, Tomcat 4.02, Cocoon 2.0.3,Sun JDK 1.4.0, Sybase 11.9.2 database

While trying to use the database turorial, I found that when I tried to edit an
employee or a department I got the following error:
**********************************************************************************
org.apache.cocoon.ProcessingException: Exception in
ServerPagesGenerator.generate(): java.lang.RuntimeException: Error executing
statement: SELECT name, department_id FROM employee WHERE id = ? :
com.sybase.jdbc2.jdbc.SybSQLException: Implicit conversion from datatype 'CHAR'
to 'INT' is not allowed. Use the CONVERT function to run this query.
**********************************************************************************
This patch will change the necessary entries so it works properly:
**********************************************************************************
diff -Naur tutorial/docs/edit-dept.xsp tutorial/docs.sybase/edit-dept.xsp
--- tutorial/docs/edit-dept.xsp  Tue Jul  9 09:50:57 2002
+++ tutorial/docs.sybase/edit-dept.xsp Tue Jul  9 09:47:56 2002
@@ -24,7 +24,7 @@
             <esql:execute-query>
               <esql:query>
                 SELECT name FROM department
-                WHERE id = <esql:parameter><xsp-request:get-parameter
name="id"/></esql:parameter>
+               WHERE id = <esql:parameter
type="int"><xsp:expr>Integer.parseInt(<xsp-request:get-parameter name="id"
default="0"/>)</xsp:expr></esql:parameter>
               </esql:query>
               <esql:results>
                 <esql:row-results>
diff -Naur tutorial/docs/edit-empl.xsp tutorial/docs.sybase/edit-empl.xsp
--- tutorial/docs/edit-empl.xsp  Tue Jul  9 09:50:57 2002
+++ tutorial/docs.sybase/edit-empl.xsp Tue Jul  9 09:54:39 2002
@@ -23,7 +23,7 @@
           <esql:execute-query>
             <esql:query>
               SELECT name, department_id FROM employee 
-              WHERE id = <esql:parameter><xsp-request:get-parameter
name="id"/></esql:parameter>
+             WHERE id = <esql:parameter
type="int"><xsp:expr>Integer.parseInt(<xsp-request:get-parameter name="id"
default="0"/>)</xsp:expr></esql:parameter>
             </esql:query>               
             <esql:results>                               
               <esql:row-results>  
**********************************************************************************

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

Reply via email to