Oracle considers empty strings to be NULL while SQL Server does not - how is this best handled?

前端 未结 11 1891
挽巷
挽巷 2021-01-01 13:35

I have to write a component that re-creates SQL Server tables (structure and data) in an Oracle database. This component also has to take new data entered into the Oracle d

11条回答
  •  渐次进展
    2021-01-01 14:13

    I've written an explanation on how Oracle handles null values on my blog a while ago. Check it here: http://www.psinke.nl/blog/hello-world/ and let me know if you have any more questions. If you have data from a source with empty values and you must convert to an Oracle database where columns are NOT NULL, there are 2 things you can do:

    • remove the not null constraint from the Oracle column
    • Check for each individual column if it's acceptable to place a ' ' or 0 or dummy date in the column in order to be able to save your data.

提交回复
热议问题