다양화 Wave2: dbio 289 + common 120 고유화 + 프로그램 206개 EXEC SQL 심화

- dbio io(289): fetch/touch/total 시그니처 유지, SQL 바디를 JOIN/집계/커서/
  upsert/DELETE 등 구조로 고유화 → 289/289 고유
- common cu(120): 유틸 시그니처 유지, Luhn/CRC/Zeller/BIN레인지/amortization/
  netting 등 실 알고리즘으로 고유화 → 120/120 고유
- 심화: 실제 EXEC SQL 없던 프로그램에 SELECT/INSERT/UPDATE/커서+tx 추가
  → online+batch 530/530 전부 실제 SQL 보유
- 전 코퍼스 프로그램 939/939 고유, 전체 docker make -j4 = EXIT 0, 958 오브젝트
- 임시 생성기 제거, inventory.json loc 실측 갱신

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
forge-bot 2026-07-19 04:54:59 +00:00
parent c3a0259e95
commit 93c3cb74af
1111 changed files with 31539 additions and 17258 deletions

View file

@ -100,9 +100,32 @@ struct sqlca_t *ECPGget_sqlca(void);
static int run_cm_bt_0015(const char *biz_date)
{
/* exec sql begin declare section */
#line 26 "app/batch/cm_bt_0015.pgc"
char h_biz_date [ 9 ] ;
#line 27 "app/batch/cm_bt_0015.pgc"
char h_merch_id [ 16 ] ;
#line 28 "app/batch/cm_bt_0015.pgc"
long h_merch_cnt ;
#line 29 "app/batch/cm_bt_0015.pgc"
long h_merch_sum ;
/* exec sql end declare section */
#line 30 "app/batch/cm_bt_0015.pgc"
long n_recv, n_done, n_fail, n_settled, total;
long sum_amt = 0;
long merch_lines = 0;
char won[32];
char merch_won[32];
int rc;
n_recv = cm_rec_count(biz_date, CM_ST_RECV);
@ -139,6 +162,57 @@ static int run_cm_bt_0015(const char *biz_date)
printf(" 거래총액 : %s\n", won);
if (total > 0)
printf(" 완료율 : %ld%%\n", (n_done * 100) / total);
/*
* : cm_ledger
* .
*/
strncpy(h_biz_date, biz_date, sizeof(h_biz_date) - 1);
h_biz_date[sizeof(h_biz_date) - 1] = '\0';
ECPGset_var( 0, ( h_biz_date ), __LINE__);\
/* declare cur_cm_bt_0015 cursor for select merch_id , count ( * ) , coalesce ( sum ( amount ) , 0 ) from cm_ledger where biz_date = $1 group by merch_id order by count ( * ) desc , merch_id */
#line 86 "app/batch/cm_bt_0015.pgc"
#line 86 "app/batch/cm_bt_0015.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "declare cur_cm_bt_0015 cursor for select merch_id , count ( * ) , coalesce ( sum ( amount ) , 0 ) from cm_ledger where biz_date = $1 group by merch_id order by count ( * ) desc , merch_id",
ECPGt_char,(h_biz_date),(long)9,(long)1,(9)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
#line 88 "app/batch/cm_bt_0015.pgc"
if (sqlca.sqlcode != TX_SQL_OK) {
TX_DBIO_LOG_ERR("cm_bt_0015 OPEN cur");
} else {
printf(" ----- 가맹점별 상세 -----\n");
for (;;) {
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "fetch cur_cm_bt_0015", ECPGt_EOIT,
ECPGt_char,(h_merch_id),(long)16,(long)1,(16)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_long,&(h_merch_cnt),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_long,&(h_merch_sum),(long)1,(long)1,sizeof(long),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EORT);}
#line 95 "app/batch/cm_bt_0015.pgc"
if (sqlca.sqlcode == TX_SQL_NOTFOUND)
break;
if (sqlca.sqlcode != TX_SQL_OK) {
TX_DBIO_LOG_ERR("cm_bt_0015 FETCH cur");
break;
}
merch_lines++;
amount_format_won(h_merch_sum, merch_won, sizeof(merch_won));
printf(" %-12s 건수=%-6ld 금액=%s\n",
h_merch_id, h_merch_cnt, merch_won);
}
{ ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "close cur_cm_bt_0015", ECPGt_EOIT, ECPGt_EORT);}
#line 108 "app/batch/cm_bt_0015.pgc"
}
printf(" 가맹점 수 : %ld\n", merch_lines);
printf("=============================================\n");
return TX_OK;