Oracle SQL script - passing a parameter I have an Oracle SQL script like this:

delete FROM activ_princ where id in
    (select ap.id FROM activ_princ ap
        inner join sect e on e.id=ap.FK_ID_SECTIUNE_e
        inner join chest ch on ch.id=e.FK_ID_CHESTIONAR
    WHERE ch.id=1661);
delete FROM activ_sec where id in
    (select asec.id FROM activ_sec asec
        inner join sect e on e.id=asec.FK_ID_SECTIUNE_e
        inner join chest ch on ch.id=e.FK_ID_CHESTIONAR
    WHERE ch.id=1661);
delete FROM sect where id in
    (select e.id FROM sect e
        inner join chest ch on ch.id=e.FK_ID_CHESTIONAR
    WHERE ch.id=1661);


how can I pass 1661 as a parameter and execute all the script changing just the id I want to delete...
If you're using SQLPlus, you can use a variable &amp; it will prompt you.

delete FROM activ_princ where id in
    (select ap.id FROM activ_princ ap
        inner join sect e on e.id=ap.FK_ID_SECTIUNE_e
        inner join chest ch on ch.id=e.FK_ID_CHESTIONAR
    WHERE ch.id=&amp;1);
delete FROM activ_sec where id in
    (select asec.id FROM activ_sec asec
        inner join sect e on e.id=asec.FK_ID_SECTIUNE_e
        inner join chest ch on ch.id=e.FK_ID_CHESTIONAR
    WHERE ch.id=&amp;1);
delete FROM sect where id in
    (select e.id FROM sect e
        inner join chest ch on ch.id=e.FK_ID_CHESTIONAR
    WHERE ch.id=&amp;1);


See the documentation here.