Tag historian and SQL database

I think I want to use the tag historian to get row from a database so I can make a histogram...

1st question: Am I overthinking this? (is there an easier way to do this?)

2nd question: I definitely don't want to modify the database. Is the tag historian capable of that? If so, how do I prevent that from happening?

Thanks!

Why do you think that?

That depends on what you mean by modify.

To be honest, I'm not sure. I'm really new to Ignition. Our company adopted it a while back, but I had been doing statistics in PowerBI and was encouraged to port my dashboards over to Ignition.

Modify as in, I don't want to change any data in the SQL database, I just want to look at it and use it in a chart.

How is the data getting into the database? Is it being stored by the Tag Historian or is there another process like Transaction groups, scripting, or some third party software that is collecting the data?

Also, is this in Vision or Perspective?

Short answer: Our software.

The data is from one of our processes. So it will have information for each pieces like date and time manufactured, cycle time, target weight, actual weight, serial number, etc.

Perspective

Thanks!

Then the answer is that you will want to use a query to pull the data. Some combination of NamedQueries, Bindings, and Scripting. There are of course ways to build the query in script, but NamedQueries would be considered best practice in most cases.

Checkout the following:

https://docs.inductiveautomation.com/display/DOC81/Named+Queries
https://docs.inductiveautomation.com/display/DOC81/system.db.runNamedQuery
https://docs.inductiveautomation.com/display/DOC81/system.db.runPrepQuery
https://docs.inductiveautomation.com/display/DOC81/system.db.runScalarPrepQuery

So basically build a query like I did in PowerBI and use it as a data source for a chart?

Thanks again!

You might find this of some use, as well.