Skip to main content
Data Management
Asset Framework
OSIsoft PI System

Using Parameterized Queries in PI AF Link Tables for Text Search

Explore how parameterized queries can enhance text searching capabilities in PI AF Link Tables, optimizing performance and flexibility.

Roshan Soni

4 min read

Using Parameterized Queries in PI AF Link Tables for Text Search

In industrial operations, data management is crucial for monitoring processes and making informed decisions. OSIsoft's PI System stands out as a comprehensive data infrastructure solution, and one of its powerful features is the Asset Framework (AF), which supports enhanced data organization and retrieval. Within the AF, Link Tables offer substantial benefits for integrating external data sources. However, efficiently managing these integrations, especially when dealing with large tables, often requires strategic approaches, such as using parameterized queries.

The Challenge: Efficient Text Lookup

Often, as engineers and data scientists, we find ourselves needing to look up information based on partially known values. For instance, a user might want to search for equipment details using a portion of the serial number or a specific keyword within a longer description. However, directly searching large tables can be inefficient and performance-impacting.

Solution: Parameterized Queries

Parameterized queries come into play here, allowing users to dynamically influence query behavior from PI Asset Framework client tools such as PI System Explorer. With parameterized queries, it's possible to return only the subset of data that matches the criteria input by the user, effectively reducing the table size that the system needs to handle.

Benefits of Parameterized Queries:
  1. Performance Improvement: By limiting the amount of data returned from queries, parameterized approaches reduce the load and improve performance. This is especially significant when dealing with large datasets.

  2. Enhanced Flexibility: Users can control the granularity of their data searches by inputting specific keywords or patterns they expect to find within the text fields of the Link Tables.

  3. Data Security: Limiting results to only what is necessary also contributes to data privacy and security, ensuring that less sensitive data is transmitted or exposed during operations.

How to Implement Parameterized Queries in AF Link Tables

  1. Define the Table Connection: First, set up your AF Link Table to connect to the desired external data source.

  2. Configure the Parameterized Query: When defining the query, use placeholders for the parameters. These placeholders will be replaced by actual values at runtime.

    Example:

    SELECT * FROM EquipmentDetails WHERE Description LIKE '%' + ? + '%'
    

    Here, the ? symbol acts as a placeholder for the partial text input the user provides.

  3. Set Up Dynamic Attributes: In PI AF, configure the attributes that will utilize these queries. Attributes can be set to pass user-input values as parameters to these queries, seamlessly integrating the dynamic functionality.

  4. Test and Deploy: Before deploying in a production environment, thoroughly test the queries to ensure they return expected results without performance drawbacks.

Conclusion

By leveraging parameterized queries within PI AF Link Tables, users can enhance both the efficiency and specificity of their data integration tasks. This approach not only optimizes performance but also empowers users with sophisticated search capabilities, which are pivotal for operational intelligence and decision-making.

For further guidance, OSIsoft's official documentation offers in-depth instructions and examples. Keeping abreast with these resources ensures you utilize the full potential of PI System's offerings in data management and analytics.


Using parameterized queries strategically optimizes data handling in PI AF Link Tables, providing both performance enhancements and operational flexibility.

Tags

#PI System
#AFSDK
#Parameterized Queries
#Data Lookup
#Performance Optimization

About Roshan Soni

Expert in PI System implementation, industrial automation, and data management. Passionate about helping organizations maximize the value of their process data through innovative solutions and best practices.

Sign in to comment

Join the conversation by signing in to your account.

Comments (0)

No comments yet

Be the first to share your thoughts on this article.

Related Articles

Enhancing PI ProcessBook Trends with Banding and Zones: User Needs, Workarounds, and the Road Ahead

A look at the user demand for trend banding/zoning in OSIsoft PI ProcessBook, current VBA workarounds, UI challenges, and how future PI Vision releases aim to address these visualization needs.

Roshan Soni

Migrating PIAdvCalcFilVal Uptime Calculations from PI DataLink to PI OLEDB

Learn how to translate PI DataLink's PIAdvCalcFilVal advanced calculations—like counting uptime based on conditions—into efficient PI OLEDB SQL queries. Explore three practical approaches using PIAVG, PIINTERP, and PICOunt tables, and get tips for validation and accuracy.

Roshan Soni

Understanding PI Web API WebID Encoding: Can You Generate WebIDs Client-Side?

Curious about how PI Web API generates WebIDs and whether you can encode them client-side using GUIDs or paths? This article explores the encoding mechanisms, current documentation, and best practices for handling WebIDs in your applications.

Roshan Soni