17,382
社区成员




FUNCTION GetPartition(P_A IN VARCHAR2) RETURN varchar2 IS
i number;
BEGIN
select count(1) into i from T partition(part_1) where A=P_A and rownum=1;
if i>0 then
return 'part_1';
end if;
select count(1) into i from T partition(part_2) where A=P_A and rownum=1;
if i>0 then
return 'part_2';
end if;
select count(1) into i from T partition(part_3) where A=P_A and rownum=1;
if i>0 then
return 'part_3';
end if;
return null;
END;