Benoit
Benoit

Reputation: 79235

DDL comments directly when creating schema objects

Is it possible to do this in a single query:

CREATE TABLE foo(bar INTEGER);

COMMENT ON foo IS 'my foo table';

COMMENT ON bar IS 'my bar column of the foo table';

Something like for the constraints:

CREATE TABLE foo
           ( bar INTEGER COMMENT IS 'my bar column of the foo table'
           , COMMENT IS 'my foo table'
           );

?

Upvotes: 2

Views: 3656

Answers (2)

Megha Kashinkunti
Megha Kashinkunti

Reputation: 51

NO.. you cannot include Comments while defining the Objects.. you can do it once the object is created..

Upvotes: 0

Ollie
Ollie

Reputation: 17568

No, COMMENT is an Oracle statement and has to be issued seperately to the CREATE TABLE command.

There is a similar question asked on the Oracle Forums here.

Upvotes: 5

Related Questions