Android Question Variables from database

PABLO2013

Well-Known Member
Licensed User
Longtime User
Greetings, wish to create varibles from a text column of a database

or how i could do this


thanks

ejm:

Cursor1=SQL1.ExecQuery("SELECT Name FROM db ")

For i=0 To Cursor1.RowCount-1

Cursor1.Position=i

Dim Cursor1.GetString("Name") as String


Next
 

PABLO2013

Well-Known Member
Licensed User
Longtime User
Thanks for your answer , I understand what a text and an object, and that the code (Dim Cursor1.GetString("Name") as SimpleMatrix) is a mistake, but I want is to use data(Column - Names) of the database to create these names the names of variables of matrices , not if this may, in any case thanks .

B4X:
Cursor1=SQL1.ExecQuery("SELECT Name FROM db ")

For i=0 To Cursor1.RowCount-1

Cursor1.Position=i

Dim Cursor1.GetString("Name") as SimpleMatrix

Next

I try the second code, but, if I put more SimpleMatrix, limits the amount of matrices in the array (in this case, 9)


B4X:
Dim SM0, SM1, SM2, SM3, SM4, SM5, SM6, SM7, SM8, SM9 ....(i need +- according to database).... As SimpleMatrix (i in this case lose the names)

Dim MTX() As SimpleMatrix
MTX = Array As SimpleMatrix(SM0, SM1, SM2, SM3, SM4, SM5, SM6, SM7, SM8, SM9)


Cursor1=SQL1.ExecQuery("SELECT No,count(*) As Cantidad FROM persons group by No")
For i=0 To Cursor1.RowCount-1
Cursor1.Position=i

Log(Cursor1.GetString("No")&" - "&Cursor1.GetString("Cantidad"))

MTX(i).Initialize(Cursor1.GetString("Cantidad"),Cursor1.GetString("Cantidad"))
MTX(i).SetDouble(1)
Next
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…