Unknown column in field list

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Quinton B.
Posts: 108
Joined: Mon Mar 20, 2017 5:13 am

Unknown column in field list

Post by Quinton B. » Thu Jul 06, 2017 1:32 am

Hello, I'm currently running MySQL and when using an insert statement the following error displays "Unknown column " " in 'Filed List'" I have no idear what it is squeaking about. I have the column in the database and this is the insert statement:

put "INSERT INTO precheckopen (LogInLocation, LogInCounter, DeviceName, DateAndTime) VALUES (" & tEndLocation &","& tRecordsFinal &","& tDeviceName &"," & tDateAndTime &");" into tSQL
revExecuteSQL gDatabaseID, tSQL
answer the result

Please Help, its really quite annoying :lol: .

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Unknown column in field list

Post by MaxV » Fri Jul 07, 2017 1:27 pm

Quote the columns names with the apostrophe character ' .
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Quinton B.
Posts: 108
Joined: Mon Mar 20, 2017 5:13 am

Re: Unknown column in field list

Post by Quinton B. » Sat Jul 08, 2017 11:27 pm

That only inputs the names tEndLocation, tRecordsFinal, etc.. Doesn't input the data as these are variables.

SparkOut
Posts: 2947
Joined: Sun Sep 23, 2007 4:58 pm

Re: Unknown column in field list

Post by SparkOut » Sun Jul 09, 2017 9:35 am

He meant quote the column names 'LogInLocation' etc.

Where does the "Filed List" come from? Is there a typo somewhere in some other code and it should be "Field List"?

Better in the end to try the " placeholder " syntax and see if that sorts out any escaping glitches or other. The error message doesn't give enough information to tell without seeing more of your code and table structure.

Code: Select all

put "INSERT INTO precheckopen ('LogInLocation','LogInCounter', 'DeviceName', 'DateAndTime') VALUES (:1,:2,:3,:4)" into tSQL
revExecuteSQL gDatabaseID, tSQL,"tEndLocation","tRecordsFinal","tDeviceName","tDateAndTime"

Quinton B.
Posts: 108
Joined: Mon Mar 20, 2017 5:13 am

Re: Unknown column in field list

Post by Quinton B. » Tue Jul 11, 2017 10:51 pm

This still isn't working:

put "INSERT INTO precheckopen ('LogInLocation','LogInCounter','DeviceName','DateAndTime') VALUES (:1,:2,:3,:4)" into tSQL
revExecuteSQL gDatabaseID, tSQL, "tEndLocation","tRecordsFinal","tDeviceName","tDateAndTime"
Attachments
Capture.PNG
Capture.PNG (10.84 KiB) Viewed 6819 times

MaxV
Posts: 1580
Joined: Tue May 28, 2013 2:20 pm
Contact:

Re: Unknown column in field list

Post by MaxV » Wed Jul 12, 2017 1:16 pm

Try this:

Code: Select all

answer  (tEndLocation, tRecordsFinal, tDeviceName , tDateAndTime)
put "INSERT INTO precheckopen ('LogInLocation','LogInCounter', 'DeviceName', 'DateAndTime') VALUES (':1',':2',':3',':4')" into tSQL
revExecuteSQL gDatabaseID, tSQL,"tEndLocation","tRecordsFinal","tDeviceName","tDateAndTime"
It seems that:
  • tEndLocation = ""
  • tRecordsFinal=""
  • tDeviceName=
  • tDateAndTime=
Quoting values reduces interpretation errors of MySQL
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply