column name type :syntax error
Posted in 2009
Topics: General Discussion
Hi I have informix 9.4 and 7.3 when in 9.4 when i run the below command it gives me syntax error , is there any restriction on such command alter table *test* add type char(1); same thing worked in 7.3 and even in 9.4 i can create the table with a column name as *type*. regards --00504502b0a2ac9768047803e706
TYPE is a keyword in 9.xx and later releases of IDS. You ARE permitted to name a column using a keyword, however, at the syntax level where you entered it, there is a syntactic ambiguity. You can try the alter with parenthesis around the ADD clause: alter table *test* add ( type char(1) ); That might resolve the ambiguity. Art Art S. Kagel Oninit (www.oninit.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Oninit, the IIUG, nor any other organization with which I am associated either explicitly or implicitly. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Nov 10, 2009 at 8:07 AM, debadatta <mishra.dd@gmail.com> wrote: > Hi > > I have informix 9.4 and 7.3 > > when in 9.4 when i run the below command it gives me syntax error , is > there > any restriction on such command > > alter table *test* add type char(1); > > same thing worked in 7.3 and even in 9.4 i can create the table with a > column name as *type*. > > regards > > --00504502b0a2ac9768047803e706 > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --0015174769c822ad640478050410
On Tue, Nov 10, 2009 at 05:07, debadatta <mishra.dd@gmail.com> wrote:
> I have informix 9.4 and 7.3
>
> when in 9.4 when i run the below command it gives me syntax error , is
> there
> any restriction on such command
>
> alter table *test* add type char(1);
>
> same thing worked in 7.3 and even in 9.4 i can create the table with a
> column name as *type*.
>
One other option - available in both - is to use a delimited identifier with
DELIMIDENT set in the environment.
alter table test add "type" char(1);
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2008.0513 -- http://dbi.perl.org/
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."
NB: Please do not use this email for correspondence.
I don't necessarily read it every week, even.
Pablo Picasso<http://www.brainyquote.com/quotes/authors/p/pablo_picasso.html>
- "Computers are useless. They can only give you answers."
--000e0cd110723e266c04780ec3bb
Thanks You Art it works perfect Regards Deba On Tue Nov 10 19:50:52 UTC+0530 2009, Art Kagel<art.kagel@gmail.com wrote: >TYPE is a keyword in 9.xx and later releases of IDS. You ARE permitted to >name a column using a keyword, however, at the syntax level where you >entered it, there is a syntactic ambiguity. You can try the alter with >parenthesis around the ADD clause: >alter table *test* add ( type char(1) ); >That might resolve the ambiguity. >Art >Art S. Kagel >Oninit (www.oninit.com) >IIUG Board of Directors (art@iiug.org) >Disclaimer: Please keep in mind that my own opinions are my own opinions and >do not reflect on my employer, Oninit, the IIUG, nor any other organization >with which I am associated either explicitly or implicitly. Neither do >those opinions reflect those of other individuals affiliated with any entity >with which I am affiliated nor those of the entities themselves. >On Tue, Nov 10, 2009 at 8:07 AM, debadatta <mishra.dd@gmail.com> wrote: >> Hi >> >> I have informix 9.4 and 7.3 >> >> when in 9.4 when i run the below command it gives me syntax error , is >> there >> any restriction on such command >> >> alter table *test* add type char(1); >> >> same thing worked in 7.3 and even in 9.4 i can create the table with a >> column name as *type*. >> >> regards >> >> --00504502b0a2ac9768047803e706 >> >> >> >> >******************************************************************************* >> Forum Note: Use "Reply" to post a response in the discussion forum. >> >> >--0015174769c822ad640478050410 >******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum.