Page 1 of 1

[Solved] How to change field type of an existing column?

PostPosted: Sun Nov 01, 2015 9:17 pm
by Stargate38
I'm new to Base, and I accidentally used the wrong field type in my "Phone_Number" Column, meaning I can't put more than 10 digits in. How do I change the field type of that column, so that I can put 11 digit numbers in it? I tried right-clicking on the column and all I got was "Column Format", "Column Width", and "Hide Column". I can't find anything in the help file about it, and Googling the problem comes up with nothing.

Here's the error I get when trying to type in a toll-free 1-800 number, after hitting Enter:

Code: Select all   Expand viewCollapse view
SQL Status: 22001
Error code: -124

Value too long in statement [UPDATE "Phone Numbers" SET "Phone_Number" = ? WHERE "ID" = ?]


That doesn't come up if I omit the 1 (i.e. 8001234567 instead of 18001234567).

Re: How to change field type of an existing column?

PostPosted: Sun Nov 01, 2015 9:45 pm
by Villeroy
menu:Tools>SQL...
ALTER TABLE "Phone Numbers" ALTER COLUMN "Phone Number" VARCHAR(20);
menu:View>RefreshTables