Skip to Content
avatar image
Former Member

Problem iterating over a script table in BPA v9

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

Key

Partition

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) it.next();  

jobSnapshot1.add(tv.getKey());  

}

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Feb 07, 2017 at 09:05 AM

    Hi Guy,

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

    Regards Gerben

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 30, 2017 at 10:01 AM

    Cheers, Gerben. That worked.

    Add comment
    10|10000 characters needed characters exceeded