在将插入插入数据库之前,必须为每个成员属性更新apex集合。
第一顶点的过程:在提交和计算之前
declare
y pls_integer := 0;
v_msg varchar2(4000);
begin
if not apex_collection.collection_exists(p_collection_name=>'COLLECTION') then
wwv_flow.debug('No Apex collection found!');
else
for x in (select * from apex_collections where collection_name = 'COLLECTION' and seq_id != 1 order by seq_id)
loop
y := y+1;
apex_collection.update_member_attribute (p_collection_name=> 'COLLECTION', p_seq=> x.seq_id,p_attr_number =>1,p_attr_value=>wwv_flow.g_f01(y));
apex_collection.update_member_attribute (p_collection_name=> 'COLLECTION', p_seq=> x.seq_id,p_attr_number =>2,p_attr_value=>wwv_flow.g_f02(y));
apex_collection.update_member_attribute (p_collection_name=> 'COLLECTION', p_seq=> x.seq_id,p_attr_number =>3,p_attr_value=>wwv_flow.g_f03(y));
apex_collection.update_member_attribute (p_collection_name=> 'COLLECTION', p_seq=> x.seq_id,p_attr_number =>4,p_attr_value=>wwv_flow.g_f04(y));
apex_collection.update_member_attribute (p_collection_name=> 'COLLECTION', p_seq=> x.seq_id,p_attr_number =>5,p_attr_value=>wwv_flow.g_f05(y));
apex_collection.update_member_attribute (p_collection_name=> 'COLLECTION', p_seq=> x.seq_id,p_attr_number =>6,p_attr_value=>wwv_flow.g_f06(y));
apex_collection.update_member_attribute (p_collection_name=> 'COLLECTION', p_seq=> x.seq_id,p_attr_number =>7,p_attr_value=>wwv_flow.g_f07(y));
apex_collection.update_member_attribute (p_collection_name=> 'COLLECTION', p_seq=> x.seq_id,p_attr_number =>8,p_attr_value=>wwv_flow.g_f08(y));
apex_collection.update_member_attribute (p_collection_name=> 'COLLECTION', p_seq=> x.seq_id,p_attr_number =>9,p_attr_value=>wwv_flow.g_f09(y));
end loop;
end if;
exception when others then
v_msg := ''||sqlerrm;
wwv_flow.debug('ERR: '||v_msg);
end;
第二顶点处理:提交
declare
v_msg varchar2(4000);
begin
for x in (select * from apex_collections where collection_name = 'COLLECTION' and seq_id != 1 order by seq_id)
loop
begin
INSERT INTO REI_LABOUR_COST (DEALER_NUMBER, DEALER_STATUS, BILLING_PARTNER, BSI_GW, YEAR, QUANTITY_FRU, LABOUR_EUR, LABOUR_LOCAL, REQUESTED_RATE)
values(x.c001, x.c002, x.c003, x.c004, x.c005, x.c006, x.c007, x.c008, x.c009);
exception when others then
v_msg := ''||sqlerrm;
wwv_flow.debug('ERR_1: '||v_msg);
end;
end loop;
exception when others then
v_msg := ''||sqlerrm;
wwv_flow.debug('ERR_2: '||v_msg);
end;
你得到只是运行了'SELECT'部分东西后? – justiceorjustus
是的,我喜欢。一切都按照我的计划进行。它会自己转换错误的类型吗?像数字到varchar或其他方式,鉴于字符形成一个有效的数字? –
如果您删除了所有列别名,它是否工作?你不需要插入它们,但我不知道它是否会导致插入。 – justiceorjustus