title: In SAP HANA how can I generate a range of numbers, eg from 1 to 10?
body: <p>In SAP HANA I wish to have a view which has a range of number from 1 to 10, or 1 to n where n is any number. So when I select from the view I can select n records to get the first n records from the range.</p>
  
  <p>I was able to create a table with 1000 rows with a ID that increment's by using this stored procedure. Is there an easier way?</p>
  
  <pre><code>DROP PROCEDURE "DEMO_PROC";
  CREATE PROCEDURE "DEMO_PROC"(
           IN    ID    INTEGER )
  LANGUAGE SQLSCRIPT AS
  /*********BEGIN PROCEDURE SCRIPT ************/
  BEGIN
  DECLARE
           START_ID INTEGER;
  DROP TABLE TEST_TABLE;
  CREATE COLUMN TABLE "TEST_TABLE" (ID INTEGER, NAME VARCHAR(10));
  START_ID := 0;
  WHILE START_ID &lt; 1000 DO
    START_ID := START_ID + 1;
    INSERT INTO "TEST_TABLE" VALUES(:START_ID, '');
   END WHILE;
  END;
  
  CALL "DEMO_PROC"(1);
  
  SELECT * FROM "TEST_TABLE";
  </code></pre>