db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Linehan <lineh...@tcd.ie>
Subject Creating tables - migrating from MySQL.
Date Tue, 21 Jan 2014 14:09:39 GMT
Hi all,

I'm trying to migrate a system (72 tables) from MySQL to Apache.

I've looked at the docco here
but it isn't readily apparent to me how to create INDEXES within the
CREATE TABLE statement.

I'd rather not have to manually perform this procedure - a sample might help.

CREATE TABLE analysis (
  analysis_id smallint(5) unsigned NOT NULL AUTO_INCREMENT,
  created datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  logic_name varchar(128) NOT NULL,
  db varchar(120) DEFAULT NULL,
  PRIMARY KEY (analysis_id),
  UNIQUE KEY logic_name_idx (logic_name),
  KEY db_idx (db)

Tried this through ij and it failed.

What do I have to substitute for "PRIMARY KEY", "UNIQUE KEY" and "KEY"
statement (I'll either use sed/awk/vi/ or Java eventually) - or do I
have to create the PRIMARY KEY
and other KEYs outside of the main CREATE TABLE statement?

I did try doing this automatically using SQuirrel SQL, but there are
(MySQL!!!) some fields called
"end".... I'll try and quote these with double quotes for the time being.

Any help, ideas, references, URLs & appreciated.

TIA and rgs,




Mob: 00 353 86 864 5772

View raw message