WW Intouch Sql Select

swayne76

Member
Join Date
Jan 2012
Location
ohio
Posts
43
Hello,
I have an Intouch application that I am using a Sql select script to retrieve information from a database.

SQLSelect(ConnectionId,"Table1", "values","column1='123456'","");

This is working. What i am needing help with is how do i reference a tag value instead of '123456'.


Thanks
 
Do you have to have Intouch Historian to connect from Intouch to SQL or can you connect directly from Intouch to SQL?
 
Thanks for the replies. I have already created the bind list and I am retrieving data when i manually type a number in the "Where" expression. JaxGTO I believe that is the syntax I was looking for. Tried just about everything else lol. I dont think i had my "+" sign in correctly when i tried that syntax. I will try it Monday morning at update. Thanks again for your help!
 
Sorry I have another question. How do i return the data from just one other column? Right now I am returning data from 5 other columns that are referencing the string tag from column 1.

Thanks
 
SQLSelect(ConnectionId,"Table1", "values","column1='" + stringtag + "' and column2='" + stringtag2 + "'","");

Your where clause can be anything you can use in an SQL Select statement including match and SQL functions. And the last "" in the select can be used to Order By, for example "Column1" will sort by that column and "Column1 desc" will sort in descending order.
 

Similar Topics

Hi, I have an intouch 9.5 project passing data to a MS SQL 2005, all good so far. I want to upgrade my HMI project to 2014R2, and SQL to 2012, but...
Replies
0
Views
1,109
I've tried following "Wonderware InTouch HMI Supplementary Components Guide" but the value from sql not appear on intouch runtime screen. I...
Replies
25
Views
12,584
Hi, I want to connect the Intouch and MS SQL Server. But now I cannot access the SQL Server into MS SQL Server, the message was showing Invalid...
Replies
4
Views
6,961
I have a wonderware standalone HMI collecting process data from our production line. I am writing those values to a database in MySQL, though I...
Replies
0
Views
2,711
Hello All how to compare SQL table's columns in InTouch and reflects result in InTouch Tag to start logging in another SQL table... 1. I have...
Replies
0
Views
2,911
Back
Top Bottom