How to insert data in batches in the SQLite database?

Source: Internet
Author: User
Welcome to the Oracle community forum and interact with 2 million technical staff to access the SQLite database. How can we efficiently insert batch data into the database? This article introduces this method. Let's take a look at it. The procedure is as follows: first, use Access to open the mdb file. Export to a txt file.

Welcome to the Oracle community forum to interact with 2 million technical staff> how can we efficiently insert batch data into the database in SQLite database? This article introduces this method. Let's take a look at it. The procedure is as follows: first, use Access to open the mdb file. Export to a txt file.

Welcome to the Oracle community forum and interact with 2 million technical staff> enter

SQLite DatabaseHow to efficientlyBatch DataInsert to database? This article introduces this method. Let's take a look at it.

The procedure is as follows:

First, use Access to open the mdb file. Export to a txt file. Since SQLite is used in linux, the encoding must be changed to Unicode, And the separator should be separated by commas (,) to be imported to SQLite later)

Step 2: import the file to linux

Terminal


    > Sqlite3 abc. db

    SQLite version 3.6.22

    Enter ". help" for instructions

    Enter SQL statements terminated with ";"

    Sqlite>

    Enter a database that has been created


      Sqlite> create table eee (id integer primary key,

      Number NUMERIC, code NUMERIC, city TEXT, citytype TEXT );

      Create a table whose fields and data types correspond to the data and data types in the txt file.


        Sqlite>. separator "," // set the delimiter to comma, which is consistent with the delimiter set in the previous export.

        Sqlite>. import list.txt eee // import the content on list.txt to the table eee

        At this point, batch data has been successfully inserted into SQLite.

        We will introduce the knowledge of the SQLite database here, and hope this introduction will bring you some gains.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.