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.