You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Legolas Woodland <le...@gmail.com> on 2005/11/12 14:19:53 UTC

some questions about porting mysql database to derby database

some questions about porting mysql database to derby database
Thank you for reading my post
I am porting a database of myself from Mysql to derby. I am converting the
database creation script for now.
I found some of my questions in mailing liast and some are remind which i
ask now.
1-i used smallint instead of bool , is it ok ? as we put value 0 ,1 as true
and false.
2-I used blob instead of LONGBLOB.
3-how i can translate following table as it has forigen Key and combind
primary key items ?
CREATE NEWS_INTEREST (
channelid INTEGER,
userid INTEGER,
PRIMARY KEY (channelid, userid),
FOREIGN KEY (channelid) REFERENCES SB_NEWS_CHANNELS(id) ON DELETE CASCADE,
FOREIGN KEY (userid) REFERENCES SB_USERS(userid) ON DELETE CASCADE
) TYPE=INNODB;

4-as you see in the above , mysql statement are finished with ;
now my question is : what should i use instead of ; ? i tried to use
go;
;
blank
in the end of each create table but it is not correct :(

Tahnk you for help

Re: some questions about porting mysql database to derby database

Posted by Dan Scott <de...@gmail.com>.
This might be obvious, but...

4 -- make sure you remove "TYPE=INNODB" from the end of the statement
-- this is a MySQLism. You only need a statement terminator (;) if
you're issuing the statement from within ij, or in a script processed
by ij. In an application you just issue the statement with no
terminator.

Dan

On 11/12/05, Legolas Woodland <le...@gmail.com> wrote:
>
>
> some questions about porting mysql database to derby database
> Thank you for reading my post
> I am porting a database of myself from Mysql to derby.  I am converting the
> database creation script for now.
> I found some of my questions in mailing liast and some are remind which i
> ask now.
> 1-i used smallint instead of bool , is it ok ? as we put value 0 ,1 as true
> and false.
> 2-I used blob instead of LONGBLOB.
> 3-how i can translate following table as it has forigen Key and combind
> primary key items ?
> CREATE NEWS_INTEREST (
>   channelid INTEGER,
>   userid INTEGER,
>   PRIMARY KEY (channelid, userid),
>   FOREIGN KEY (channelid) REFERENCES SB_NEWS_CHANNELS(id) ON DELETE CASCADE,
>   FOREIGN KEY (userid) REFERENCES SB_USERS(userid) ON DELETE CASCADE
> ) TYPE=INNODB;
>
> 4-as you see in the above  , mysql statement are finished with ;
> now my question is : what should i use instead of ; ? i tried to use
> go;
> ;
> blank
> in the end of each create table but it is not correct :(
>
> Tahnk you for help
>