COLUMN with NEW_VALUE to hold a column variable?

This works in SQLPLUS, but I can't seem to get it to work in a Command window... it fails at 3rd statement "-&inc".
If not possible in Developer, is there a way to do similar (store a variable from a SELECT)?

Thanks

column S new_val inc;

select Meter_s.nextval S from dual;

alter sequence Meter_s increment by -&inc minvalue 0;

select Meter_s.nextval S from dual;

alter sequence Meter_s increment by 1;
 
The NEW_VALUE column option is indeed not supported in the Command Window. For a list of supported commands, see chapter 7.3 in the User's Guide.

------------------
Marco Kalter
Allround Automations
 
I think I've found a way to do this...

VARIABLE inc NUMBER

SELECT sequence_name NAME, last_number NEXT
FROM user_sequences
WHERE sequence_name = 'DTR_TEST';

begin
select dtr_Test.nextval into :inc from dual;
execute immediate 'alter sequence dtr_Test increment by ' | | -:inc | | 'minvalue 0';
select dtr_Test.nextval into :inc from dual;
execute immediate 'alter sequence dtr_Test increment by 1';
end;
/
 
Back
Top