Question

Please help.

I tried this, I don't know how to proceed. I need to give a select into statement for this.

TYPE ADDR_DATA IS TABLE OF ADDRESS%ROWTYPE
INDEX BY BINARY_INTEGER;

Select is, (only one record will come), and how can I use it further?

SELECT 
    * INTO ADDR_DATA
FROM 
    ADDRESS 
WHERE           
    ADDR_DATA.PERSON_ID = 83;
Was it helpful?

Solution

It looks as if you're trying to bulk collect the data, which means you need to do;

DECLARE
    v_address_data ADDR_DATA;
BEGIN
SELECT 
    * BULK COLLECT INTO v_address_data
FROM 
    ADDRESS 
WHERE           
    ADDR_DATA.PERSON_ID = 83;
END;

On the other hand you're looking for (I think) only one row - id=83
which means you want something like:

DECLARE
    v_addrss ADDRESS%ROWTYPE;
BEGIN
    SELECT 
        * INTO v_addrss 
    FROM 
        ADDRESS 
    WHERE           
        ADDR_DATA.PERSON_ID = 83;
END;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top