My mistake, SQL SELECT incorrect. -----Original Message----- From: Warren Bell [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 7:09 AM To: user-java@ibatis.apache.org; [EMAIL PROTECTED] Subject: RE: preparation failed "UndeclaredThrowableException"
Yes, item is a type alias. I run this SELECT in a db client, and it works fine. I am running this on Sybase, using an ODBC driver on Windows. I have not had any luck using Sybase's JDBC driver. I know that ODBC drivers can be a problem, and I am wondering if that may be the cause. Here is the Ibatis exception info: com.ibatis.dao.client.DaoException: Error executing query for object. Cause: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/clarks/spanky/persistence/sqlmapdao/sql/sybase/item-sybase.xml. --- The error occurred while executing query. --- Check the SELECT count(1) as value FROM ecrs_v_InventoryMaster, ecrs_TaxMain, ecrs_StockInventoryLinkTax WHERE ecrs_v_InventoryMaster.INV_PK = ecrs_StockInventoryLinkTax.ILT_INV_FK AND ecrs_v_InventoryMaster.INV_CPK = ecrs_StockInventoryLinkTax.ILT_INV_CFK AND ecrs_StockInventoryLinkTax.ILT_TAX_FK = ecrs_TaxMain.TAX_PK AND ecrs_v_InventoryMaster.INV_ScanCode = ? . --- Check the SQL Statement (preparation failed). --- Cause: java.lang.reflect.UndeclaredThrowableException Caused by: java.lang.reflect.UndeclaredThrowableException Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in com/clarks/spanky/persistence/sqlmapdao/sql/sybase/item-sybase.xml. --- The error occurred while executing query. --- Check the SELECT count(1) as value FROM ecrs_v_InventoryMaster, ecrs_TaxMain, ecrs_StockInventoryLinkTax WHERE ecrs_v_InventoryMaster.INV_PK = ecrs_StockInventoryLinkTax.ILT_INV_FK AND ecrs_v_InventoryMaster.INV_CPK = ecrs_StockInventoryLinkTax.ILT_INV_CFK AND ecrs_StockInventoryLinkTax.ILT_TAX_FK = ecrs_TaxMain.TAX_PK AND ecrs_v_InventoryMaster.INV_ScanCode = ? . --- Check the SQL Statement (preparation failed). --- Cause: java.lang.reflect.UndeclaredThrowableException Caused by: java.lang.reflect.UndeclaredThrowableException ########## -----Original Message----- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Thursday, August 18, 2005 5:12 AM To: user-java@ibatis.apache.org Subject: Re: preparation failed "UndeclaredThrowableException" We need more info...can you give us a stack trace? Is "item" a type alias? Larry On 8/17/05, Warren Bell <[EMAIL PROTECTED]> wrote: > I am getting a preparation falied "UndeclaredThrowableException" when I > call: > > return (Integer) executeQueryForObject("getTaxable", item); > > The SQL Map is: > > <select id="getTaxable" parameterClass="item" > resultClass="java.lang.Integer"> > SELECT count(1) as value FROM ecrs_v_InventoryMaster, ecrs_TaxMain, > ecrs_StockInventoryLinkTax WHERE ecrs_v_InventoryMaster.INV_PK = > ecrs_StockInventoryLinkTax.ILT_INV_FK AND ecrs_v_InventoryMaster.INV_CPK = > ecrs_StockInventoryLinkTax.ILT_INV_CFK AND > ecrs_StockInventoryLinkTax.ILT_TAX_FK = ecrs_TaxMain.TAX_PK AND > ecrs_v_InventoryMaster.INV_ScanCode = #upc:CHAR# > </select> > > What am I doing wrong? > > Thanks, > > Warren Bell > > >