请教各位高手,如何将下面的一段存储过程改写为Vb的代码
请教各位高手,如何将下面的一段存储过程改写为Vb的代码,存储过程看不懂哦:CREATE OR REPLACE FUNCTION cu_chkdt_2(
bank_cd NUMBER,
sbank_cd NUMBER,
curr NUMBER,
gl_num NUMBER,
num NUMBER,
len1 NUMBER,
method NUMBER) RETURN NUMBER AS
ac CHAR(19):= SUBSTR(TO_CHAR(bank_cd+1000),2,3)||
SUBSTR(TO_CHAR(sbank_cd+10000),2,4)||
SUBSTR(TO_CHAR(curr+100),2,2)||
SUBSTR(TO_CHAR(gl_num+10000),2,4)||
SUBSTR(TO_CHAR(num+1000000),2,6);
factor_2 CHAR(24):= '010305071113171923293137';
sum1 NUMBER := 0;
buff NUMBER :=0;
len NUMBER :=len1;
position NUMBER;
chk_dt NUMBER;
substr_ret NUMBER := 0;
acc_no char(19) := ac;
/*
factor_2 := "010305071113171923293137";
sum := 0;
ac := bank_cd+1000||sbank_cd+10000||curr+100||gl_num+10000||num+1000000;
acc_no = ac[2,4]|| ac[6,9]|| ac[11,12]|| ac[14,17]|| ac[19,24];
buff := 0;
substr_ret := 0;
*/
BEGIN
WHILE (len>1) LOOP
/*buff = substring(acc_no,len-1,2,buff) returning buff;*/
buff := SUBSTR(acc_no,len-1,2);
position := (len/2+(len-trunc(len/2)*2)-1)*2;
/*call substring(factor_2,position,2,substr_ret) returning substr_ret;*/
substr_ret := SUBSTR(factor_2,position,2);
sum1 := (buff * substr_ret)+sum1;
len := len-2;
END LOOP;
if ( (len-trunc(len/2)*2) = 1 ) then
sum1 := +( SUBSTR(acc_no,1,1)-'0' ) * SUBSTR(factor_2,1,2);
end if;
chk_dt := sum1 - trunc(sum1/97)*97 + 1;
RETURN chk_dt;
END cu_chkdt_2; --------------------编程问答-------------------- 天呀,你要实现什么都不说一下的呀? --------------------编程问答-------------------- 楼主,看得太累了,你就告诉我要实现什么,然后才能回答
看你这个不是不能看懂,是累 --------------------编程问答-------------------- 已知银行账号的前20位,要得到银行账号的校验位,即后两位!
补充:.NET技术 , VB.NET