Hi Sqlite Team,

I am trying to Insert values into New Table "Ticket" from
Table1,Table2,Table3 and Table4 with the following Query but its taking alot
of time to insert values in new table.
VB.NET + SQLITE using ADO.net connection ( Its having 25k+ rows)

*Option 1:*

----------------------------------------------------------------
cons.Open()
Dim tx = cons.BeginTransaction()
Dim mycommand As SQLiteCommand = New SQLiteCommand(cons)

mycommand.CommandText = "INSERT INTO [" & ticket & "] select * from
Temp_Table1 T1 ,Temp_Table2 T2,Temp_Table3 T3,Temp_Table4 T4 where t1.[Prod
Sr No] in (select Distinct [Prod Sr No] from Temp_Table1 T1) and T1.docid =
T2.docid and T1.docid = T3.docid and T1.docid = T4.docid"

mycommand.ExecuteNonQuery()
tx.Commit()
cons.Close()
----------------------------------------------------------------


*Option 2:* ( i also Tried in this way :)

----------------------------------------------------------------
cons.Open()
dim z as integer
Dim tx = cons.BeginTransaction()
Dim mycommand As SQLiteCommand = New SQLiteCommand(cons)
Dim myparam As SQLiteParameter = New SQLiteParameter

mycommand.CommandText = "INSERT INTO [" & ticket & "] select * from
Temp_Table1 T1 ,Temp_Table2 T2,Temp_Table3 T3,Temp_Table4 T4 where
t1.rowid=" & Z & " and T1.docid = T2.docid and T1.docid = T3.docid and
T1.docid = T4.docid"
mycommand.Parameters.Add(myparam)
For Z = 1 To count1
myparam.Value = Z + 1
mycommand.ExecuteNonQuery()
Next
tx.Commit()
cons.close()
----------------------------------------------------------------

while executing simple INSERT / SELECT command from Option1 on sqlite
browser it's Faster there but excuting with VB.NET ,its taking alot of time.


*please give your Concern as soon as possible :-|*

Regards,
Alok
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to