1

I am using the CREATE TABLE AS SELECT statement in Oracle 11g to get data from SQL Server 2012 via a database link.

Oracle creates all these tables with non-nullable columns and that causes me problems later when I try to update them.

How can I prevent this behaviour in Oracle and make resulting columns nullable?

Evan Carroll
  • 65,432
  • 50
  • 254
  • 507
alonk
  • 301
  • 1
  • 4
  • 11

1 Answers1

2

Either create the table manually beforehand, or specify the column names an NULLability in the CTAS statement:

create table blah2 
( 
  ctascolumn1 not null,
  ctascolumn2 null
) 
as 
select col1, col2 from blah;
Philᵀᴹ
  • 31,952
  • 10
  • 86
  • 108