Sorry, Gerben. I've been struggling to iterate over the results of the SQL. I can create a report easily enough, but I'd like to go through the results within the RedwoodScript, and generate an email alert if any missing scheduled jobs are returned.
String query = "select tv.Key as Job_Name from TableValue tv, Table t where tv.Table = t.UniqueId and t.Name = 'Master_Schedule' and not exists (select 1 from Job j, JobDefinition jd where jd.Name = tv.Key and j.JobDefinition = jd.UniqueId and j.Status in ('R','W','S','Q','B','q','2','4','6'))";
jcsErr.println(query);
I've tried without success to use executeObjectQuery and executeQuery, and I believe my problem (apart from being rubbish at Java!) is that the data being returned is simple string Job_Name and the executeObjectQuery is for querying objects (like I've done successfully in other scripts).
Could you possibly give an example of how I can execute and iterate over the sql results for the above query?
Regards
Guy