Hi. trying to get to grips with DBUTIls and SQL etc, and I've utilised one of the examples given by Erel but I'm sadly at a lost now, whilst the code works populating the 'Spinner' from the database, when I select an item from the list I can't seem to get the syntax right for selecting the information relevant to the entry from the database
so when I select an item it fails with the following error
An error has occurred in
sub:knots_filltext(java line:452)
android database.sqlite.SQLiteException:
no such column: info(code1):, while compiling:
SELECT DISTINCT info FROM SeaKnots WHERE knot = Arbor
Arbor is the selection form the spinner and info is definitely in the table with a value
I can't understand the error given its using the same database in FillSpinners to populate the spinner
Hope that makes some sense and you can point me in the right direction
Cheers
B4X:
Sub FillSpinners
Private Query As String
Query = "SELECT DISTINCT knot FROM " & DBTableName & " ORDER BY knot ASC"
spinner.Clear
DBUtils.ExecuteSpinner(SQL1, Query, Null, 0, spinner)
End Sub
Sub FillText(FCall As String)
Private Query As String
Query = "SELECT DISTINCT info FROM " & DBTableName & " WHERE knot = " & FCall
SQL1.ExecQuerySingleResult(Query)
lblText.Text = Query
End Sub
Sub spnSelect_ItemClick (Position As Int, Value As Object)
Activity.RemoveAllViews
Activity.LoadLayout("Spinner")
FillSpinners
spinner.SelectedIndex = Position
Dim FishCall As String
FishCall = spinner.SelectedItem
Activity.LoadLayout("SeaKnots")
FillText(FishCall)
player1.Initialize("player")
player1.Prepare(player1.CreateFileSource(File.DirAssets, FishCall & ".mp4"))
SimpleExoPlayerView1.Player = player1
player1.Play
End Sub
so when I select an item it fails with the following error
An error has occurred in
sub:knots_filltext(java line:452)
android database.sqlite.SQLiteException:
no such column: info(code1):, while compiling:
SELECT DISTINCT info FROM SeaKnots WHERE knot = Arbor
Arbor is the selection form the spinner and info is definitely in the table with a value
I can't understand the error given its using the same database in FillSpinners to populate the spinner
Hope that makes some sense and you can point me in the right direction
Cheers