t_Interval := trunc(to_number(sysdate - t_Interval_temp) / 365,0);
t_cursor_sql := DBMS_SQL.OPEN_CURSOR;
select count(1) into t_Fxflag from lmcalmode
where calcode like 'IFX%' and riskcode = t_Riskcode;
if (t_FxFlag > 0) then
select calsql into t_sql from lmcalmode
where calcode like 'IFX%' and riskcode = t_Riskcode;
t_sql := REPLACE(trim(t_sql), '?DutyCode?', trim(t_DutyCode));
DBMS_SQL.PARSE(t_cursor_sql, t_sql, DBMS_SQL.native); DBMS_SQL.DEFINE_COLUMN(t_cursor_sql, 1, t_temp_SumAmnt); t_temp := DBMS_SQL.EXECUTE(t_cursor_sql);
LOOP IF DBMS_SQL.FETCH_ROWS(t_cursor_sql) > 0 THEN
DBMS_SQL.COLUMN_VALUE(t_cursor_sql, 1, t_temp_SumAmnt);
IF t_temp_SumAmnt is not null and t_temp_SumAmnt > 0 THEN
tRiskAmnt := tRiskAmnt + t_temp_SumAmnt;
END IF;
ELSE
EXIT;
END IF;
END LOOP;
DBMS_SQL.CLOSE_CURSOR(t_cursor_sql);
else
tRiskAmnt := tRiskAmnt + t_Amnt;
end if;
end if;
小弟实在是搞不懂,请高手们指教~~谢啦!!
t_cursor_sql := DBMS_SQL.OPEN_CURSOR;
select count(1) into t_Fxflag from lmcalmode
where calcode like 'IFX%' and riskcode = t_Riskcode;
if (t_FxFlag > 0) then
select calsql into t_sql from lmcalmode
where calcode like 'IFX%' and riskcode = t_Riskcode;
t_sql := REPLACE(trim(t_sql), '?DutyCode?', trim(t_DutyCode));
DBMS_SQL.PARSE(t_cursor_sql, t_sql, DBMS_SQL.native); DBMS_SQL.DEFINE_COLUMN(t_cursor_sql, 1, t_temp_SumAmnt); t_temp := DBMS_SQL.EXECUTE(t_cursor_sql);
LOOP IF DBMS_SQL.FETCH_ROWS(t_cursor_sql) > 0 THEN
DBMS_SQL.COLUMN_VALUE(t_cursor_sql, 1, t_temp_SumAmnt);
IF t_temp_SumAmnt is not null and t_temp_SumAmnt > 0 THEN
tRiskAmnt := tRiskAmnt + t_temp_SumAmnt;
END IF;
ELSE
EXIT;
END IF;
END LOOP;
DBMS_SQL.CLOSE_CURSOR(t_cursor_sql);
else
tRiskAmnt := tRiskAmnt + t_Amnt;
end if;
end if;
小弟实在是搞不懂,请高手们指教~~谢啦!!
解决方案 »
- Java程序和在Oracle数据库中调用相同的SQL查询语句,结果却不相同
- 求c#怎么能在一个"butoon"实现修改datagirdview中的数据同步保存到oracle中?
- oracle 时间
- oracle不定期挂掉,急
- 下面二个过程占用锁资源多,还是 基本上没有区别
- 请问各位:字段属性由char(10)转为varchar2(10)如何将原来记录中的空格去掉?
- 请教高手oracle性能如何优化?
- 查询一段时间内的数据
- 树结构在数据库表存储中通常如何表示?
- 函数依赖 急急急!
- 执行.ctl文件给出这样的错,如何解决
- 排序:将一列1-10正序,11-20倒序,20-?正序,前两步已经解决,请高人指点。
不是为了搞懂oracle的语法与语义
而是想知道,到底这段oracle代码能不能转为mysql的代码