Hi,
I can successfully execute the following SQL statement within the Hana system SQL console:
alter sequence "MISSIONCONTROL"."hpl.missioncontrol.data::missionCockpitLogId" RESTART WITH 1;
I have an SQL stored procedure that I execute to clear some load tables as I repeatedly perform some tests:
CREATE PROCEDURE reset_missionLogs_sql ( )
LANGUAGE SQLSCRIPT
SQL SECURITY INVOKER AS
--DEFAULT SCHEMA <schema>
BEGIN
/*****************************
Write your procedure logic
*****************************/
delete from "MISSIONCONTROL"."hpl.missioncontrol.data::mission";
delete from "MISSIONCONTROL"."hpl.missioncontrol.data::missionCockpitLog";
END;
I wish to incorporate the aforementioned ALTER sequence statement within this procedure so that in addition to the table contents being cleared the associated sequences for primary keys are reset to 1.
The issue is that the SQLScript editor is not happy when I place the ALTER SEQUENCE statement, indicating it is "incorrect or or misplaced":
Is ALTER SEQUENCE supported? Most grateful for pointing out the (probably) obvious to me. Many thanks.