CURSOR cur_main is select ROWID ,取引先コード ,商品コード ,数量 ,金額 ,取引日付 from 取引データ where 取引日付 = PM_DATE and 更新済 is NULL;