cancel
Showing results for 
Search instead for 
Did you mean: 

Count all NC's for an SFC using router scripting

Former Member
0 Kudos

I wanted to see if anyone has any advice.  Before an SFC is packed, I want to count all the NC's (both open and closed) that have occurred on the SFC.  If the count is greater than or equal to a parameter, send it to operation1 for a Quality review.  If it's lower, send it to pack or done (doesn't matter).  Has anyone written a router script for this or does anyone have any advice?

thanks

Kevin McDaniel

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182330
Active Contributor
0 Kudos

Hi Kevin,

I believe you could easily do it by creating a custom router script that would retrieve info from database and evaluate the results. Based on the results you can send it to one or another operation exit branch.

I can't provide you with an example of such script, but I'm pretty positive it would be not that hard to code it.

Konstantin

Former Member
0 Kudos

Konstantin,

Thank you.  We figured it would be easy enough.  We understand how to do the exit branch it's the count NC's that has us stumped.  Documentation refers to getopenNCs() but nothing about getting them all for an SFC...that's where we're stumped.

Kevin

former_member182330
Active Contributor
0 Kudos

You can query DB directly with the SQL that counts what you need. Naturally you will be responsible for the query and for its output, but this way you can account all NCs at once.

Example of executing query in router script:

sql= "select to_char(start_time,'YYYY-MM') as dc_date "

          +" from nc_data nc, parametric pa "

          +" where pa.operation_bo = nc.operation_bo(+) "

             +" and pa.times_processed = nc.times_processed(+) "

            +" and pa.para_context_gbo = nc.nc_context_gbo "

             +" and pa.test_status = 'FAIL' "

             +" and pa.para_context_gbo = 'SFCBO:"+SITE+","+SFC+"' "

             +" and pa.operation_bo = '"+operationbo+"' "

          +" and pa.times_processed = '"+TIMES_PROCESSED+"' "

          +" and nc.operation_bo is null";

          ncresults = executeQuery(sql);

Former Member
0 Kudos

Hi Kevin

You'll have to use the executeQuery(SQLString) and write a query that identifies all NCs for that SFC.

Alli

0 Kudos

Hi Kevin,

While composing the query, please make sure it is fully supported by the existing indices for the tables to prevent slowdown. We had such cases with customers in the past.

Regards,

Sergiy