cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports Improperly Queries INSQL For Non-existant Tags

Former Member
0 Kudos

I bring in my database, it's the one from Wonderware Historian 2014 SP1 Runtime. This is made up by Wonderware and not me. When I do Select Top 1000 rows on the view, it fails out with the same error as in Crystal Reports. If I wipe the pseudo TagName that are automatically populated by SQL, and set my WHERE to something that is specifically in the database, then SQL works fine and returns the query. I realize I may have to reconfigure something in SQL, but I'm wondering if I can change some sort of first run query in Crystal Reports. This would allow me to fix the first query, since I didn't make the database, Wonderware did and is constantly updating and modifying it. Ideas?

The Select Top 1000 goes as following:

OLE DB provider "INSQL" for linked server "INSQL" returned message "History queries must contain at least one valid tagname".

Msg 7320, Level 16, State 2, Line 2

Cannot execute the query "SELECT Tbl1001.DateTime Col1004,Tbl1001.TagName Col1005,Tbl1001.Value Col1006,Tbl1001.vValue Col1007,Tbl1001.Quality Col1008,Tbl1001.QualityDetail Col1009,Tbl1001.OPCQuality Col1010,Tbl1001.wwTagKey Col1011,Tbl1001.wwRowCount Col1012,Tbl1001.wwResolution Col1013,Tbl1001.wwEdgeDetection Col1014,Tbl1001.wwRetrievalMode Col1015,Tbl1001.wwTimeDeadband Col1016 FROM Runtime.dbo.History Tbl1001" against OLE DB provider "INSQL" for linked server "INSQL".

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

If you know the query that returns the data successfully, why not create a command table in CR and use that? To see how to create a command in the CR designer, see the CR Help file (F1) and search for command.

Else, ask Wonderware about how to proceed so that you do not get error 7412. That error is being thrown by the db client and passed through the report engine unmodified.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter

Former Member
0 Kudos

I went into Database Expert and for my connection I clicked 'Add Command'

Wrote:


SELECT * FROM [Runtime].[dbo].[AnalogHistory]

Where TagName LIKE '%'


And now it's fine. Thank you! Didn't realize you could make a command at the connection level.

Answers (1)

Answers (1)

Former Member
0 Kudos

If I replace the default that's brought up with SELECT TOP 1000 ROWS command in SQL Manager it with the following:

SELECT * FROM [Runtime].[dbo].[AnalogHistory]

  Where TagName LIKE '%'

The command runs properly. How do I do this in Crystal Reports 2014 SP5?

former_member183750
Active Contributor
0 Kudos

Crystal Reports 2014 SP5? No such thing as far as I know...

- Ludek

Former Member
0 Kudos

2013, I'm using Wonderware Historian 2014 SP1, I wrote that wrong.