oracle存储过程,坐等大神

求大神,小弟要实现一个存储过程,通过基础表的数据自动生成SQL查询条件,表的数据有多条,存储过程该怎么写

通过游标遍历基础表,拼装动态sql,然后执行。根据你提供的信息,只能回答到这种程度

举个例子,具体目标

现在我把要动态拼装的SQL语句存在一张表上了,要用存储过程去执行更新符合这个条件的值,该怎么拼接
create or replace procedure PRD_T_MANIFEST_CONSTANT is
iCount number;
sqlStr varchar(1000);
cursor cs is select * from t_examine_cresql;
begin for c in cs loop select count(*) into iCount from t_examine_rule

where rule_id = c.rule_id and to_char(sysdate, 'yyyyMMdd') <= to_char(end_time, 'yyyyMMdd') and is_valid = '1'and to_char(begin_time,'yyyyMMdd') >= to_char(sysdate,'yyyyMMdd');

if iCount > 0 then

sqlStr := c.content_name;

update t_manifest_business s
et examine_rules = c.rule_name

where is_con_flag = 'Y' || sqlStr;

end if;

end loop;
end PRD_T_MANIFEST_CONSTANT;
这是生成的SQL语句