db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edson Carlos Ericksson Richter <edson.rich...@mgrinformatica.com.br>
Subject Rename table error
Date Thu, 20 Jul 2006 13:55:28 GMT

I think this is being worked on... anyway, I'll ask:

I'm returning to Derby because it advanced so much, and is almost a good 
choice for production systems (don't make this a flame war, I have my 
personal reasons for the "almost" there). As I starting a new project, I 
want to use Derby as base for it.
First problem I've found is I can't rename a table. Using IBM cloudscape 
workbench (I know, it's not a derby tool - but works for the basics), I 
don't have an "rename table" option.
Going to a query window and typing:

rename table CITY to CIDADE

the first thing I notice is "rename" is a not recognized (by CS 
Workbench) as reserved word (ok, it's not a Derby problem).
The second is when I execute, I get message

org.apache.derby.client.am.SqlException: Operation 'RENAME' cannot be 
performed on object 'CITY' because CONSTRAINT 'CKC_CITY_CAPITAL' is 
dependent on that object.

Well, CKC_CITY_CAPITAL is a constraint inside the table. So, it should 
be automatically adjusted to new name. At least, this is basic I expect 
from database... Then I remember to hear somewhere on the world about 
cascading changes on metadata. I tryied, but it appear just being a rumor:

rename table CITY to CIDADE cascade


org.apache.derby.client.am.SqlException: Syntax error: Encountered 
"cascade" at line 1, column 29.

So, IMHO, the rename table is completely useless, because there is no 
relational table on the world that has no constraints (either check, 
references, uniques, etc).

Could someone point me what I'm doing wrong?



View raw message