Filtering with SQL
When you build a custom filter, you can use the Extend filter with user-defined SQL condition to specify or append a SQL query. RunMyJobs uses a subset of the SQL92 standard. When running SQL as part of a custom filter, you do not have to specify the WHERE
clause.
To write your own custom SQL, you must have knowledge of the RunMyJobs data model.
Tip: SQL can also be used with report definitions, RedwoodScript, REL expressions, and SchedulerSession.executeQuery().
Warning: Depending on the underlying database, these functions may not always return the expected value. Please see the documentation of your database vendor for implementation specifications.
Note: Query results are ordered by UniqueId
; this cannot be changed.
Example
This example extends a filter on Credentials to list only Credentials with the SOAP CredentialProtocol.
Credential.CredentialProtocol in (select CredentialProtocol.UniqueId from CredentialProtocol where CredentialProtocol.Name = 'soap')
This will create the following query:
SELECT Credential.*, Credential.UniqueId as c_1 FROM Credential WHERE ((Credential.CredentialProtocol in (select CredentialProtocol.UniqueId
from CredentialProtocol where CredentialProtocol.Name = 'soap'))) ORDER BY c_1 ASC