在將插入插入數據庫之前,必須爲每個成員屬性更新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