set serveroutput on;
declare 
 i integer := 1;
 query varchar2(5000) := 'select home_player_1 from dataL3.match';
begin
  dbms_output.put_line('insert into engager (equipeId, joueurId, saisonId)');
  loop
	dbms_output.put_line(replace(query, 'player_1', 'player_' || i));
	dbms_output.put_line('union');
	dbms_output.put_line(replace(replace(query, 'player_1', 'player_' || i),'home', 'away'));
	exit when i = 11;
	dbms_output.put_line('union');
	i := i+1;
  end loop;
 end;