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
publicSQLTableReadByFieldNameLikeValue(objSQLTable:SQLTable,strFieldName:string,strFieldValue:string):SQLActiveRecord[]{
letobjSQLDatabase:SQLDatabase=objSQLTable.databaseasSQLDatabase;
letstrSQLQuery:string=`SELECT * FROM${objSQLDatabase.name}.${objSQLTable.name} WHERE${strFieldName} LIKE "%${strFieldValue}%";`;
letarrSQLActiveRecord:SQLActiveRecord[]=this.SQLDatabaseReadCustomQuery(objSQLDatabase,strSQLQuery);
returnarrSQLActiveRecord;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
