You Are Here:

Community: Developer Discussion Boards

#1 Old [python] Injecting SQL queries from MySQL to e32DB - 2005-10-09, 22:22

Join Date: Feb 2004
Posts: 7
1christian85
Offline
Registered User
I have a lot of data in a MySQL database, I wish to import all this data into the native DBMS of Symbian (e32db). I couldn't find a direct solution for injecting these SQL statements right into the DB so I created a database dump of my MySQL data. Now I'm trying to load all these SQL statements from the dumpfile into e32db but the DBMS just won't import them.

I see that a statement like this is working:

strn = u"INSERT INTO cells (country_id, network, cell, cell_range, postcode, plaats, land, latitude, longitude) VALUES (%d,%d,%d,%d,%d,'%s','%s',%f,%f)"%(204,815,7294606,0,6816,'Arnhem','Netherlands',52.0,5.8)
self.db.execute(strn)

But in my textfile the data is stored as a complete query (no %d notations and stuff).
This doesn't work for instance:
self.db.execute("INSERT INTO cells (country_id, network, cell, cell_range, postcode, plaats, land, latitude, longitude) VALUES ('204','815', '7294606', '0', '6816', 'Arnhem', 'Netherlands', '52.0',5.8)")

Is there another way I can solve this problem? I guess I'm getting a bit lazy since i'm already working on this for two days or so. Is there maybe a direct way to import these queries into e32db?


Thanks in advance.
Reply With Quote

#2 Old Re: [python] Injecting SQL queries from MySQL to e32DB - 2005-10-10, 10:30

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
Sorry, there's no support for directly importing data in any other syntax into e32db. You'll have to parse that data dump and reformat it into the proper form with the quotes removed.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia