-- SelectJobDetailStatus=
SELECT
  JOB_SEQ             AS JOB_SEQ,
  BAT_SEQ             AS BAT_SEQ,
  BAT_NAME            AS BAT_NAME,
  PID                 AS PID,
  STATUS              AS BAT_STATUS,
  START_DATE_TIME     AS START_DATE_TIME,
  STOP_DATE_TIME      AS STOP_DATE_TIME,
  MESSAGE             AS MESSAGE
FROM
  FW_JOB_DETAIL
WHERE
  JOB_SEQ = /*:JobSeq*/123
  AND BAT_SEQ = /*:BatSeq*/123
ORDER BY
  BAT_SEQ DESC
FOR UPDATE
;
-- SelectJobDetailStatusList=
SELECT
  JOB_SEQ             AS JOB_SEQ,
  BAT_SEQ             AS BAT_SEQ,
  BAT_NAME            AS BAT_NAME,
  PID                 AS PID,
  STATUS              AS BAT_STATUS,
  START_DATE_TIME     AS START_DATE_TIME,
  STOP_DATE_TIME      AS STOP_DATE_TIME,
  MESSAGE             AS MESSAGE
FROM
  FW_JOB_DETAIL
WHERE
  JOB_SEQ = /*:JobSeq*/123
ORDER BY
  BAT_SEQ DESC
FOR UPDATE
;
-- UpdateJobDetail=
UPDATE
  FW_JOB_DETAIL
SET
  STATUS = /*:Status*/20,
  STOP_DATE_TIME = /*:DateTime*/TO_TIMESTAMP('20140101122334', 'YYYYMMDDHH24MISS'),
  MESSAGE = /*:Message*/''
WHERE
  JOB_SEQ = /*:JobSeq*/123
  AND BAT_SEQ = /*:BatSeq*/123
;
-- InsertJobDetail=
INSERT INTO
  FW_JOB_DETAIL
(
  JOB_SEQ,
  BAT_SEQ,
  PID,
  BAT_NAME,
  STATUS,
  START_DATE_TIME
) VALUES (
  /*:JobSeq*/123,
  /*:BatSeq*/123,
  /*:Pid*/123,
  /*:BatName*/'',
  /*:Status*/23,
  /*:DateTime*/TO_TIMESTAMP('20140101122334', 'YYYYMMDDHH24MISS')
)
;
-- DeleteJobDetail=
DELETE
FROM
  FW_JOB_DETAIL
WHERE
  JOB_SEQ = /*:JobSeq*/123
;
