Common Errors

yellowbox

These steps should only be performed by Technical personnel with administrator privileges.

Dispatch Resource 'Stuck'

These steps can only be performed by the database schema owner.

Problem

A Driver or other Resource such as a power unit is 'stuck' and cannot be assigned to a trip. The term 'stuck' is used here to indicate that the Driver or Resource is no longer assigned to an 'ACTIVE' trip but it is not in 'Available' status, and therefore cannot be assigned to a trip.

Cause

Unknown

Solution

Copy the db2fixDB2.sql script listed below and execute it in the SQL Execute > Scripts Tab:

UPDATE DRIVER SET LAST_TRIP=CURRENT_TRIP, CURRENT_TRIP=0, STATUS='ASSGN' WHERE CURRENT_TRIP NOT IN (SELECT TRIP_NUMBER FROM TRIP WHERE ACTIVE_REC='True') AND CURRENT_TRIP<>0 AND CURRENT_TRIP IS NOT NULL@
UPDATE PUNIT SET LAST_TRIP=CURRENT_TRIP, CURRENT_TRIP=0, STATUS='ASSGN' WHERE CURRENT_TRIP NOT IN (SELECT TRIP_NUMBER FROM TRIP WHERE ACTIVE_REC='True') AND CURRENT_TRIP<>0 AND CURRENT_TRIP IS NOT NULL@
UPDATE TRAILER SET LAST_TRIP=CURRENT_TRIP, CURRENT_TRIP=0, STATUS='ASSGN' WHERE CURRENT_TRIP NOT IN (SELECT TRIP_NUMBER FROM TRIP WHERE ACTIVE_REC='True') AND CURRENT_TRIP<>0 AND CURRENT_TRIP IS NOT NULL@
UPDATE EQUIP SET LAST_TRIP=CURRENT_TRIP, CURRENT_TRIP=0, STATUS='ASSGN' WHERE CURRENT_TRIP NOT IN (SELECT TRIP_NUMBER  FROM TRIP WHERE ACTIVE_REC='True') AND CURRENT_TRIP<>0 AND CURRENT_TRIP IS NOT NULL@
DELETE FROM ITRIPDRI WHERE TRIP_NUMBER NOT IN (SELECT TRIP_NUMBER FROM TRIP WHERE ACTIVE_REC='True') @
DELETE FROM ITRIPPUN WHERE TRIP_NUMBER NOT IN (SELECT TRIP_NUMBER FROM TRIP WHERE ACTIVE_REC='True') @
DELETE FROM ITRIPTRA WHERE TRIP_NUMBER NOT IN (SELECT TRIP_NUMBER FROM TRIP WHERE ACTIVE_REC='True') @
DELETE FROM ITRIPEQU WHERE TRIP_NUMBER NOT IN (SELECT TRIP_NUMBER FROM TRIP WHERE ACTIVE_REC='True') @
UPDATE DRIVER SET STATUS='AVAIL' WHERE STATUS='ASSGN' AND DRIVER_ID NOT IN (SELECT DRIVER_ID FROM ITRIPDRI)@
UPDATE PUNIT SET STATUS='AVAIL' WHERE STATUS='ASSGN' AND UNIT_ID NOT IN (SELECT UNIT_ID FROM ITRIPPUN)@
UPDATE TRAILER SET STATUS='AVAIL' WHERE STATUS='ASSGN' AND TRAILER_ID NOT IN
(SELECT TRAILER_ID FROM ITRIPTRA)@
UPDATE EQUIP SET STATUS='AVAIL' WHERE STATUS='ASSGN' AND EQUIPMENT_ID NOT IN (SELECT EQUIPMENT_ID FROM ITRIPEQU)@

If this does not resolve the problem, contact Trimble Transportation Support and indicate you have executed the db2fixDB2.sql prior to reporting the problem.