| ||||
本次参考后使用事例其中游标为动态sql open p_rc1 for 'select distinct code_brief from oa_assist_code where code_des in (' || strdist || ')'; loop fetch p_rc1 into varpara; temp_sql := strSqlCount; select replace(temp_sql, '@datalink', varpara) into temp_sql from dual; if p_rc1%found then select decode(CreateSql, null, temp_sql, CreateSql || ' union all ' || temp_sql) into CreateSql from dual; end if; exit when p_rc1%notfound; end loop; open p_rc1 for 'select sum(con) from (' || CreateSql || ')'; |
ORACLE和SQL SERVER中游标的使用
最新推荐文章于 2023-05-24 21:05:06 发布