Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

ALTER SEQUENCE in SQLScript stored procedure supported?

$
0
0

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":

 

 

alter.PNG

 

Is ALTER SEQUENCE supported?  Most grateful for pointing out the (probably) obvious to me.  Many thanks.


Viewing all articles
Browse latest Browse all 6412

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>