SELECT
  B.BATCH_NAME,
  B.USER_PATTERN_ID,
  B.REPEAT_ID,
  R.INTERVAL,
  B.VERSION,
  R.HOUR,
  R.MINUTE,
  R.WEEK,
  R.YEAR_MONTH_DAY,
  R.VERSION AS REPEAT_VERSION
FROM
  TR_GENERIC_CSV_BATCH B
LEFT OUTER JOIN
  FW_JOB_REPEAT R
ON
  R.ID = B.REPEAT_ID
  AND R.VERSION > 0
WHERE
  B.INSERT_ID = /*:Uid*/'9999999999'
  AND B.ID = /*:Id*/1
  AND B.VERSION > 0
ORDER BY
  B.BATCH_NAME
