For AI agents: an index of this documentation is at https://developer.rippling.com/llms.txt. Public pages have a Markdown version at the same URL with .md added.

Skip to main content
index

GENERATOR() Function

Use with AI:Rippling AI ChatGPT Claude Cursor

Description​

Creates rows of data based either on a specified number of rows, a specified generation period (in seconds), or both

Syntax​

GENERATOR( ROWCOUNT => count [ , TIMELIMIT => sec ] )

Parameters​

ParameterDescriptionRequired
countThe number of rows to returnYes
secThe number of seconds the query should runYes

Notes​

  • count and sec must be non-negative numbers
  • If only the ROWCOUNT argument is specified, the resulting table will contain count rows
  • If only the TIMELIMIT argument is specified, the query runs for sec seconds, generating as many rows as possible within the time frame
  • If both the ROWCOUNT and TIMELIMIT arguments are specified, then:
    • If the ROWCOUNT is reached before the TIMELIMIT, the resulting table will contain count rows
    • If the TIMELIMIT is reached before the ROWCOUNT, the table will contain the number of rows generated within the time frame
  • If ROWCOUNT or TIMELIMIT is null, it will be ignored, so generator(ROWCOUNT => null) generates 0 rows
  • If both parameters (ROWCOUNT and TIMELIMIT) are omitted, the GENERATOR function returns 0 rows

Example​

SELECT
SEQ4() AS NUM
FROM
TABLE (GENERATOR(ROWCOUNT=>10)) AS SEQ;