Hi,
I have a develop a report for mailing list to companies. Each of these companies have different mailing address types: mail and legal. Some of the companies might have only one but the order in which i have to search is, if there is an address of type 'MAIL' I have to pick that address and discrad any other address types present for that company.

I have used cursors but am not getting the desired result. This is my current code. Could you also pls tell me if there are any statements equal to Break and continue in pl/sql?

Thanks

CURSOR ADDR_CUR IS SELECT * FROM COMPANY_ACTIVE_ADDRESSES_VIEW
WHERE OWNER_EID in (100000,125868);

BEGIN
FOR ADDR IN ADDR_CUR LOOP
FOR OWNER IN (SELECT * FROM COMPANY_ACTIVE_ADDRESSES_VIEW WHERE OWNER_EID = ADDR.OWNER_EID ORDER BY ADDRESS_TYPE DESC) LOOP
IF OWNER.ADDRESS_TYPE ='PREMTAX' THEN
:CP_ADDRLINE1 := ADDR.ADDRESS_LINE1;
:CP_ADDRLINE2 := ADDR.ADDRESS_LINE2;
:CP_CITY:=ADDR.CITY;
:CP_STATE:=ADDR.STATE;
:CP_ZIP:=ADDR.ZIP_CODE;
:CP_TYPE := ADDR.ADDRESS_TYPE;
ELSIF OWNER.ADDRESS_TYPE ='MAIL' THEN
:CP_ADDRLINE1 := ADDR.ADDRESS_LINE1;
:CP_ADDRLINE2 := ADDR.ADDRESS_LINE2;
:CP_CITY:=ADDR.CITY;
:CP_STATE:=ADDR.STATE;
:CP_ZIP:=ADDR.ZIP_CODE;
:CP_TYPE := 'MAILS';
ELSIF OWNER.ADDRESS_TYPE ='LEGAL' THEN
:CP_ADDRLINE1 := ADDR.ADDRESS_LINE1;
:CP_ADDRLINE2 := ADDR.ADDRESS_LINE2;
:CP_CITY:=ADDR.CITY;
:CP_STATE:=ADDR.STATE;
:CP_ZIP:=ADDR.ZIP_CODE;
:CP_TYPE := 'LEGAL';
END IF;
END LOOP;
END LOOP;
END;