I have to create a very simple db2 table. It will hold only 2 columns called center and time. For now it will hold only 6 records like below.(it will grow soon):
center
--------
1
2
3
4
5
6
time(hours)
--------
2
5
7
3
8
12
I have an existing embedded SQL statement (below inside a cursor) looking for finished goods up to 8 hours after they were completed. The change I am trying to make is instead of using '+ 8 HOURS' I want to use a variable which looks at this table and determines the amount of hours based on the center.
Existing Statement:
Code:
AND DATE(A.LOC_DT_TM) BETWEEN DATE(:exit_dt_tm) AND DATE(:exit_dt_tm) + '8 HOURS'
I get the center I need to look up from another table called a.center in a cursor.
So I need to compare a.center to my table above and return the time in hours listed. Any help is greatly appreciated.