oracle中for循环配合动态sql,oralce中for执⾏动态sql --oralce中 for 执⾏动态sql
英语六级考试题型CREATE OR REPLACE FUNCTION fun_checkguaranteetype(TranId varchar2)
return varchar2 is V_result varchar2(1000);
Begin
declare
zhiyavar NUMBER;
diyavar NUMBER;
dabaoren NUMBER;
v_sql varchar2(1000);
--定义type
competeTYPE accountno_type IS TABLE OF actaccount.accountno%TYPE INDEX BY BINARY_INTEGER;
TYPE id_type IS TABLE OF bizpawn.id%TYPE INDEX BY BINARY_INTEGER;
恭喜英文
--集合列
accountno accountno_type;
insistonid id_type;
begin
v_sql :='lect p1.accountno accountno ,pawn.id dencemode nocredencemode from bizpawn pawn,(';
v_sql :=v_sql||' lationaccountid,act.accountno from actaccount act where act.id in';道德经翻译
v_sql :=v_sql||'(lect trans.accountid from acttransaction trans where trans.id in ('||TranId||')) ) p1 ';提升
besidev_sql :=v_sql||'where pawn.lationaccountid';
--执⾏动态sql
EXECUTE IMMEDIATE v_sql BULK COLLECT into accountno,id;
留学美国费用
--for
for V1 IN 1 .. accountno.COUNT LOOP
--获取值
dbms_output('accountno:'||accountno(v1)||'---id:'||id(v1));
END LOOP;
i can saying no成人英文培训班return (V_result);
end;
end fun_checkguaranteetype;