I can not find any missing parentheses in the line set project.activity.full_in = TO_NUMBER, I have reviewed it 20 times and the parentheses close well, I have 2 errors: ORA 00907 missing parentheses right and in the previous line to that it says SQL statement ignored.
CODE:
Note: It is a procedure to register activity, before this there is more but I did not want to saturate with code
select proyecto.activity.available_space into espacio_disp from proyecto.activity ;
if (espacio_disp = 1 )then --si solo le queda un espacio lo agrego y pongo los dias en que lo llene
update proyecto.activity
set proyecto.activity.available_space = proyecto.activity.available_space - 1
where proyecto.activity.id_activity = pid_activity ;
update proyecto.activity
set proyecto.activity.full_in = TO_NUMBER( '(select to_char(sysdate,'DD') from dual)' ) - TO_NUMBER( '(select to_char(proyecto.activity.creation_date,'DD') from PROYECTO.ACTIVITY) ' )
where proyecto.activity.id_activity = pid_activity ;
insert into proyecto.user_x_activity(id_user_x_activity, id_user, id_activity, id_event)
values (vid_user_x_activity, pid_user, pid_activity, pid_event);
else --si le quedan mas de 1 espacio