DButils - First query out of 1

thewavemaster

Member
Licensed User
Longtime User
Im playing around with the DButils example....


When I try to add new data I always get a " First query out of 1 ..." Error in the logfile...what am I doing wrong? What means that?
 

thewavemaster

Member
Licensed User
Longtime User
This is the Sub where I try to add something...:
B4X:
Sub Speichern_Click


Dim ListOfMaps As List
ListOfMaps.Initialize
Dim maps1 As Map

maps1.Initialize
maps1.Put("ID",DateTime.Now)
maps1.Put("Datum", "01.02.2013")
maps1.Put("Titel", "Meeting")
maps1.Put("Startzeit", "09:00")
maps1.Put("Endzeit", "14:00")
maps1.Put("Ort", "München")
maps1.Put("KalenderID", "1")
maps1.Put("Kontakte", "Martin, Diana, Alex ")
maps1.Put("Beschreibung", "Besprechung bzgl. Implementierung wichtiger Punkte in die Datenbank")
maps1.Put("Alarm", "")
ListOfMaps.Add(maps1)

DBUtils.InsertMaps(Main.SQL1,"Kalender1",ListOfMaps)


End Sub

And this is ther error log:
InsertMaps (first query out of 1): INSERT INTO [Kalender1] ([ID], [Datum], [Titel], [Startzeit], [Endzeit], [Ort], [KalenderID], [Kontakte], [Beschreibung], [Alarm]) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
 
Upvote 0

derez

Expert
Licensed User
Longtime User
Your table includes only 1 row, since the list has only one map (=maps1).
using dbutils you can update this row (using updaterecord) or update the whole table using your original list of maps but with more maps in the list.

if you want to add a row to the already existing table you can simply use sql commands - SQL.ExecNonQuery2("INSERT INTO .....
To update an existing row - use SQL.ExecNonQuery2("UPDATE .....
 
Last edited:
Upvote 0

derez

Expert
Licensed User
Longtime User
Yes you are right.
I looked at the code and saw that it uses "INSERT INTO...
The log that you get is not an error, it is caused by this line in the insertmaps sub:
B4X:
If i1 = 0 Then Log("InsertMaps (first query out of " & ListOfMaps.Size & "): " & sb.ToString)
which means that you don't have an error...you have a report that you added one line.
 
Upvote 0
Top