[DB-SIG] need help

Peter Mott peter at monicol.co.uk
Tue Jan 4 17:35:14 CET 2005


I looked at second URL which actually gives a mapping between MySQL and
Oracl types. This is a bit of a mysqldump file:

 

--

-- Table structure for table 'categories'

--

 

DROP TABLE IF EXISTS categories;

CREATE TABLE categories (

  category_name varchar(50) NOT NULL default '',

  PRIMARY KEY  (category_name)

) TYPE=MyISAM;

 

--

-- Dumping data for table 'categories'

--

 

INSERT INTO categories VALUES
('Abortion'),('Accountants'),('Advertising'),('Air'),('Aluminium'),('Ambulan
ce'),('Antiques') ....

 

I'm suggesting that Linda generate the Oracle equivalen and the change the
CREATE TABLE dump with the equivalent MySQL types. Somrthing like this
surely works unless Oracle has no dump process which I find hard to believe
(well MSAcess doesn't but .)

 

Cheers

 

Peter

 

 

 

  _____  

From: Arjen Dijkstra [mailto:adijkstra at baandersconsultancy.nl] 
Sent: 04 January 2005 14:27
To: Peter Mott
Cc: 'linda'; db-sig at python.org
Subject: Re: [DB-SIG] need help

 

I don't think that will work. Mysql has diverent types:
http://www.utexas.edu/its/unix/reference/oracledocs/v92/B10501_01/win.920/a9
7249/toc.htm and especially:
http://www.utexas.edu/its/unix/reference/oracledocs/v92/B10501_01/win.920/a9
7249/ch3.htm#1026907

Arjen

Peter Mott wrote: 

I don't know Oracle but there should be (surewly must be) an option to dump
the contents of a database or table to SQL (in MySQL it is mysqldump) after
which you can tweak the SQL and then simply run it from within the MySQL
monitor: eg source oracle.sql  where your dump file was called oracle.sql
You may evenb be ablke toi get away without tweaking the SQL at all. In
principle it should not be needed. 
 
Peter
 
  

-----Original Message-----
From: db-sig-bounces at python.org [mailto:db-sig-bounces at python.org] On
Behalf Of Carey David SSgt 109CF/SCBJ
Sent: 04 January 2005 12:48
To: 'linda'; 'db-sig at python.org'
Subject: RE: [DB-SIG] need help
 
It seems a little vague what your trying to do, but I have a suggestion
from
what I can gather.
 
go into oracle, at the prompt you need to describe your table. If your
table
is called 'customers' you would type
 
desc customers
 
it would give you something that looks like the following.
 
 Name                            Null?    Type
------------------------------- -------- ----
CUST_ID                         NOT NULL NUMBER(5)
CUST_NAME                       NOT NULL VARCHAR2(20)
CUST_PHONE                               VARCHAR2(10)
 
Print this out or hand copy it. I'm almost positive that the datatypes
from
oracle will not match up 100% with the datatypes of MySQL, but I don't
have
my SQL Bible on me at the moment to look. This is still fine though
because
a lot of the common data types such a char and varchar should match up no
problem. There are tables you can find on the web that will tell you what
datatypes MySQL supports. Go into MySQL and create your new table from the
information you pulled from the oracle describe. I assume since your using
oracle, your familiar with creating tables with SQL, and SQL is SQL pretty
much across most databases. That is how I would convert the table. If I
had
to do more then several, then I would probably write a python program to
do
it ;-)
 
Now if you have data that you want to move from one table to the next, I'm
not sure what exactly would be the best method for you. It depends on your
situation. Me personally, I would write a program with 2 database
connections. One to the Oracle database and the other to the MySQL
database.
As the program was iterating through a select statement I would
simultaneously have it performing insert statements to the MySQL table I
previously created. Another way might be to put it into a csv file, copy
it
to your other machine, then import it somehow.
 
This is my suggestion. I'm far from a pro at either Oracle or MySQL so
there
might be some other way that I don't know of, but as far as I know there
isn't just one simple program or way to do it. However I'm sure if there
is,
someone more knowledgeable then myself on the list will comment.
 
David Carey
Stratton ANGB
Scotia, NY
 
________________________________
 
 From: linda [mailto:linda_ferrari9 at yahoo.com]
 Sent: Monday, January 03, 2005 9:02 PM
 To: db-sig at python.org
 Subject: [DB-SIG] need help
 
 
 hello..
 my name is linda.. i'm student, ineed your help in
 how to convert table in oracle into mysql..
 how to do it that.. i search all in web how to convert that but
their is no solution for me..
 i really need your help for my problem..
 
 thanks
 LINDA
 
 
 
 linda
 
 ________________________________
 
 Yahoo! Messenger
 
<http://uk.rd.yahoo.com/mail/tagline_messenger/*http:/uk.messenger.yahoo.com
> <http://uk.rd.yahoo.com/mail/tagline_messenger/*http://uk.messenger.yahoo.
co
<http://uk.rd.yahoo.com/mail/tagline_messenger/*http:/uk.messenger.yahoo.com
> 
m
<http://uk.rd.yahoo.com/mail/tagline_messenger/*http:/uk.messenger.yahoo.com
> >  - Communicate instantly..."Ping" your friends today! Download
Messenger
Now
 
<http://uk.rd.yahoo.com/mail/tagline_messenger/*http:/uk.messenger.yahoo.com
/download/index.html>
<http://uk.rd.yahoo.com/mail/tagline_messenger/*http://uk.messenger.yahoo.
co
<http://uk.rd.yahoo.com/mail/tagline_messenger/*http:/uk.messenger.yahoo.com
/download/index.html> 
m/download/index.html
<http://uk.rd.yahoo.com/mail/tagline_messenger/*http:/uk.messenger.yahoo.com
/download/index.html> >
 
_______________________________________________
DB-SIG maillist  -  DB-SIG at python.org
http://mail.python.org/mailman/listinfo/db-sig
    

 
_______________________________________________
DB-SIG maillist  -  DB-SIG at python.org
http://mail.python.org/mailman/listinfo/db-sig
 
  

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/db-sig/attachments/20050104/773ef7ce/attachment.htm


More information about the DB-SIG mailing list