×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Feb 2004
    Posts
    7

    [python] Injecting SQL queries from MySQL to e32DB

    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.

  2. #2
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: [python] Injecting SQL queries from MySQL to e32DB

    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.

Posting Permissions

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