AnsweredAssumed Answered

Data viewer execute sql errors

Question asked by charlesdtilton on Aug 8, 2017
Latest reply on Aug 9, 2017 by fmpdude

I really like how the new data viewer in version 16 shows hints for ExecuteSql statements that are not working correctly.  However in trying to track down a problem with a script I came across this, and I am not sure what it means.


Screen Shot 2017-08-08 at 10.42.25 PM.pngNotice the column name referenced in the SELECT statement is for 'sep2011invoice', but the result seems to indicate the SELECT is looking for a column of a completely different name 'Dec13OrientationGoingPlaces'.  I closed the file thinking it was a one-off error, but it reappeared with a column name entirely different from the first two.


Screen Shot 2017-08-08 at 11.23.04 PM.png  The column name referenced by the ExecuteSql statement is as before but now the data viewer results show an entirely different column 'Jan12ColorGoingPlaces'.


Screen Shot 2017-08-08 at 11.24.12 PM.png


Lastly, I completed removed the column name from the statement and it did not affect the results.  It appears that the data viewer is ignoring the column name referenced in the ExecuteSql statement for a column name that was dynamically generated in a script as a local variable even after the script has ended.  But how can that be?


This could explain the abnormalities with the script results, but I am at a loss to explain the explanation provided in the results section of the data  viewer.  And could my hypothesis be correct about referencing a column name stored in a local variable from a script that has ended?


Any help?