pjs.setSQLOption()

This API was added in version 7.15.0

This API is used to set IBM i Db2 SQL options that are specific to an individual program or module. The API is an equivalent to EXEC SQL SET OPTION in an IBM i program w/embedded SQL.

Parameters

  • Option name (string): The option name to set.

  • Option value (string): The option value.

Valid names and values are:

  • CLOSQLCSR: "*ENDACTGRP", "*ENDMOD"

  • COMMIT: "*CHG", "*NONE", "*CS", "*ALL", "*RR"

  • DATFMT: "*JOB", "*ISO", "*EUR", "*USA", "*JIS", "*MDY", "*DMY", "*YMD", "*JUL"

  • DATSEP: "*JOB", "*SLASH", "/", "*PERIOD", ".", "*COMMA", ",", "*DASH", "-", "*BLANK", " "

  • NAMING: "*SYS", "*SQL"

  • SRTSEQ: "*JOB", "*HEX"

  • TIMFMT: "*HMS", "*ISO", "*EUR", "*USA", "*JIS"

  • TIMSEP: "*JOB", "*COLON", ":", "*PERIOD", ".", "*COMMA", ",", "*BLANK", " "

Option names/values are not case-sensitive. Names/values not listed above will be ignored.

See IBM i docs for a description of each option.

pjs.setSQLOption("DATFMT", "*USA"); const results = pjs.query("select mydate from mytable");