JianJunShen
asked on
run sql in MySql query browser using generated DDL from MyEclipse tool.
Initially I use MySQL query browser(1.1.14) to create schema, then I using MYEclipse DDL generation to generate following DDL:
create table `auctiontest`.`user`(
`uid` bigint unsigned not null auto_increment comment 'auto_increment',
`name` varchar(45) default '' not null,
`password` varchar(45) default '' not null,
primary key (`uid`)
);
create unique index `PRIMARY` on `auctiontest`.`user`(`uid` );
2) I create the table in another schema. So I replace auctiontest to testone2many.
create table `testone2many`.`user`(
`uid` bigint unsigned not null auto_increment comment 'auto_increment',
`name` varchar(45) default '' not null,
`password` varchar(45) default '' not null,
primary key (`uid`)
);
create unique index `PRIMARY` on `testone2many`.`user`(`uid `);
But it failes. The error message is "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ';
create unique index `PRIMARY` on `testone2many`.`user`"
It does work if I only run part of it say:
create table `testone2many`.`user`(
`uid` bigint unsigned not null auto_increment comment 'auto_increment',
`name` varchar(45) default '' not null,
`password` varchar(45) default '' not null,
primary key (`uid`)
);
MyEclipse version is 5.1.1 and MySQL version is 4.0.9.
create table `auctiontest`.`user`(
`uid` bigint unsigned not null auto_increment comment 'auto_increment',
`name` varchar(45) default '' not null,
`password` varchar(45) default '' not null,
primary key (`uid`)
);
create unique index `PRIMARY` on `auctiontest`.`user`(`uid`
2) I create the table in another schema. So I replace auctiontest to testone2many.
create table `testone2many`.`user`(
`uid` bigint unsigned not null auto_increment comment 'auto_increment',
`name` varchar(45) default '' not null,
`password` varchar(45) default '' not null,
primary key (`uid`)
);
create unique index `PRIMARY` on `testone2many`.`user`(`uid
But it failes. The error message is "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ';
create unique index `PRIMARY` on `testone2many`.`user`"
It does work if I only run part of it say:
create table `testone2many`.`user`(
`uid` bigint unsigned not null auto_increment comment 'auto_increment',
`name` varchar(45) default '' not null,
`password` varchar(45) default '' not null,
primary key (`uid`)
);
MyEclipse version is 5.1.1 and MySQL version is 4.0.9.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
How about above DDL then? I remove two create unique index and create index lines, problem still exists?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I follow your suggestions, but it does not work.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I run following DDL. And error message is "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ';
alter table `testone2many`.`category`
add ind ";
What kind of MySQL server version do you have? I have old one, 4.0.9, not 5.0. Do you know how could I use command window to run these DDL?
create table `testone2many`.`category`(
`cid` bigint unsigned not null auto_increment comment 'auto_increment',
`name` varchar(45) default '' not null,
`parent_category_id` bigint unsigned,
primary key (`cid`)
);
alter table `testone2many`.`category`
add index `FK_category_1`(`parent_ca tegory_id` ),
add constraint `FK_category_1`
foreign key (`parent_category_id`)
references `testone2many`.`category`( `cid`);
create index `Index_2` on `testone2many`.`category`( `parent_ca tegory_id` ,`cid`);
alter table `testone2many`.`category`
add ind ";
What kind of MySQL server version do you have? I have old one, 4.0.9, not 5.0. Do you know how could I use command window to run these DDL?
create table `testone2many`.`category`(
`cid` bigint unsigned not null auto_increment comment 'auto_increment',
`name` varchar(45) default '' not null,
`parent_category_id` bigint unsigned,
primary key (`cid`)
);
alter table `testone2many`.`category`
add index `FK_category_1`(`parent_ca
add constraint `FK_category_1`
foreign key (`parent_category_id`)
references `testone2many`.`category`(
create index `Index_2` on `testone2many`.`category`(
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, using command window it works.
ASKER
But I am wondering why MySQL query browser does not work.
> But I am wondering why MySQL query browser does not work.
You might want to try using a newer version (I'm running 1.2.9). I think I remember having problems with executing multiple queries from the same file (separated by `;`) in some of the earlier versions of MySQL Query Browser. It may have been a bug which was fixed later on.
You might want to try using a newer version (I'm running 1.2.9). I think I remember having problems with executing multiple queries from the same file (separated by `;`) in some of the earlier versions of MySQL Query Browser. It may have been a bug which was fixed later on.
ASKER
`cid` bigint unsigned not null auto_increment comment 'auto_increment',
`name` varchar(45) default '' not null,
`parent_category_id` bigint unsigned,
primary key (`cid`)
);
alter table `testone2many`.`category`
add index `FK_category_1`(`parent_ca
add constraint `FK_category_1`
foreign key (`parent_category_id`)
references `testone2many`.`category`(
create unique index `PRIMARY` on `testone2many`.`category`(
create index `Index_2` on `testone2many`.`category`(