0% found this document useful (0 votes)
329 views1 page

GE IFix SQL Query

The document discusses different ways to set the rowcount value in SQL queries to retrieve data from a historian database. It explains that rowcount can be set to limit the number of returned rows, or set to 0 to retrieve all rows. When rowcount is used, truncation of results occurs on the client side after data is received from the server. Examples of SQL queries are provided to illustrate setting rowcount in the query itself or using a WHERE clause.

Uploaded by

dudanisu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
329 views1 page

GE IFix SQL Query

The document discusses different ways to set the rowcount value in SQL queries to retrieve data from a historian database. It explains that rowcount can be set to limit the number of returned rows, or set to 0 to retrieve all rows. When rowcount is used, truncation of results occurs on the client side after data is received from the server. Examples of SQL queries are provided to illustrate setting rowcount in the query itself or using a WHERE clause.

Uploaded by

dudanisu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

SELECT tagname, timestamp, value FROM ihRawData

WHERE samplingmode=currentvalue
AND timestamp>='11/13/2014 8:00:00'
AND timestamp<='11/13/2014 12:59:59'
AND rowcount=0
AND TAGNAME=specific_tagname
==========================================================================
You can set the rowcount value two different ways in your SQL query statements:
1)
Set RowCount = 10000,
SamplingMode = RawByTime
SELECT TagName, TimeStamp, Value, Quality
FROM ihRawData
WHERE TagName = Simulation00001
AND TimeStamp >= '05-Feb-2007 00:00:00'
AND TimeStamp <= '05-Feb-2007 17:00:00'
ORDER BY TimeStamp DESC
2)
SELECT TagName, TimeStamp, Value, Quality
FROM ihRawData
WHERE TagName = Simulation00001
AND TimeStamp >= '05-Feb-2007 00:00:00'
AND TimeStamp <= '05-Feb-2007 17:00:00'
AND RowCount = 10000
AND SamplingMode = RawByTime
ORDER BY TimeStamp DESC
Notes:
You can fully disable rowcount by setting it to a value of 0.
The truncation of returned rows to the rowcount setting is &
performed on the OLEDB client after the query results have been sent
to the OLEDB client from the Historian server.
================================================================================
=======
SELECT tagname, timestamp, value FROM ihRawData
WHERE samplingmode=currentvalue
and timestamp between '2011/02/25' and '2011/02/27 23:59:59.999'
AND rowcount=0
================================================================================
=====
SELECT tagname, timestamp, value FROM ihRawData
and timestamp >= '2011/02/25 23:59:59.999' and timestamp < '2011/02/28 23:59:59.
999'
and samplingmode=currentvalue
and RowCount = 10000
================================================================================
======

You might also like