--
Mike Williams
home.quixnet.net/~m1j
IBO#770070
www.quixtar.com
www.espring.com
www.nutrilite.com
www.blionline.com
> Is this the place to ask a question about SQL scripts?
Yes.
--
Greetings,
Sum[1];
I keep getting an error some where around the "pk_dir".
This is an SQL script form a manufacturer. I am trying to include the tables
into my DB.
I am not sure what version of sql it was in but I had to change types. The
numeric was number and the varchar was a varchar2. Any idea what version sql
that might be? Is there easy conversion tools for this type of operation?
"Sum[1];" <INV...@Sum1.mail.com> wrote in message
news:pan.2003.02.24....@Sum1.mail.com...
"Micheal (Mike) Williams" <mic...@quixnet.net> wrote in message
news:b3be67$6o9$1...@sun-news.laserlink.net...
"Cambo" <cambo...@nospammers.myway.com> wrote in message
news:3e597e60$1...@news.internex.net.au...
"Micheal (Mike) Williams" <mic...@quixnet.net> wrote in message
news:b3c0j4$mp1$1...@sun-news.laserlink.net...
"Cambo" <cambo...@nospammers.myway.com> wrote in message
news:3e599f5f$1...@news.internex.net.au...
>>> CREATE TABLE DIRECTORY (
>>> ID NUMERIC CONSTRAINT pk_dir PRIMARY KEY,
>>> NAME VARCHAR(150) NOT NULL,
>>>
>>> I keep getting an error some where around the "pk_dir".
>>> This is an SQL script form a manufacturer. I am trying to include the
>>> tables into my DB.
>>>
>>> I am not sure what version of sql it was in but I had to change types.
>>> The numeric was number and the varchar was a varchar2. Any idea what version
>>> sql that might be? Is there easy conversion tools for this type of
>>> operation?
>> What database are you using?
>
>MySQL
The only database that uses VARCHAR2 that I know is Oracle, which would also
allow the named inline primary key constraint. MySQL only allows anonymous
primary key constraints.
NUMERIC isn't a base data type in Oracle, it's one of the ANSI compatility
types, which maps to NUMBER.
Also in Oracle, "directory" is a reserved word, so it's a bad choice of name.
The equivalent MySQL statement would look like:
CREATE TABLE DIRECTORY (
ID NUMERIC NOT NULL PRIMARY KEY,
NAME VARCHAR(150) NOT NULL
);
Or:
CREATE TABLE DIRECTORY (
ID NUMERIC NOT NULL,
NAME VARCHAR(150) NOT NULL,
primary key (ID)
);
Why are you trying to load an Oracle product into MySQL?
--
Andy Hassall (an...@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
You can always choose to install Oracle8i ro Oracle9 on your machine and use
the SQL files as they are, I guess there will be triggers and other stuff that
you won't be able to use on your MySQL.
For development purpuses you may use Oracle without charge.
//Aho
Thanks all!
"Andy Hassall" <an...@andyh.co.uk> wrote in message
news:4d2k5v493p634htl6...@4ax.com...