john.liber

String concatenation with table values

Discussion created by john.liber on Feb 12, 2009
Latest reply on Feb 14, 2009 by carstein.seeberg
I'm trying to determine why concatenation is not working as I expect for this code:


database.open("Driver={SQL Server};Server=Servername;Database=DatabaseName")

tServers = {}

sQuery = "SELECT expression FROM expressionlist"

oExpressions = database.query(sQuery)

for indx,row in pairs(oExpressions) do

   for key,value in pairs(row) do

      print("Test"..tostring(value).."Bar")

   end

end

database.close()




Where "foo" is the value returned from the recordset, the code prints "Testfoo" rather than "TestfooBar".  Any help would be appreciated. 

Thank you!

Outcomes