I need to create a new empty table, where each new value should be validated by server using format of its column. Like, ###-###-##
, where each #
is a digit from 0 to 9, and it should contain those -
symbols. How?
相关问题
- SQL join to get the cartesian product of 2 columns
- sql execution latency when assign to a variable
- Difference between Types.INTEGER and Types.NULL in
- What is the best way to cache a table from a (SQL)
- php PDO::FETCH_ASSOC doesnt detect select after ba
Use
CHECK
Constraint:No. Don't do that! That's not going to work.
If you have multi-tenant application and different customers would like to store the value in different format, you will be trapped.
Best way is to just validate the pattern on client side, and store in db in free form.