As for postgres, mssql, and for oracle, change the null property on the not null column and then check all the properties of this column in ALL databases? One change request. And one to check for type and length, and is nullable.
1 answer
Changing X column property to not null:
Oracle: alter table test modify X not null; Ms sql: alter table test alter column X VARCHAR not null; Postgresql: alter table test alter column X set not null; As can be seen from the example, in the case of using MS SQL, it is impossible to directly set the attribute NOT NULL without specifying the data type of the column.
Information on data types, length, NOT NULL attribute on columns can be obtained as follows:
Oracle: select * from ALL_TAB_COLUMNS where owner='владелец' AND table_name='таблица' and column_name='колонка' Ms sql и Postgresql: select * from information_schema.columns where table_schema='схема' AND table_name = 'таблица' AND column_name = 'колонка'; |
ALL_TAB_COLUMNS. The rest of the DBMS - look in their documentation. There is no unified way. For change, formally, you can write a more or less standard DDL query, but I will not give a guarantee that it will work the same everywhere. - Dmitriy