After inserting 1000 records, the sqlite database will overwrite the previous data and cannot add more data.

Source: Internet
Author: User
Insertinto is used to continuously insert data. However, after a table reaches 1000, it is found that no data can be added. The newly inserted data may overwrite the previous data. What should we do? I switched to my colleagues' database software and found that there were only 1000 pieces of data. Insert into is used to insert data continuously. However, after a table reaches 1000, no data can be added. The newly inserted data may overwrite the previous data.
What should we do?

I switched to my colleagues' database software and found that there were only 1000 pieces of data.

Reply content:

Insert into is used to insert data continuously. However, after a table reaches 1000, no data can be added. The newly inserted data may overwrite the previous data.
What should we do?

I switched to my colleagues' database software and found that there were only 1000 pieces of data.

Answer questions

Not understandphpBut also recentlysqlite3, No subject issues found.

Because I don't know how to use itsqlTo insert 1000 data records cyclically.rubyCode to implement

require 'sqlite3'db = SQLite3::Database.new 'test.db'db.execute "create table tbname (id int);"(1..1005).each {|i| db.execute "insert into tbname values (#{i});" }db.execute "select * from tbname limit 5"  #=> 1 2 3 4 5db.execute "select * from tbname limit 5 offset 1000"  #=> 1001 1002 1003 1004 1005

Note:

  • db.executeThe following string, that is, executablesqlStatement,#{i}That isRubyVariable replacement

  • You can trysqlite3In the console.limitTo check whether overwrite occurs.

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.