Help with code reading table please

This is a discussion on Help with code reading table please within the C Programming forums, part of the General Programming Boards category; I have to create a very simple db2 table. It will hold only 2 columns called center and time. For ...

  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    115

    Help with code reading table please

    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.
    Last edited by cjohnman; 04-28-2008 at 08:20 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 03-26-2007, 05:48 PM
  2. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  3. << !! Posting Code? Read this First !! >>
    By kermi3 in forum Linux Programming
    Replies: 0
    Last Post: 10-14-2002, 01:30 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. About the Morse code Converter
    By Amber_liam in forum C Programming
    Replies: 17
    Last Post: 05-29-2002, 08:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21