db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Moots <a...@builderlynx.com>
Subject ALTER TABLE __ ALTER COLUMN Data type syntax
Date Wed, 10 Jan 2007 16:54:26 GMT
I'm using derby 10.2.2.0

I created my table using syntax like:
CREATE TABLE bl.tablename (ID INTEGER, Name INTEGER, Value CHAR(40))

I need to make the "Value" column longer.  According to the reference at:
http://db.apache.org/derby/docs/10.2/ref/rrefsqlj81859.html

I should use something like:
ALTER TABLE bl.tablename ALTER COLUMN Value SET DATA TYPE VARCHAR(1000000)
This doesn't work.  I also tried:
ALTER TABLE bl.tablename ALTER COLUMN Value SET DATA TYPE CHAR(1000000)
This doesn't work either.  In both cases, I get the following error message:
"The length, precision, or scale attribute for column, or type mapping 
'VARCHAR(1000000)' is not valid."

According to the documention at:
http://db.apache.org/derby/docs/dev/ref/rrefsqlj13733.html
my column length is not too long.  It says the max length is 
java.lang.Integer.MAX_VALUE which is much bigger than 1,000,000.

If someone could help me figure out what I'm doing wrong that would be 
greatly appreciated.  My table already contains data.  Would that be the 
problem?  Is there someway to upgarde the column length and convert the 
existing data?

Alex.

-- 
Alex Moots                           www.BuilderLynx.com
Builder Lynx                         t: 416-425-2925  f: 416-425-4233


Mime
View raw message