Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: ALTER TABLE requires extra parentheses for Oracle?

Re: ALTER TABLE requires extra parentheses for Oracle?

From: Jim Kennedy <kennedy-downwithspammersfamily_at_attbi.net>
Date: Thu, 06 May 2004 02:22:24 GMT
Message-ID: <Ajhmc.37925$Ik.2502911@attbi_s53>

"Dylan Nicholson" <wizofaus_at_hotmail.com> wrote in message news:7d428a77.0405051726.10d5e1b2_at_posting.google.com...
> Seems that Oracle 9.2 (using MS ODBC driver) requires extra
> parentheses when adding multiple columns to a table:
>
> ALTER TABLE MyTable ADD (MyColumn1 VARCHAR(255), MyColumn2
> VARCHAR(255))
>
> vs
>
> ALTER TABLE MyTable ADD MyColumn1 VARCHAR(255), MyColumn2 VARCHAR(255)
>
> The former simply doesn't work with MS Access or SQL server. I'm
> wondering what the SQL standard is, and whether there is a way (other
> than adding columns one at a time, which is surely inefficient for a
> table with existing data) of writing the statement to work with all 3
> types of database.
>
> TIA
>
> Dylan

The driver might be "editing" your sql statements for you. Try a pass thru query. Also usually for variable characters in Oracle you should use varchar2 not varchar. The extra parens should be ignored in any database since they are just a grouping mechanism. Jim Received on Wed May 05 2004 - 21:22:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US