So that when you insert 'abc',it'll be converted to 'ABC' automatically.
I'm using MySQL,is it possible?
So that when you insert 'abc',it'll be converted to 'ABC' automatically.
I'm using MySQL,is it possible?
You could write an INSERT trigger that does this for you.
Something like:
CREATE TRIGGER Capitalize BEFORE INSERT ON MyTable
SET NEW.MyColumn = UPPER(NEW.MyColumn)
What about using Upper function while executing query ? lets say You are using a SP to insert the values ... cast the value to upper case using UPPER function and then insert ?
I think your question is already well answered, but as a side note, this doesn't feel right to me. The data should be capitalized on a higher layer of your application, when the input is validated, or when the output takes place.