Question: I want to perform the delete operation in 2 tables with a given id here is sudo code

```
declare
  cursor del_id is
    select person_id from table_1 where termination is true

begin
  for id_x in del_id
   delete from table_X where id=id_x
   delete from tabele_Y where id=id_x

```

How to do that ? i can't directly use my cursor please help.
I just try to print my id 

```
begin

  for id in del_id
  LOOP
  dbms_output.put_line(id);
  END LOOP;
end;

```

Getting this error

```
Error report -
ORA-06550: line 11, column 3:
PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'

```

Answer: 
To print the values from a cursor, you need to explicitly write the columns you want; `dbms_output.put_line` can not handle a row that may contain many columns with different types, so you need to pass it a string.

```
SQL> declare
  2     cursor del_id is select 1 as one, 2 as two from dual;
  3  begin
  4    FOR id IN del_id
  5    LOOP
  6      dbms_output.put_line(id.one || ' - ' || id.two);
  7    END LOOP;
  8  end;
  9  /
1 - 2

PL/SQL procedure successfully completed.

```

If you need to use the values from a cursor in some statement, a `DELETE` in your question, you need to do the same, by explicitly writing the column name; for example:

```
declare
   cursor del_id is select 1 as one, 2 as two from dual;
begin
  FOR id IN del_id
  LOOP
    delete from someTable where someColumn = id.one;
  END LOOP;
end;

```
You do not need a cursor:

```
BEGIN
  DELETE FROM table_X
  WHERE  id IN ( select person_id from table_1 where termination is true );

  DELETE FROM table_Y
  WHERE  id IN ( select person_id from table_1 where termination is true );
END;
/

```

You could also use a collection:

```
CREATE TYPE id_type IS TABLE OF INTEGER;
/

DECLARE
  ids id_type;
BEGIN
  SELECT person_id
  BULK COLLECT INTO ids
  FROM   table_1
  WHERE  termination is true;

  DELETE FROM table_X
  WHERE  id MEMBER OF ids;

  DELETE FROM table_Y
  WHERE  id MEMBER OF ids;
END;
/

```