Alexander Stolte Expert Licensed User Longtime User Jul 17, 2020 #1 Hey, on B4A we need a map of the fields and types and on B4I we need 2 lists? B4X: DBUtils.CreateTable(main_sql,"mytable",CreateMap("id":DBUtils.DB_INTEGER),"id") That makes double work.
Hey, on B4A we need a map of the fields and types and on B4I we need 2 lists? B4X: DBUtils.CreateTable(main_sql,"mytable",CreateMap("id":DBUtils.DB_INTEGER),"id") That makes double work.
Erel B4X founder Staff member Licensed User Longtime User Jul 17, 2020 #2 You should use DBUtils2: https://www.b4x.com/android/forum/threads/b4x-dbutils-2.81280/ This is the newer version and it is cross platform. 1. It uses two lists. 2. It doesn't make double work. The difference between writing the map based code to two lists based code will not take you more than 30 seconds. 3. The secret reason behind it is: maps in B4i do not preserve the order so we cannot use a map here (tip: use B4XOrderedMap if you need to preserve order) Upvote 0
You should use DBUtils2: https://www.b4x.com/android/forum/threads/b4x-dbutils-2.81280/ This is the newer version and it is cross platform. 1. It uses two lists. 2. It doesn't make double work. The difference between writing the map based code to two lists based code will not take you more than 30 seconds. 3. The secret reason behind it is: maps in B4i do not preserve the order so we cannot use a map here (tip: use B4XOrderedMap if you need to preserve order)
Alexander Stolte Expert Licensed User Longtime User Jul 17, 2020 #3 Erel said: ou should use DBUtils2: https://www.b4x.com/android/forum/threads/b4x-dbutils-2.81280/ Click to expand... I already use this library ? But on B4A i need a map instead of 2 list like in B4I ? Upvote 0
Erel said: ou should use DBUtils2: https://www.b4x.com/android/forum/threads/b4x-dbutils-2.81280/ Click to expand... I already use this library ? But on B4A i need a map instead of 2 list like in B4I ?
Erel B4X founder Staff member Licensed User Longtime User Jul 17, 2020 #5 You are correct... It got evolved like this from the two older, platform specific, DBUtils. It will be modified in the future with an additional CreateTable method. Upvote 0
You are correct... It got evolved like this from the two older, platform specific, DBUtils. It will be modified in the future with an additional CreateTable method.
TILogistic Expert Licensed User Longtime User Jul 17, 2020 #6 Erel said: You should use DBUtils2: https://www.b4x.com/android/forum/threads/b4x-dbutils-2.81280/ This is the newer version and it is cross platform. 1. It uses two lists. 2. It doesn't make double work. The difference between writing the map based code to two lists based code will not take you more than 30 seconds. 3. The secret reason behind it is: maps in B4i do not preserve the order so we cannot use a map here (tip: use B4XOrderedMap if you need to preserve order) Click to expand... 3. The secret reason behind it is: maps in B4i do not preserve the order so we cannot use a map here (tip: use B4XOrderedMap if you need to preserve order) Click to expand... ?????? Upvote 0
Erel said: You should use DBUtils2: https://www.b4x.com/android/forum/threads/b4x-dbutils-2.81280/ This is the newer version and it is cross platform. 1. It uses two lists. 2. It doesn't make double work. The difference between writing the map based code to two lists based code will not take you more than 30 seconds. 3. The secret reason behind it is: maps in B4i do not preserve the order so we cannot use a map here (tip: use B4XOrderedMap if you need to preserve order) Click to expand... 3. The secret reason behind it is: maps in B4i do not preserve the order so we cannot use a map here (tip: use B4XOrderedMap if you need to preserve order) Click to expand... ??????