Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 16579 invoked from network); 1 Mar 2006 17:44:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Mar 2006 17:44:04 -0000 Received: (qmail 16667 invoked by uid 500); 1 Mar 2006 17:44:50 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 16634 invoked by uid 500); 1 Mar 2006 17:44:49 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 16623 invoked by uid 99); 1 Mar 2006 17:44:49 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Mar 2006 09:44:49 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=RCVD_IN_SORBS_WEB,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of manjula.kutty@gmail.com designates 64.233.184.199 as permitted sender) Received: from [64.233.184.199] (HELO wproxy.gmail.com) (64.233.184.199) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Mar 2006 09:44:48 -0800 Received: by wproxy.gmail.com with SMTP id i24so192854wra for ; Wed, 01 Mar 2006 09:44:28 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=CI2qRavcdziP3S0Pj1turzgs9p3rx8vjOO7LPfM0z83L3thwXkBIiJCULZzCp4NS70UD2hhVvnZDiv4M69SSHY+LztNYVzMd4bQ8ny2EZjWtNeLtH85C6KuHd0+galQL/SBVwAUe6FCVuh48zkwy5htQaGw8as6uAwzYfyYk6A0= Received: by 10.54.102.15 with SMTP id z15mr2313180wrb; Wed, 01 Mar 2006 09:44:27 -0800 (PST) Received: from ?9.72.133.45? ( [129.33.49.251]) by mx.gmail.com with ESMTP id 40sm1148687wrl.2006.03.01.09.44.26; Wed, 01 Mar 2006 09:44:27 -0800 (PST) Message-ID: <4405DD78.60705@gmail.com> Date: Wed, 01 Mar 2006 09:44:24 -0800 From: Manjula G Kutty User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Discussion Subject: Re: SQL Exception References: <20060301052659.17875.qmail@web8412.mail.in.yahoo.com> In-Reply-To: <20060301052659.17875.qmail@web8412.mail.in.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N meenakshi selvi wrote: > hi all, > i have created a table in derby as follow > > create table sp_ss_ex_contact( > email varchar(200) primary key, > first_name varchar(50) not null , > middle_name varchar(50) , > last_name varchar(50) not null , > telephone varchar(20 ) , > address varchar(250) , > state char (1 ) not null , > last_update timestamp not null > ); > > if any of the rows in the columns middle name,telephone and address is > null,i t throws the following exception, > > SQL Exception: An attempt was made to get a data value of type > 'VARCHAR' from a > data value of type 'null'. > at > org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source) > at > org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source) > at > org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source > ) > at > org.apache.derby.impl.jdbc.EmbedConnection.newSQLException(Unknown So > urce) > at > org.apache.derby.impl.jdbc.ConnectionChild.newSQLException(Unknown So > urce) > at > org.apache.derby.impl.jdbc.EmbedPreparedStatement.dataTypeConversion( > Unknown Source) > at > org.apache.derby.impl.jdbc.EmbedPreparedStatement.setObject(Unknown S > ource) > > > please help me. > > ------------------------------------------------------------------------ > Jiyo cricket on Yahoo! India cricket > > Yahoo! Messenger Mobile > > Stay in touch with your buddies all the time. Hi Meenakshi, Did you get the exception through ij or through your application program? I tried with same schema as yours and everything went well. Here is what I did ij> connect 'jdbc:derby:testdb;create=true'; ij> create table sp_ss_ex_contact( email varchar(200) primary key, first_name varchar(50) not null , middle_name varchar(50) , last_name varchar(50) not null , telephone varchar(20 ) , address varchar(250) , state char (1 ) not null , last_update timestamp not null ); 0 rows inserted/updated/deleted ij> insert into sp_ss_ex_contact values('manjula@domain.com','manjula',null,'kutty ',null,null,'a',CURRENT_TIMESTAMP); 1 row inserted/updated/deleted ij> select * from sp_ss_ex_contact; EMAIL |FIRST_NAME |MIDDLE_NAME |LAST_NAME |TELEPHONE |ADDRESS |&|LAST_UPDATE -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- ------------------------------------------------------------ manjula@domain.com |manjula |NULL |kutty |NULL |NULL |a|2006-03-01 09:42:03.703 1 row selected Can you sent me your reproduction script/program? Thanks Manjula