📄 router.ec
字号:
#include <stdio.h>
EXEC SQL INCLUDE sqlca;
EXEC SQL WHENEVER SQLERROR CALL error_handler;
EXEC SQL WHENEVER SQLWARNING CALL warning_handler;
EXEC SQL WHENEVER NOT FOUND CALL notfound_handler;
$include "db_struct.h";
extern S_card_route card_route;
extern S_tran_route tran_route;
extern int do_insert,do_update;
/* before call it , must fill trans_bit,cardhead,cardend,card_type **/
int check_card_route( char *card_type )
{
int i;
$char begin[20], end[20], type[3],tran_bit[33];
$char now_tran_bit[33];
if (!do_insert && !do_update) return(0);
strcpy(begin, card_route.first_card_no);
strcpy(end, card_route.last_card_no);
strcpy(type, card_type);
strcpy(now_tran_bit,card_route.tran_bit);
$declare card_route_cur cursor for
select tran_bit from card_route
where
( first_card_no >= :begin
AND first_card_no <= :end
AND card_type = :type )
or
( last_card_no >= :begin
AND last_card_no <= :end
AND card_type = :type )
or
( first_card_no <= :begin
AND last_card_no >= :end
AND card_type = :type )
or
( first_card_no >= :begin
AND last_card_no <= :end
AND card_type = :type );
if( SQLCODE ) return 0;
$open card_route_cur;
while( 1 ){
$fetch card_route_cur into :tran_bit;
if( SQLCODE ) break;
if( do_update) break;
for( i= 0;i<32;i++)
if( now_tran_bit[i] == tran_bit[i] &&
now_tran_bit[i] == '1' ){
$close card_route_cur;
chg_errmsg_91(i + 1); /* 显示重复定义位图的位置 */
return(91);
/* 91 交易位图定义重复 */
/* return(35); 卡段重复定义 */
}
}
$close card_route_cur;
return 0;
}
int check_tran_route( char *bank_type )
{
int i;
$char type[3],tran_bit[33];
$char now_tran_bit[33];
if (!do_insert && !do_update) return(0);
strcpy(type, bank_type);
strcpy(now_tran_bit,tran_route.tran_bit);
$declare tran_route_cur cursor for
select tran_bit from tran_route
where bank_type = :type ;
if( SQLCODE ) return 0;
$open tran_route_cur;
while( 1 ){
$fetch tran_route_cur into :tran_bit;
if( SQLCODE ) break;
if( do_update) break;
for( i= 0;i<32;i++)
if( now_tran_bit[i] == tran_bit[i] &&
now_tran_bit[i] == '1' ){
$close tran_route_cur;
chg_errmsg_91(i + 1); /* 显示重复定义位图的位置 */
return(91);
/* 91 交易位图定义重复 */
}
}
$close tran_route_cur;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -