0

I am creating a database in an Android application. Values in a text column are really unique if they meet the following requirements:

  • No null strings. NOT NULL
  • No equal strings. UNIQUE
  • No empty strings. CHECK.
  • Case considerations shouldn't be ignored. If "Lorem" is already in the column, "LoREM" shouldn't be inserted.

I read about user-defined functions a little. Do I have to create one the last requirement to be met?

Community
  • 1
  • 1
Maksim Dmitriev
  • 5,985
  • 12
  • 73
  • 138

1 Answers1

2

Add COLLATE NOCASE to the column specification to get the fourth requirement met.

laalto
  • 150,114
  • 66
  • 286
  • 303
  • It works, but if I need to support symbols that aren't presented in the English alphabet, I'll have to write my own function as [they](http://stackoverflow.com/a/8283265/1065835) say – Maksim Dmitriev Dec 14 '13 at 18:35