Powered by Zoomin Software. For more details please contactZoomin

DataDirect OpenAccess SDK Help

Functions returning constant values

  • Last Updated: May 12, 2026
  • 1 minute read
    • OpenAccess SDK
    • Version 8.1
    • Documentation

Many scalar functions return values that are independent of the row being processed because the input arguments are literals. For example, a function such as today() defined as returning today’s day can be marked as a constant function. This helps in the following ways:

  • The user defined function implementing the function is only called once at the beginning of the query.

  • The function can be treated as a literal value where optimization is concerned. For example, in a query of the form:

    SELECT * FROM events WHERE event_day = today()

    the IP gets a restriction on event_day and its value is that of today (for example, ‘Monday’).

TitleResults for “How to create a CRG?”Also Available inAlert