Is it possible to insert multiple rows at a time in an SQLite database?

后端 未结 24 3262
猫巷女王i
猫巷女王i 2020-11-21 06:12

In MySQL you can insert multiple rows like this:

INSERT INTO \'tablename\' (\'column1\', \'column2\') VALUES
    (\'data1\', \'data2\'),
    (\'data1\', \'da         


        
24条回答
  •  后悔当初
    2020-11-21 06:38

    you can use InsertHelper, it is easy and fast

    documentation: http://developer.android.com/reference/android/database/DatabaseUtils.InsertHelper.html

    tutorial: http://www.outofwhatbox.com/blog/2010/12/android-using-databaseutils-inserthelper-for-faster-insertions-into-sqlite-database/

    Edit: InsertHelper is deprecated as of API Level 17

提交回复
热议问题