Syntax error Generating range of numbers 1…n in SAP HANA

Generating range of numbers 1…n in SAP HANA



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);
Updated on: 2019-12-18T06:24:21+05:30

554 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements