create or replace procedure proc_getnewfuhebyfacid(fac_id_s in varchar2,fac_id_e in varchar2,newfuhe_s out varchar2,newfuhe_e out varchar2)
is
tempaclnid varchar2(20);
temp_s_aclndotid varchar2(20);
temp_e_aclndotid varchar2(20);
table_names varchar2(20);
table_columns varchar2(20);
sqls varchar2(1000);--存放动态SQL的语句
begin
select acln_id into tempaclnid from acln_device where fac_id_s = fac_id_s and fac_id_e =fac_id_e and rownum <2;
select acln_dot_id into temp_s_aclndotid from acln_dot where acln_id = tempaclnid and fac_id=fac_id_s;
select acln_dot_id into temp_e_aclndotid from acln_dot where acln_id = tempaclnid and fac_id=fac_id_e;
select history_table_name,history_column_name into table_names,table_columns from svr_yc_sample_define where yc_id like '%'||temp_s_aclndotid||'%' and rownum<2;
sqls:='select '||table_columns||' from (select * from '||table_names||' where to_c
Oracle中创建存储过程、运行动态SQL并得到动态SQL语句所查询的值
最新推荐文章于 2023-04-08 23:57:19 发布