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

前端 未结 11 1897
挽巷
挽巷 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 13:56

    NOT NULL is a database constraint used to stop putting invalid data into your database. This is not serving any purpose in your Oracle database and so I would not have it.

    I think you should just continue to allow NULLS in any Oracle column that mirrors a SqlServer column that is known to contain empty strings.

    If there is a logical difference in the SqlServer database between NULL and empty string, then you would need something extra to model this difference in Oracle.

提交回复
热议问题