I have a PL/SQL script Test.sql which consists of three independent queries within it.
Test.sql
SELECT ABC.*
FROM Student ABC, Teacher BCD
WHERE 1=1
AND ABC.Period = &Period
AND ABC.StudentID = BCD.StudentID;
SELECT ABC.CandidateID
from Student ABC
where not exists(
select 1
from Teacher BCD
where ABC.StudentID = BCD.StudentID
AND ABC.Period = &&Period
);
SELECT BCD.CandidateID
from Teacher BCD
where not exists (
select 1
from Student ABC
where ABC.StudentID = BCD.StudentID
)
AND ABC.Period = &&Period;
Question here is, can I use one User prompt and use the user input for all the three queries? I did try using && for the subsequent variables, but that keeps the user input active for the entire session. I may need to run this script multiple times.