Skip to main content
added 7 characters in body
Source Link
XenKid
  • 161
  • 3
  • 16

As of version 3.7.11 SQLite does support multi-row-insert. Richard Hipp comments:

I'm using 3.6.13

I command like this:

insert into xtable(f1,f2,f3) select v1 as f1, v2 as f2, v3 as f3 union select nextV1+, nextV2+, nextV3+ 

With 50 records inserted at a time, it takes only a second or less.

It's true using sqlite to insert multiple rows at a time is very possible. By @Andy wrote.

thanks Andy +1

As of version 3.7.11 SQLite does support multi-row-insert. Richard Hipp comments:

I'm using 3.6.13

I command like this:

insert into xtable(f1,f2,f3) select v1 as f1, v2 as f2, v3 as f3 union nextV1+, nextV2+, nextV3+ 

With 50 records inserted at a time, it takes only a second or less.

It's true using sqlite to insert multiple rows at a time is very possible. By @Andy wrote.

thanks Andy +1

As of version 3.7.11 SQLite does support multi-row-insert. Richard Hipp comments:

I'm using 3.6.13

I command like this:

insert into xtable(f1,f2,f3) select v1 as f1, v2 as f2, v3 as f3 union select nextV1+, nextV2+, nextV3+ 

With 50 records inserted at a time, it takes only a second or less.

It's true using sqlite to insert multiple rows at a time is very possible. By @Andy wrote.

thanks Andy +1

added 315 characters in body
Source Link
XenKid
  • 161
  • 3
  • 16

As of version 3.7.11 SQLite does support multi-row-insert. Richard Hipp comments:

I'm using 3.6.13

I command like this:

insert into xtable(f1,f2,f3) select v1 as f1, v2 as f2, v3 as f3 union nextV1+, nextV2+, nextV3+ 

With 50 records inserted at a time, it takes only a second or less.

It's true using sqlite to insert multiple rows at a time is very possible. By Andy@Andy wrote.

thanks Andy +1

It's true using sqlite to insert multiple rows at a time is very possible. By Andy wrote.

thanks Andy +1

As of version 3.7.11 SQLite does support multi-row-insert. Richard Hipp comments:

I'm using 3.6.13

I command like this:

insert into xtable(f1,f2,f3) select v1 as f1, v2 as f2, v3 as f3 union nextV1+, nextV2+, nextV3+ 

With 50 records inserted at a time, it takes only a second or less.

It's true using sqlite to insert multiple rows at a time is very possible. By @Andy wrote.

thanks Andy +1

deleted 964 characters in body
Source Link
XenKid
  • 161
  • 3
  • 16

Yes, I applied Andy's reply, and it works, BUT, it only inserts upto 7 records out of my 54 records. Why? @Andy , do you have any idea?

Dim dt As DataTable Dim sc As SQLiteCommand Dim Script As String = Nothing Dim Script2 As String = Nothing Dim Script3 As String = Nothing Script = "insert into paperdate(dtime,papernum,paperstat,user) select " & "'" & dt.Rows(0)(0) & "'" & " as " & "dtime" & "," & dt.Rows(0)(1) & " as " & "papernum" & "," & "'" & dt.Rows(0)(2) & "'" & " as " & "paperstat" & "," & "'" & dt.Rows(0)(3) & "'" & " as " & "user" For i As Integer = 1 To dt.Rows.Count - 1 Script2 = " union select " & "'" & dt.Rows(i)(0) & "'" & "," & dt.Rows(i)(1) & "," & "'" & dt.Rows(i)(2) & "'" & "," & "'" & dt.Rows(i)(3) & "'" Script3 = Script3 & Script2 Next sc = New SQLiteCommand(Script & Script3, mycon) sc.ExecuteNonQuery() sc.Dispose() 

I'm sure the loop is fine and data is there, but, really inserts upIt's true using sqlite to 7 records only. Mayinsert multiple rows at a + will do if answers are greatly appreciated?time is very possible. By Andy wrote.

thanks Andy +1

Yes, I applied Andy's reply, and it works, BUT, it only inserts upto 7 records out of my 54 records. Why? @Andy , do you have any idea?

Dim dt As DataTable Dim sc As SQLiteCommand Dim Script As String = Nothing Dim Script2 As String = Nothing Dim Script3 As String = Nothing Script = "insert into paperdate(dtime,papernum,paperstat,user) select " & "'" & dt.Rows(0)(0) & "'" & " as " & "dtime" & "," & dt.Rows(0)(1) & " as " & "papernum" & "," & "'" & dt.Rows(0)(2) & "'" & " as " & "paperstat" & "," & "'" & dt.Rows(0)(3) & "'" & " as " & "user" For i As Integer = 1 To dt.Rows.Count - 1 Script2 = " union select " & "'" & dt.Rows(i)(0) & "'" & "," & dt.Rows(i)(1) & "," & "'" & dt.Rows(i)(2) & "'" & "," & "'" & dt.Rows(i)(3) & "'" Script3 = Script3 & Script2 Next sc = New SQLiteCommand(Script & Script3, mycon) sc.ExecuteNonQuery() sc.Dispose() 

I'm sure the loop is fine and data is there, but, really inserts up to 7 records only. May a + will do if answers are greatly appreciated?

thanks

It's true using sqlite to insert multiple rows at a time is very possible. By Andy wrote.

thanks Andy +1

added 927 characters in body
Source Link
XenKid
  • 161
  • 3
  • 16
Loading
Source Link
XenKid
  • 161
  • 3
  • 16
Loading