a small funny bug of CTAS syntax with clustering clause.

CREATE TABLE TEST_A CLUSTERING BY LINEAR ORDER (id)
AS select 2 id from dual where rownum <2

ORA-01785: ORDER BY item must be the number of a SELECT-list expression

CREATE TABLE TEST_A CLUSTERING BY LINEAR ORDER (id)
AS select 1 id from dual where rownum

Table created
CREATE TABLE TEST_B
AS select 2 id from dual where rownum

Table created

I.e. create table as select (with clustering) :

works for value 1
doesn’t work for value 2

and work for usual CTAS (in both cases)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s