I have successfully connect a model to a SQL database but am having trouble with getting the syntax correct when importing. Ultimately I want to do this with code but have been experimenting using the Import tool while I figure out the syntax. I would like to do a query along the lines of
SELECT * FROM ItemWorkComplete WHERE Line = "HIGH"
However I get the error: Invalid column name 'HIGH'
When I try a different statement like the one below it works as expected.
SELECT * FROM ItemWorkComplete ORDER BY Line ASC
I was also able to successfully run the following in the script window. Just can't seem to work out the WHERE clause.
Database.Connection dbConnection = Database.Connection("DBconnector_IIoT_LocalDev"); dbConnection.connect(); string vsQuery = "SELECT * FROM ItemWorkComplete ORDER BY Line ASC "; Database.ResultSet dbQuery = dbConnection.query(vsQuery); dbQuery.cloneTo(Table("GlobalTable2")); dbConnection.disconnect();
Can anyone tell me what I'm missing here? I need to be able to limit what I pull into a table and I was hoping to do it with a query.