Skip to Content

Problem iterating over a script table in BPA v9

Feb 02, 2017 at 09:12 AM


avatar image
Former Member

Hi all,

I'm using the following RedwoodScript code to try and iterate over a scripting table called Master_Schedule that contains a list of job names as the key field that should be in the batch schedule, and joining it to the list of currently scheduled jobs. I use this information later in the program to alert any missing jobs that should be scheduled. Unfortunately, when I run the process I receive an error whilst it's trying to execute the ObjectQuery, but I can't see a problem with the code/table. Any assistance greatfully received.

com.redwood.scheduler.persistence.api.PersistenceException$InvalidColumnIndex: JCS-XXXXX: Invalid column index -1 (objectIndex=0, selectedObjects.size()=0

The script table has the following definition



Submit Frame

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'))";   

for(final Iterator it = jcsSession.executeObjectQuery(query, null); it.hasNext();)  


TableValue tv = (TableValue);  



10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
G.M. Blom Feb 07, 2017 at 09:05 AM

Hi Guy,

You have to select tv.* in order to fetch the Object directly.

Regards Gerben

10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 30, 2017 at 10:01 AM

Cheers, Gerben. That worked.

10 |10000 characters needed characters left characters exceeded