Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQL script?

0 views
Skip to first unread message

Micheal (Mike) Williams

unread,
Feb 23, 2003, 2:20:55 PM2/23/03
to
Is this the place to ask a question about SQL scripts?

--
Mike Williams

home.quixnet.net/~m1j
IBO#770070
www.quixtar.com
www.espring.com
www.nutrilite.com
www.blionline.com


Sum[1];

unread,
Feb 23, 2003, 4:02:59 PM2/23/03
to
On Sun, 23 Feb 2003 13:20:55 +0000, Micheal (Mike) Williams wrote:

> Is this the place to ask a question about SQL scripts?

Yes.

--
Greetings,

Sum[1];

Micheal (Mike) Williams

unread,
Feb 23, 2003, 4:27:41 PM2/23/03
to
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?

"Sum[1];" <INV...@Sum1.mail.com> wrote in message
news:pan.2003.02.24....@Sum1.mail.com...

Cambo

unread,
Feb 23, 2003, 9:08:38 PM2/23/03
to
What database are you using?

"Micheal (Mike) Williams" <mic...@quixnet.net> wrote in message
news:b3be67$6o9$1...@sun-news.laserlink.net...

Micheal (Mike) Williams

unread,
Feb 23, 2003, 9:41:45 PM2/23/03
to
MySQL


"Cambo" <cambo...@nospammers.myway.com> wrote in message
news:3e597e60$1...@news.internex.net.au...

Cambo

unread,
Feb 23, 2003, 11:29:24 PM2/23/03
to
I am not sure if you have the syntax quite right. I think the comma's after
PRIMARY KEY should be brackets.
Different versions of mysql have slight variances. Have you looked here -
http://www.mysql.com/doc/en/CREATE_TABLE.html ??

"Micheal (Mike) Williams" <mic...@quixnet.net> wrote in message

news:b3c0j4$mp1$1...@sun-news.laserlink.net...

Micheal (Mike) Williams

unread,
Feb 24, 2003, 1:13:27 AM2/24/03
to
Those are text illustration used to denote optional componantes of the creat
table funtion.
If I remove the "CONSTRAINT pk_dir " part it works. I am not sure what this
is or is used for.

"Cambo" <cambo...@nospammers.myway.com> wrote in message

news:3e599f5f$1...@news.internex.net.au...

Andy Hassall

unread,
Feb 24, 2003, 7:39:29 AM2/24/03
to
On Sun, 23 Feb 2003 20:41:45 -0600, "Micheal \(Mike\) Williams"
<mic...@quixnet.net> wrote:

>>> 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)

J.O. Aho

unread,
Feb 24, 2003, 9:19:44 AM2/24/03
to
Micheal (Mike) Williams wrote:
> 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?

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

Micheal (Mike) Williams

unread,
Feb 24, 2003, 11:12:26 AM2/24/03
to
The my host uses MySQL. The dealer I have uses Oracle. I got the files from
the dealer to build my own web page. So I must find a way to convert the
oracle sql script to MySQL script. I believe all I need to do is remove the
constaints.

Thanks all!


"Andy Hassall" <an...@andyh.co.uk> wrote in message
news:4d2k5v493p634htl6...@4ax.com...

0 new messages