CHECK CONSTRAINT of string to contain only digits. (Oracle SQL)

前端 未结 8 1861
一向
一向 2020-12-20 12:22

I have a column, say PROD_NUM that contains a \'number\' that is left padded with zeros. For example 001004569. They are all nine characters long.

I do not use a num

8条回答
  •  执笔经年
    2020-12-20 13:15

    Cast it to integer, cast it back to varchar, and check that it equals the original string?

提交回复
热议问题