How to programmatically fill a database
        Posted  
        
            by Dwaine Bailey
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Dwaine Bailey
        
        
        
        Published on 2010-04-22T02:07:54Z
        Indexed on 
            2010/04/22
            2:13 UTC
        
        
        Read the original article
        Hit count: 358
        
Hi There,
I currently have an iPhone app that reads data from an external XML file at start-up, and then writes this data to the database (it only reads/writes data that the user's app has not seen before, though)
My concern is that there is going to be a back catalogue of data of several years, and that the first time the user runs the app it will have to read this in and be atrociously slow.
Our proposed solution is to include this data "pre-built" into the applications database, so that it doesn't have to load in the archival data on first-load - that is already in the app when they purchase it.
My question is whether there is a way to automatically populate this data with data from, say, an XML file or something. The database is in SQLite. I would populate it by hand, but obviously this will take a very long time, so I was just wondering if anybody had a more...programmatic solution...
© Stack Overflow or respective owner