Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
I have a sql statment:
select * from openquery(insql, 'select datetime,[Level_001.PV],[Level_002.PV] from widehistory where datetime >= "2016-12-14" and datetime <= "2016-12-16"')
it works.
but while I changed it to:
select * from openquery(insql, 'select datetime,' || [[TagNames]] || ' from widehistory where datetime >= "2016-12-14" and datetime <= "2016-12-16"')
it doesn't work, the result show me: Incorrect syntax near '|'.
what shall I do in this case
By the way, is there any sql script and java script examples?
You probably need to use String substitution vs. Parameter substitution so use << >> vs. [[ ]]
Now please properly validate and secure the service because you do expose a risk of SQL injection this way.
It still shows me Incorrect syntax near '|' while I changed statment to SELECT * FROM OpenQuery(insql, 'select datetime,' || <<TagNames>> || ' from widehistory where datetime >= "2016-12-14" and datetime <= "2016-12-16"')
Is there any documentation about sql script and java script?