I have a table named STATIONS. In that table I have a column that contains function names. I am selecting a function name and trying to execute it. Below is my snippet of code:
require “sqlite3”
local path = system.pathForFile(“trains.db”, system.DocumentsDirectory)
db = sqlite3.open( path )
local train1SQL = "SELECT T_STATIONS.FILE FROM T_STATIONS
WHERE T_STATIONS.NAME = ‘Train1’
for row in db:nrows(train1SQL) do
local runThisTrain = row.FILE
runThisTrain()
end
row.File contains the function name that I am returning from the select statement. “runThisTrain” produces a Corona runtime error saying that I am attempting to call a string value.