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?

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top