Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Syntax ambiquity in ALTER TABLE statement
Mon, Feb 19 2007 11:27 AMPermanent Link

Michael Baytalsky
Tim,

There a little bit of syntax ambiguity in ALTER TABLE related to
property DESCRIPTION.
Consider this statement:

ALTER TABLE T
  ADD COLUMN C INTEGER
  DESCRIPTION 'XXX'

How do we know, that this description is related to column or table?
What is I need it to be table description (i.e. I add column and modify table
description within same statement)?

Also, there's a bit of strangeness in how parser treats commas.
For example, this statement executes fine, although in shouldn't:
alter table t12
  add column C4 integer,
  description 'New column C3 description'
  VERSION 1.2
This statement assigns description to table.

Same statement without comma also executes fine, but assigns description
to column:
alter table t12
  add column C4 integer
  description 'New column C3 description'
  VERSION 1.2


Regards,
Michael
Mon, Feb 19 2007 4:37 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Michael,

<< There a little bit of syntax ambiguity in ALTER TABLE related to property
DESCRIPTION.
Consider this statement:

ALTER TABLE T
  ADD COLUMN C INTEGER
  DESCRIPTION 'XXX'

How do we know, that this description is related to column or table?  What
is I need it to be table description (i.e. I add column and modify table
description within same statement)? >>

Yes, it is ambiguous.  If you need to specify the above SQL, you'll need to
also restate the table description using another DESCRIPTION clause.  It
basically is an issue because ALTER TABLE doesn't terminate or delineate the
list of operations.

<< Also, there's a bit of strangeness in how parser treats commas.  For
example, this statement executes fine, although in shouldn't:
alter table t12
  add column C4 integer,
  description 'New column C3 description'
  VERSION 1.2
This statement assigns description to table. >>

I wil check this out.  It's probably a bug.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image