Table join between JobDefinition and Job

In RunMyJobs, It is not possible to query the Job table to find certain jobs of a specific JobDefinition. When querying Job-table, the function job.getJobDefinition() can be used to retrieve the job's JobDefinition, but this needs to be done in the loop. It is better to join both Tables so that the Where-clause of the query can be used to limit the results.

The Job-table has the JobDefinition column, which contains the UniqueID of the coressponding JobDefinition. This column can be used to join the the JobDefinition table. Below is an example to find all jobs of JobDefinitions which start with RMJ

      {
         // Query all Jobs from JobDefintions starting with RMJ
         String sqlCmd = select j.* from Job j, JobDefinition jd where j.JobDefinition = jd.UniqueId and jd.Name like '%RMJ%'";
         for (Iterator it = jcsSession.executeObjectQuery(sqlCmd , null); it.hasNext(); ) {
      
            // Get the next available record 
            Job job = (Job) it.next();
            jcsOut.println("Job " + job.getDescription() + " has status " + job.getStatus().toString() ) ;
      
         }
      
      }