informix alter table with syntax error in unix
Posted in 2003
Topics: Data Types & Schema Design, Clustering, Grid & MACH11
Urgent help needed.
I am using informix db on unix and I wanted to do something as follow
(this script is a db2 script but I need an equvilant one for informix)
:
create table event_table(
appview varchar(80),
appevent varchar(80)
)
alter table event_table add constraint primary key (appview, appevent);
I keep getting syntax error at location starting at ",appevent".
I try many method such as
create table event_table(
appview varchar(80),
appevent varchar(80)
)
alter table event_table add constraint PK_testtable primary keyCLUSTERED (appview, appevent);
But it still doesn't work. PLS Help, thank in advance
--
Posted via http://dbforums.com
atay wrote:
> Urgent help needed.
> I am using informix db on unix and I wanted to do something as follow
> (this script is a db2 script but I need an equvilant one for informix)
>
> create table event_table(
> appview varchar(80),
> appevent varchar(80)
> )>
> alter table event_table add constraint primary key (appview, appevent);>
> I keep getting syntax error at location starting at ",appevent".
The best suggestion I can make is that you add NOT NULL constraints to
the columns and try again. Judging from the SQL Syntax manual, you're
using the right notation. I fear you are running foul of bad error
reporting.
If it turns out that my diagnosis is correct, please get back to me.
I already have a bug reported in the system saying "Don't generate
-201 syntax error when a better message is possible", and I'll make
sure this one gets tracked too - if I'm right.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
atay wrote :
> Urgent help needed.
> I am using informix db on unix and I wanted to do something as follow
> (this script is a db2 script but I need an equvilant one for informix):
>
> create table event_table(
> appview varchar(80),
> appevent varchar(80)
> )>
> alter table event_table add constraint primary key (appview, appevent);>
> I keep getting syntax error at location starting at ",appevent".
>
> I try many method such as
>
> create table event_table(
> appview varchar(80),
> appevent varchar(80)
> )>
> alter table event_table add constraint PK_testtable primary key> CLUSTERED (appview, appevent);
>
> But it still doesn't work. PLS Help, thank in advance
Does your actual script exclude a semicolon after the 'create table'
statement, as shown above? I ran your first example and it was fine -
once I added the semicolon.
--
June Hunt
Try running:
create table event_table(
appview varchar(80) not null,
appevent varchar(80) not null,
primary key(appview, appevent)
);
"atay" <member40505@dbforums.com> wrote in message news:3394310.1064060253@dbforums.com...
>
> Urgent help needed.
>
>
>
> I am using informix db on unix and I wanted to do something as follow
> (this script is a db2 script but I need an equvilant one for informix)
>
>
>
> :
>
>
>
> create table event_table(>
> appview varchar(80),
>
> appevent varchar(80)
>
>
>
> )
>
>
>
> alter table event_table add constraint primary key (appview, appevent);>
>
>
> I keep getting syntax error at location starting at ",appevent".
>
>
>
> I try many method such as
>
>
>
> create table event_table(>
> appview varchar(80),
>
> appevent varchar(80)
>
>
>
> )
>
>
>
> alter table event_table add constraint PK_testtable primary key> CLUSTERED (appview, appevent);
>
>
>
> But it still doesn't work. PLS Help, thank in advance
>
>
> --
> Posted via http://dbforums.com