Generating range of numbers 1…n in SAP HANA

SAP HANASAPSAP Basis

You can use For loop as below:

FOR START_CID IN 1..1000 DO
   INSERT INTO "TEST_TABLE" VALUES(START_CID,'');
END FOR;

You can also use a Generator like this:

INSERT INTO "TEST_TABLE" SELECT GENERATED_PERIOD_START as CID, '' as CNAME from SERIES_GENERATE_INTEGER(1,1,1001);
raja
Ali
Published on 18-Dec-2017 08:05:19
Advertisements