logo       


RE: Error processing Null during Insert statement - Help: msg#00453

Subject: RE: Error processing Null during Insert statement - Help
This works, but doesn't makes sense why since my column is a NUMBER data type.

Does JDBC-ODBC driver be the problem on Oracle 9i?

-----Original Message-----
From: Henry Lu [mailto:zhlu@xxxxxxxxx]
Sent: Thursday, May 26, 2005 1:30 PM
To: ibatis-user-java@xxxxxxxxxxxxxxxxxxxx
Subject: Re: Error processing Null during Insert statement - Help


Change NUMBER to varchar will take care the business.

<parameterMap id="paramMap" class="ca.cihi.omhrs.Dummy" >
   <parameter property="id"  jdbcType="VARCHAR" nullValue="-999" />
   <parameter property="name" jdbcType="VARCHAR" nullValue="NO_ENTRY" />
</parameterMap>

-Henry

Jason Hall wrote:

>All the columns in table dummy are nullable in Oracle
>
>-----Original Message-----
>From: Daniel Henrique Ferreira e Silva [mailto:dhsilva@xxxxxxxxx]
>Sent: Thursday, May 26, 2005 1:22 PM
>To: ibatis-user-java@xxxxxxxxxxxxxxxxxxxx
>Subject: Re: Error processing Null during Insert statement - Help
>
>
>Hi Jason,
>
>Looking at the stack trace you posted, it's clear that the error
>you're getting comes from your DB.
>Look at your table Dummy structure. Does it allow the column id to be null?
>Also, what is your DB?
>
>Hope that helped.
>
>Cheers,
>Daniel Silva.
>
>
>On 5/26/05, Jason Hall <JHall@xxxxxxx> wrote:
>  
>
>> 
>>
>>Hi, 
>>
>>I'm trying to force a null in a nullable column and i get an error. 
>>
>>Java code: 
>>Dummy d = new Dummy(); 
>>d.setId(-999); 
>>sqlMap.insert("Dummy.insertDummy",d); 
>> 
>> 
>>
>>Sql Map: 
>><?xml version="1.0" encoding="UTF-8" standalone="no"?> 
>><!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
>>"http://www.ibatis.com/dtd/sql-map-2.dtd";> 
>>
>><sqlMap namespace="Dummy"> 
>>
>><parameterMap id="paramMap" class="ca.cihi.omhrs.Dummy" > 
>>  <parameter property="id"  jdbcType="NUMBER" nullValue="-999" /> 
>>  <parameter property="name" jdbcType="VARCHAR" nullValue="NO_ENTRY" /> 
>></parameterMap> 
>>
>><insert id="insertDummy" parameterMap="paramMap"> 
>>
>>insert into Dummy(id,name) 
>>values(?,?) 
>></insert> 
>>
>><!-- 
>><insert id="insertDummy" parameterClass="ca.cihi.omhrs.Dummy"> 
>>
>>insert into Dummy(id,name) 
>>values(#id:NUMERIC:#,#name:VARCHAR:NO_ENTRY#) 
>></insert> 
>>--> 
>>
>></sqlMap> 
>>  
>> 
>> 
>> 
>>
>>I get the following error: 
>>
>>com.ibatis.common.jdbc.exception.NestedSQLException:   
>>--- The error occurred in
>>ca/cihi/omhrs/persistence/datamap/Dummy.xml.  
>>--- The error occurred while applying a parameter map.  
>>--- Check the Dummy.paramMap.  
>>--- Check the parameter mapping for the 'id' property.  
>>--- Cause: java.sql.SQLException: General error 
>>Caused by: java.sql.SQLException: General error 
>>        at
>>com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:87)
>>        at
>>com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:442)
>>        at
>>com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:85)
>>        at
>>com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:57)
>>        at ca.cihi.omhrs.TestIbatis.main(TestIbatis.java:121) 
>>
>>Caused by: 
>>java.sql.SQLException: General error 
>>        at
>>sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6060)
>>        at
>>sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:6188) 
>>        at
>>sun.jdbc.odbc.JdbcOdbc.SQLBindInParameterNull(JdbcOdbc.java:922)
>>        at
>>sun.jdbc.odbc.JdbcOdbcPreparedStatement.setNull(JdbcOdbcPreparedStatement.java:359)
>>        at
>>com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameter(BasicParameterMap.java:173)
>>        at
>>com.ibatis.sqlmap.engine.mapping.parameter.BasicParameterMap.setParameters(BasicParameterMap.java:125)
>>        at
>>com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:80)
>>        at
>>com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteUpdate(GeneralStatement.java:196)
>>        at
>>com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeUpdate(GeneralStatement.java:74)
>>        at
>>com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:442)
>>        at
>>com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:85)
>>        at
>>com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:57)
>>        at ca.cihi.omhrs.TestIbatis.main(TestIbatis.java:121)
>>    
>>
>
>
>  
>



Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosting, windows, cisco ...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe