Subject Re[2]: [IBO] Shorten string varchar column
Author Gulut
Friday, October 31, 2003, 9:23:31 AM, Daniel Rail wrote:
DR> Hi,
DR> At October 30, 2003, 21:55, Gulut wrote:
>> i have a table called Customer,
>> one if its field is CusID varchar(8)
>> now i want to make it varchar(5) this way:
>> alter table Customer
>> alter CusID type varchar(5)
>> i got this error:
>> unsuccessful metadata update
>> New size specified for column CUSID must be at least 5 characters

DR> First, this is a question to be posted on firebird-support group on
DR> Yahoo Groups, since it's not related to IBO.

But i'm using Interbase (i'm newbie though).
This is description of this group:
'Provide an area where InterBase novices and experts alike can collaborate on problems,
tips and issues surrounding the InterBase Objects product'.


DR> And, here are the steps to achieve what you want to do:
DR> 1. Create a varchar(5) TEMP field
DR> 2. Copy the values from CUSID to the new TEMP field
DR> 3. Drop CUSID
DR> 4. Rename the TEMP field to CUSID

Thank you, i get that.

When i change varchar(4) to varchar(8) it works well without error message
but not when i change varchar(8) to varchar(5).
I wonder because actual lengt of my data in the column is only
5character.


DR> And, if you have dependents(foreign keys, views, SPs, triggers and
DR> indices), you have to eliminate those dependencies first. Otherwise,
DR> you wouldn't be able to drop CUSID.

Thank you.

rgrds,
Gulut