(Answer) (Category) MSO Technologies FAQ : (Category) Software tips & tricks : (Category) InSQL :
Updating data in Wonderware Historian
Wonderware Historian will let you insert new data, or update existing data using two methods. One is an sql statement thru sql server and the other is by placing a csv file in the DataImport Directory. For complete documentation refer to the InSQL90Admin.pdf.

Here is how to submit the csv file: starting at page 142 in the pdf:
The default import directory is in the InSQL\DataImport folder.

You can update via sql or a csv file.
Example csv file

The first line will be ASCII The second line is the delimiter. The third line is a user name, 1=local or 0=utc, name of the time zone for display can be 'Server Local' to match historian, missing block behaviour 0=dont create 1=create , how to create timespan for replacement blocks 1=based on csv, 0=from first data to the present time.

 
Lines 4 and on are data lines. Each data line is the form tagname,start date,start time,end date,end time, 0 (=eu) or 1 (=raw),value,quality


SQL to update data: SELECT * FROM OPENQUERY(INSQL, 'UPDATE History SET Value = 1, QualityDetail = 192 WHERE TagName = "Manual_AD32SI1" AND DateTime > "2002-10-03 14:59:59" AND DateTime < "2002-10-03 16:00:00" ')

Inserting by SQL requires you to know table names. INSERT INSQL.Runtime.dbo.AnalogHistory (DateTime, TagName, Value, QualityDetail) VALUES ('1999-11-11 16:05:10', 'NonIOTag1', 56, 192) INSERT INTO INSQL.Runtime.dbo.History (DateTime, TagName, Value, wwTimeZone, wwVersion) VALUES ('1999-11-11 16:05:10', 'IOstring1', 'Batch 10', 'Eastern Standard Time', 'latest')

[Append to This Answer]
address-suppressed
This document is: http://www.msotech.com/cgi-bin/fom?file=55
[Search] [Appearance]
This is a Faq-O-Matic 2.721.
This FAQ administered by ...