Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLite Updating first letter to be upper case

Tags:

sqlite

I have a field, customer.country

Iam trying to update it so that the first letter of the values in country are upper case. I don't seem to be able to find out a way of doing that.

like image 820
Ian Vink Avatar asked May 18 '13 01:05

Ian Vink


People also ask

How do you change first letter to uppercase?

To use a keyboard shortcut to change between lowercase, UPPERCASE, and Capitalize Each Word, select the text and press SHIFT + F3 until the case you want is applied.

How do you change first character to uppercase in SQL?

Use the INITCAP() function to convert a string to a new string that capitalizes the first letter of every word. All other letters will be lowercase. This function takes one parameter as a string and changes the capitalization for each word as described.

Is SQLite like case sensitive?

Note that SQLite LIKE operator is case-insensitive. It means "A" LIKE "a" is true. However, for Unicode characters that are not in the ASCII ranges, the LIKE operator is case sensitive e.g., "Ä" LIKE "ä" is false.

How do I escape a special character in SQLite?

replaceAll("'","\'"); 3. difficulty = DatabaseUtils. sqlEscapeString(difficulty); To add to that, it's working me for the single words like Canada History , I mean without the special character word.


1 Answers

UPDATE customer
  SET country = UPPER(SUBSTR(country, 1, 1)) || SUBSTR(country, 2)
like image 105
Ignacio Vazquez-Abrams Avatar answered Oct 13 '22 20:10

Ignacio Vazquez-Abrams