Bug? jSQL

ziomorgan

Active Member
Licensed User
Longtime User
I'm using mysql database. If I use alias for a table column the resulset method "GetColumnName" give me the original column name instead of alias. it is normal ?
 

ziomorgan

Active Member
Licensed User
Longtime User
Sure,

B4X:
DBUtils.ExecuteTableView(DBKDM, "SELECT FIELD1 AS 'ALIAS1' FROM tb1 LEFT OUTER JOIN tb2 ON (tb1.ID=tb2.ID) ORDER BY FIELD1", Null, 0, tv)

this is only one but the problem is persistent for all the query (but not for SQLite)
 

ziomorgan

Active Member
Licensed User
Longtime User
Works fine...:)

You can include this change in the jSQL library so that the method GetColumnName return the correct value when working with SQLite and MySQL?

I, at the time, I solved by changing DBUtils:

B4X:
  For i = 0 To cur.ColumnCount - 1
     Dim ColName As String
     If DBType = DBMYSQL Then
       ColName = GetColumnLabel(cur, i)
     Else
       ColName = cur.GetColumnName(i)
     End If
     cols.Add(ColName)
   Next

thanks
 
Top