473,399 Members | 3,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Oracle to Mysql, I'm (still) lost...

Hello all,

I still can't convert Oracle tables to a Mysql database. See thread:
http://groups.google.com/groups?hl=e...hreadm=mailman.
282.1073834719.12720.python-list%40python.org&rnum=1&prev=/groups%3Fsourceid
%3Dmozclient%26ie%3Dutf-8%26oe%3Dutf-8%26q%3Dpython%2Boracle%2Bmysql

The tables in Oracle and Mysql are the same. Is there anyone who can help me
with this?

Thanks in advance,

Arjen

#######code######
import cx_Oracle, MySQLdb
from time import time

tabellen=["machine", "machinegroup", "machines", "operation", "orders",
"run", "step"]

tijd=time()
conO=cx_Oracle.connect("some/some")
cursO=conO.cursor()
conMy=MySQLdb.Connect("localhost", db="some")
cursMy=conMy.cursor()

for tabel in tabellen:
cursO.execute("select * from " + tabel)
cursMy.execute("truncate " + tabel)
#print cursO.description
a_oracle=cursO.fetchone()
cursMy.execute("insert into %s values %s", (tabel, a_oracle))

conO.close()
conMy.close()
print "\n\nklaar in :\n"
print time()-tijd, " seconden\n\n"

#####error####
Traceback (most recent call last):
File "A:/tabellen2.py", line 20, in ?
cursMy.execute("insert into %s values %s", (tabel, a_oracle))
File "E:\Python23\Lib\site-packages\MySQLdb\cursors.py", line 95, in
execute
return self._execute(query, args)
File "E:\Python23\Lib\site-packages\MySQLdb\cursors.py", line 114, in
_execute
self.errorhandler(self, exc, value)
File "E:\Python23\Lib\site-packages\MySQLdb\connections.py", line 33, in
defaulterrorhandler
raise errorclass, errorvalue
ProgrammingError: (1064, 'You have an error in your SQL syntax. Check the
manual that corresponds to your MySQL server version for the right syntax to
use near \'\'machine\' values ("\'230KM\'", "\' \'", "\'230KM\'",
"\'1980-01-01 00:')

Jul 18 '05 #1
0 1165

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mark Wilson CPU | last post by:
A colleague has written a prototype program in PHP, using a MySQL database. It's a relatively simple app, with a restricted set of mysql commands used (see below). The MySQL DB is being replaced...
38
by: Mike | last post by:
No flame wars, please! We're planning a move from a non-relational system to a relational system. Our choices have been narrowed to Oracle and DB2. Since we're moving from non-relational to...
133
by: jonathan | last post by:
hey all, I realize that this question might pop up from time to time, but I haven't seen it a while and things might of changed, so - Right now (July 2004) how does mysql stand up in...
1
by: Cern | last post by:
Is it somebody out there who has made a migration from an Oracle server to an MySQL server?? The scenario is as simply: I've got a Oracle 8 server with a database with content that I want to...
4
by: Jan Olsen | last post by:
We're planning an SQL-based solution, possibly mySQL for Windows or Linux. But some in the organization might favor Oracle. Are there any particular pitfalls of using mySQL instead of Oracle? ...
0
by: Mr Seth T | last post by:
I am creating a web app that needs to distribute to be able to be distributed to MySQL sites and Oracle sites. So far I have developed it for MySQL and now I am going back and adding Oracle...
110
by: alf | last post by:
Hi, is it possible that due to OS crash or mysql itself crash or some e.g. SCSI failure to lose all the data stored in the table (let's say million of 1KB rows). In other words what is the worst...
13
by: Ciaran | last post by:
Hi All, Is it faster to have mySql look up as much data as possible in one complex query or to have php do all the complex processing and submit lots of simple queries to the mysql database? ...
4
by: --CELKO-- | last post by:
I need to convert a bunch of DB2 triggers to Oracle. Is there any kind of tools for this?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.