誰かが私を助けたり、条件に基づいてコレクションをループしなければならないサンプルコードを提供したりできますか. sql の where 句と同じです。あなたの助けは非常に高く評価されています....
これが私のコードです:
create table MODEL1
(
model_id NUMBER ,
model_seq NUMBER,
p_ind VARCHAR2(1)
);
insert into model1 (MODEL_ID, MODEL_SEQ, P_IND)
values (4, 103, 'U');
insert into model1 (MODEL_ID, MODEL_SEQ, P_IND)
values (3, 102, 'P');
insert into model1 (MODEL_ID, MODEL_SEQ, P_IND)
values (2, 101, 'U');
insert into model1 (MODEL_ID, MODEL_SEQ, P_IND)
values (1, 100, 'P');
MODEL PROCEDURE......
procedure ( param1,param2) ( assume this procedure is being called from other procedure and collection has been populated already)
TYPE l_tab is table of MODEL1%rowtype;
begin
loop through l_tab records where ltab.model_id=param1 and p_ind =p
Join based on if else condition.
if param2 is not null then
l_tab.model_seq=param2 and ltab.p_ind='P'
if param2 is null then
l_tab.p_ind='P' etc...........