I have some code that runs as a SQL script (QSR or SQL*Plus) but I need it to run as part of a SQL statement so I can load & use it in an automation.
Code:
col startval new_value v_startval
SELECT
NVL(MAX(masterid) + 1,1) startval
FROM
master_sales_data;
create sequence bookings_masterid start with &v_startval;
Any help would be appreciated. I tried using an anonymous block with a number variable and a select into, but I get an “invalid number” error.