I have an application which allowed 35 characters for email address.
Of course, someone has to come up with an email longer than 35 characters.
Is there an elegant way to extend the length to 50 characters?
I have an idea but before I do that is there a way to determine the length first?
That is, if length is 35 then extend to 50 else take no action.
(this assumes the length would only need to be changed at once.)
Modify length of string field
Moderator: Neosoft Support
- BRobinsonS
- Posts: 355
- Joined: Sun Sep 25, 2005 9:00 pm
- Location: Ontario, Canada
- Contact:
Re: Modify length of string field
strlen in a conditional statement.
Wrangler
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
--------------
"You never know about a woman. Whether she'll laugh, cry or go for a gun." - Louis L'Amour
Windows 7 Ultimate SP1 64bit
16GB Ram
Asus GTX 950 OC Strix
Software made with NeoBook
http://highdesertsoftware.com
Re: Modify length of string field
Brian:
- this is a text/string field
- you want to increase the length of the field (column)
- you are amenable to doing it while the Table is NOT Open (adding/editing other records)
... perhaps this suggestion ...
... that I found here ... https://stackoverflow.com/questions/152 ... -via-t-sql ... might help.
I am assuming that ...I have an application which allowed 35 characters for email address.
Of course, someone has to come up with an email longer than 35 characters.
Is there an elegant way to extend the length to 50 characters?
- this is a text/string field
- you want to increase the length of the field (column)
- you are amenable to doing it while the Table is NOT Open (adding/editing other records)
... perhaps this suggestion ...
Code: Select all
ALTER TABLE YourTableNameHere
ALTER COLUMN YourColumnnameHere VARCHAR(50)
Pray tell us your idea.I have an idea but before I do that is there a way to determine the length first?
I'm confused.That is, if length is 35 then extend to 50 else take no action.
(this assumes the length would only need to be changed at once.)
- BRobinsonS
- Posts: 355
- Joined: Sun Sep 25, 2005 9:00 pm
- Location: Ontario, Canada
- Contact:
Re: Modify length of string field
Since I built SQL execution possibilities into the app, I was able use
successfully. Wasn't just for myself.
Now I can tell my customers how to change the length if required.
My idea was to use SQL if I could figure out how.
Now I have. I thought I would have to build the SQL into the code, but I don't have to.
Code: Select all
ALTER TABLE YourTableNameHere
ALTER COLUMN YourColumnnameHere VARCHAR(50)
Now I can tell my customers how to change the length if required.
My idea was to use SQL if I could figure out how.
Now I have. I thought I would have to build the SQL into the code, but I don't have to.