Create Table from View - Oracle SQL SQL Error: ORA-01723: zero-length columns are not allowed Create Table from View - Oracle SQL SQL Error: ORA-01723: zero-length columns are not allowed sql sql

Create Table from View - Oracle SQL SQL Error: ORA-01723: zero-length columns are not allowed


I have this problem when NULL is specified for a column, but the type is not specified. Arrgh!

You will need to look at the code. This often happens when I use:

select '' as x

Because I think '' should have the right type.

In any case, the solution is simple:

select cast(NULL as varchar2(255)),       cast(NULL as number)

or whatever the type is.

You'll need to either change the view definition, or use a query with a subquery with explicit casts.