Using Oracle SQL Developer. I have the following sample working:
DECLARE
v_next_TransId INTEGER; -- declare
BEGIN
select (max(Transaction_ID)+1) into v_next_TransId from xxpos.pos_transactions;
dbms_output.Put_line(v_next_TransId); --display
END;
Now I want to use that variable in an insert and/or select, I tried with and without a : prefix. The sample below gives me the ORA-01008: not all variables found.
DECLARE
v_next_TransId INTEGER; -- declare
BEGIN
select (max(Transaction_ID)+1) into v_next_TransId from xxpos.pos_transactions;
dbms_output.Put_line(v_next_TransId); --display
-- insert new row will go here
-- commit will go here
-- now verify the insert worked okay
--select * from xxpos.pos_transactions where Transaction_ID = ( select max(Transaction_ID) from xxpos.pos_transactions )
select * from xxpos.pos_transactions where Transaction_ID = :v_next_TransId;
END;
Without the : in front of the variable, I get this syntax error:

Versions:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production