You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Abhijit Haldar <ha...@rediffmail.com> on 2010/05/06 17:51:43 UTC

Table not found in Derby

Hi,
I am getting some strange problem during derby setup in my machine.Yesterday I setup the derby DB in my machine,and create some table in default schema.Today morning I have checked with command "show tables;"But I have found the tables are not present which I created earlier.
Please help me..

Thanks
Abhijit

RE: Unique or primary key constraint error while BULK import back into table after BULK export

Posted by Mamatha Kodigehalli Venkatesh <Ma...@ness.com>.
Hello,

 

Any help appreciated on this.

 

My table ('TIDLGGLS') that has Varchar field say has values ("hello") and ("hello   ") in the column (test).

Step1: I do a bulk export on this table.

Step2:  Try Bulk import...

            I end up in an exception ....

WARNING: Error in updating the Database Import error on line 48,917 of file D:\test\TestDBUpg/TIDLGGLS_data.dat: The statement was aborted because it would have caused a duplicate key value in a unique or primary key constraint or unique index identified by 'TIILGGLS' defined on 'TIDLGGLS'.

'TIILGGLS' is my unique index created on this column (test).

'TIDLGGLS' is my table.

 

How can I come out of this problem?

 

Thanks

Mamatha

 

________________________________

From: Mamatha Kodigehalli Venkatesh [mailto:Mamatha.Venkatesh@ness.com] 
Sent: Friday, May 07, 2010 5:45 PM
To: Derby Discussion
Subject: Unique or primary key constraint error while BULK import back into table after BULK export

 

Hello,

 

In derby when we export a data table which contains same value ("hello") and another ("hello  ") where there is only difference in the space using BULK EXPORT.

When you go back and import the exported data, you get a unique constraint error.

 

As this table contains the unique constraint on the table on the column of the represented table..

 

Below is the test data of the table executed in ij.

 

TABLE WITH VARCHAR

 

create table companies (name VARCHAR(50) not null);

CREATE UNIQUE INDEX varcharcompaniesIndx on companies (name);

 

insert into companies values ('NESS') ;

insert into companies values ('NESS  ') ;

 

RESULT : NO ERROR in derby and oracle

 

TABLE WITH CHAR

create table chartestme(name CHAR(50) not null);

CREATE UNIQUE INDEX chartestmeIndx on chartestme (name);

insert into chartestme values ('HELLO') ;

insert into chartestme values ('HELLO  ') ;

 

 

RESULT : NO ERROR in derby... wheras oracle throws unique constraint

 

 

select name, length(name) from companies

select name, length(name)  from varchartable

 

Question :  Oracle throws an unique constraint error during insert only if the datatype is Char. Why the same behaviour is not observed in derby when the datatype is char.

 

 

Thanks

Mamatha


Re: Unique or primary key constraint error while BULK import back into table after BULK export

Posted by Bryan Pendleton <bp...@gmail.com>.
> create table chartestme(name CHAR(50) not null);
> insert into chartestme values ('HELLO') ;
> insert into chartestme values ('HELLO  ') ;

I believe that Derby considers both those values as being padded
with spaces to make them each exactly 50 characters long:
http://db.apache.org/derby/docs/10.5/ref/rrefsqlj13733.html

thanks,

bryan

Unique or primary key constraint error while BULK import back into table after BULK export

Posted by Mamatha Kodigehalli Venkatesh <Ma...@ness.com>.
Hello,

 

In derby when we export a data table which contains same value ("hello") and another ("hello  ") where there is only difference in the space using BULK EXPORT.

When you go back and import the exported data, you get a unique constraint error.

 

As this table contains the unique constraint on the table on the column of the represented table..

 

Below is the test data of the table executed in ij.

 

TABLE WITH VARCHAR

 

create table companies (name VARCHAR(50) not null);

CREATE UNIQUE INDEX varcharcompaniesIndx on companies (name);

 

insert into companies values ('NESS') ;

insert into companies values ('NESS  ') ;

 

RESULT : NO ERROR in derby and oracle

 

TABLE WITH CHAR

create table chartestme(name CHAR(50) not null);

CREATE UNIQUE INDEX chartestmeIndx on chartestme (name);

insert into chartestme values ('HELLO') ;

insert into chartestme values ('HELLO  ') ;

 

 

RESULT : NO ERROR in derby... wheras oracle throws unique constraint

 

 

select name, length(name) from companies

select name, length(name)  from varchartable

 

Question :  Oracle throws an unique constraint error during insert only if the datatype is Char. Why the same behaviour is not observed in derby when the datatype is char.

 

 

Thanks

Mamatha


Re: Table not found in Derby

Posted by Kristian Waagan <Kr...@Sun.COM>.
On 06.05.10 17:51, Abhijit Haldar wrote:
> Hi,
> I am getting some strange problem during derby setup in my
> machine.Yesterday I setup the derby DB in my machine,and create some
> table in default schema.Today morning I have checked with command "show
> tables;"But I have found the tables are not present which I created earlier.
> Please help me..

Hi Abhijit,

The most common reason for this issue, is that you are not booting the 
same database. You can verify that you are booting an existing database 
by not adding the "create=true" connection attribute.

I've also seen reports where people set auto-commit to false and then 
forgetting to commit before they exit ij.


Hope this helps,
-- 
Kristian

>
> Thanks
> Abhijit
> <http://sigads.rediff.com/RealMedia/ads/click_nx.ads/www.rediffmail.com/signatureline.htm@Middle?>
>