num_data = len(item_data) sql_item = "select rate_swap_id_sequence.nextval from (select 1 from DCS_FILE_RECORD where rownum <=%d)" % (num_data)