File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Inserting table Record using iBator generated code , sqlerror code -440 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Inserting table Record using iBator generated code , sqlerror code -440" Watch "Inserting table Record using iBator generated code , sqlerror code -440" New topic
Author

Inserting table Record using iBator generated code , sqlerror code -440

asmee or ask me
Greenhorn

Joined: Dec 19, 2008
Posts: 1
Hi,

I am using WAS 6.0 to deploy my application. Using iBatis for DB interfacing.
The query generated by iBator looks like:

--------------------------------------------------------------------
<insert id="abatorgenerated_insert" parameterClass="com.avivacanada.ecomm.service.buyautoservice.domain.ActualDriverConviction" >
<!--
WARNING - This element is automatically generated by Abator for iBATIS, do not modify.
This element was generated on Thu Dec 18 13:35:32 EST 2008.
-->
insert into TACTL_DRV_CNVC (CNVC_DATE, DRIVER_ID, CONVICTION_TYP_ID, UPDATED_DATE,
CNVC_SEVERITY_TYP_ID, MOTOR_VEH_RPT_ID, UPDATED_BY, CREATED_DATE, CREATED_BY)
values (#cnvcDateATE#, #driverId:BIGINT#, #convictionTypId:CHAR#, #updatedDate:TIMESTAMP#,
#cnvcSeverityTypId:CHAR#, #motorVehRptId:VARCHAR#, #updatedBy:VARCHAR#,
#createdDate:TIMESTAMP#, #createdBy:VARCHAR#)
<selectKey resultClass="java.lang.Long" keyProperty="actlDrvCnvcId" >
VALUES IDENTITY_VAL_LOCAL()
</selectKey>
</insert>

--------------------------------------------------------------------

while triggering it my record gets inserted , since Autocommit is on, but throws exeption saying :
--------------------------------------------------------------------
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/avivacanada/ecomm/service/buyautoservice/dao/sql/TACTL_DRV_CNVC_SqlMap.xml.
--- The error occurred while applying a parameter map.
--- Check the TACTL_DRV_CNVC.abatorgenerated_insert-SelectKey-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -440, SQLSTATE: 42884, SQLERRMC: IDENTITY_VAL_LOCAL;FUNCTION
--------------------------------------------------------------------

Anybody has any clue where's the problem? Would really appreciate for your time in giving some pointers here.

I checked DB privileges on table, but no clue where it picks up the function IDENTITY_VAL_LOCAL() from.
IDENTITY_VAL_LOCAL() function is not there in DB.
[ December 19, 2008: Message edited by: asmee or ask me ]

Cheers!!<br /> <br />ASmee
Paul Campbell
Ranch Hand

Joined: Oct 06, 2007
Posts: 338
Originally posted by asmee or ask me:
--------------------------------------------------------------------
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/avivacanada/ecomm/service/buyautoservice/dao/sql/TACTL_DRV_CNVC_SqlMap.xml.
--- The error occurred while applying a parameter map.
--- Check the TACTL_DRV_CNVC.abatorgenerated_insert-SelectKey-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: com.ibm.db2.jcc.c.SqlException: DB2 SQL error: SQLCODE: -440, SQLSTATE: 42884, SQLERRMC: IDENTITY_VAL_LOCAL;FUNCTION
--------------------------------------------------------------------

Anybody has any clue where's the problem? Would really appreciate for your time in giving some pointers here.

I checked DB privileges on table, but no clue where it picks up the function IDENTITY_VAL_LOCAL() from.


SQLSTATE: 42884 = No routine was found with the specified name and compatible arguments.

I don't believe IDENTITY_VAL_LOCAL() exists.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32599
    
    4
"Asmee" or whatever, please read the important administrative private message I just sent you.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Inserting table Record using iBator generated code , sqlerror code -440
 
Similar Threads
BLOB, iBatis & PostgreSql 8.1
After insert statement, how do I get column value populated by DB trigger
Issue with inserting a BLOB using IBatis DAO
iBator problem
Problem with iBATIS + MySQL + auto increment keys