Skip to main content
Version: Next

SQL SET OPTION

SQL SET OPTION ( option ; value )

ParameterTypeDescription
optionLongint🡒Number of option to set
valueLongint, String🡒New value of option

Description

The SQL SET OPTION command modifies the value of the option passed in option.

option can have one of the following values, located in the “SQL” theme:

ConstantValueComment
SQL asynchronous10 = Synchronous connection (default value), 1 (or value other than 0) = Asynchronous connection
SQL charset100Text encoding used for requests sent to external sources (via the SQL pass-through). The modification is carried out for the current process and the current connection.
Possible values: MIBEnum identifier (see note 2) or value -2 (see note 3)
By default: 106 (UTF-8)
SQL connection timeout5Maximum timeout awaiting response when executing the SQL LOGIN command. This value must be set before opening the connection in order to be taken into account
Possible values: time in seconds
By default: no timeout
SQL data chunk size6Size of data chunk to be sent to the server. This option is mainly useful with Sybase ODBC driver which does not support actual data chunk. Setting a value greater than the default one allows larger data to be sent at a time. Value: size in bytes
By default: 8000
SQL max data length3Maximum length of data returned
SQL max rows2Maximum number of rows in resulting group (used for previews)
SQL query timeout4Maximum timeout awaiting response when executing the SQL EXECUTE command.
Values: time in seconds
By default: no timeout

Notes:

  1. When you work with the internal SQL kernel of 4D, the SQL Asynchronous option serves no purpose due to the fact that this type of connection is always synchronous.
  2. MIBEnum numbers are referenced at the following address: https://www.iana.org/assignments/character-sets.xhtml.
  3. When you pass -2 as the value to SQL Charset, the encoding used by the 4D SQL server is automatically adapted to the running platform (non-UTF encoding):
    • Under Windows, ISO8859-1 is used,
    • Under Mac OS, MAC-ROMAN is used.

System variables and sets

If the command was properly executed, the system variable OK returns 1. Otherwise, it returns 0.

See also

SQL GET OPTION