declare
  email varchar2(50);
  street varchar2(100);
  city varchar2(30);
  state varchar2(30);
  zip number(5);
  address varchar2(200);
  cursor c1 is 
    select name, card
    from   addrbook;
  c1_rec c1%rowtype;

begin

  for c1_rec in c1 loop
    email := c1_rec.card.extract('/ACARD/EMAIL/text()').getstringval();
    street := c1_rec.card.extract('/ACARD/ADDRESS/LINE1/text()').getstringval();
    city := c1_rec.card.extract('/ACARD/ADDRESS/CITY/text()').getstringval();
    state := c1_rec.card.extract('/ACARD/ADDRESS/STATE/text()').getstringval();
    zip := c1_rec.card.extract('/ACARD/ADDRESS/ZIP/text()').getnumberval();
    address := street || ', ' || city || ', ' || state || ', ' || zip;

    insert into abook values (c1_rec.name,email,address);
  end loop;
end;
/
show errors
