SQL文を調べていて”?”が出てきた時

この方法で( https://hacknote.jp/archives/1343/ )

呼び出されたSQL文を調べていると

SELECT DISTINCT t0.COMMON_CATEGORY_ID, t0.SCHEDULE_ID, t0.STATUS, t0.TYPE, t0.USER_ID, t0.ID FROM eip_t_schedule_map t0, eip_t_schedule t1 WHERE t0.SCHEDULE_ID = t1.SCHEDULE_ID AND ((t0.USER_ID IN (?)) AND (t0.TYPE = ?) AND (((t1.REPEAT_PATTERN = ?) AND (t1.START_DATE <= ?) AND (t1.END_DATE > ?)) OR (t1.REPEAT_PATTERN LIKE ?) OR (t1.REPEAT_PATTERN LIKE ?) OR (t1.REPEAT_PATTERN LIKE ?))) [bind: 21, 'F', 'N', '2014-04-23 12:30:00.0', '2014-04-23 11:30:00.0', 'D_', 'W___1____', 'M23_']

といったように、?が含まれていることがあります

この?は[bind:]の中にある数字や文字が順に?の位置に入ったのと同じSQL文が実行されています

よって上記の例では、下の文を実行した結果が帰ってきます

SELECT DISTINCT t0.COMMON_CATEGORY_ID, t0.SCHEDULE_ID, t0.STATUS, t0.TYPE, t0.USER_ID, t0.ID FROM eip_t_schedule_map t0, eip_t_schedule t1 WHERE t0.SCHEDULE_ID = t1.SCHEDULE_ID AND ((t0.USER_ID IN (21)) AND (t0.TYPE = 'F') AND (((t1.REPEAT_PATTERN = 'N') AND (t1.START_DATE <= '2014-04-23 12:30:00.0') AND (t1.END_DATE > '2014-04-23 11:30:00.0')) OR (t1.REPEAT_PATTERN LIKE 'D_') OR (t1.REPEAT_PATTERN LIKE 'W___1____') OR (t1.REPEAT_PATTERN LIKE 'M23_')))