Function: SQL Table Read By Field Name Like Value

by Simon Sparks · 4 February 2026

To use this function add it to the class library file named OrchestratorPluginSQLService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: OrchestratorPluginSQLService.ts

Description: Orchestrator Function to Read Records by Field Name Like Value from an SQL Table

Private Function: SQLTableReadByFieldNameLikeValue

public SQLTableReadByFieldNameLikeValue(objSQLTable: SQLTable, strFieldName: string, strFieldValue: string): SQLActiveRecord[] {

    let objSQLDatabase: SQLDatabase = objSQLTable.database as SQLDatabase;

    let strSQLQuery: string = `SELECT * FROM ${objSQLDatabase.name}.${objSQLTable.name} WHERE ${strFieldName} LIKE "%${strFieldValue}%";`;

    let arrSQLActiveRecord: SQLActiveRecord[] = this.SQLDatabaseReadCustomQuery(objSQLDatabase, strSQLQuery);

    return arrSQLActiveRecord;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like