In the SQL Server, I can define local variables like this.
declare @id number := 1000 select * from tbl_A where id = @id; select * from tbl_B where id = @id
(Just stumbled across this thread.) Beginning with SQL*Plus 12.2, you can declare and assign a value at the same time:
SQL> var id number = 1000
SQL> select * from tbl_A where id = :id;
Oracle calls it input binding.
If you must do it in PL/SQL, the answer was given by others.