4D v14.3

Get database parameter

Home

 
4D v14.3
Get database parameter

Get database parameter 


 

Get database parameter ( {aTable ;} selector {; stringValue} ) -> Function result 
Parameter Type   Description
aTable  Table in Table from which to get the parameter, or Default table if this parameter is omitted
selector  Longint in Code of the database’s parameter
stringValue  String in String value of the parameter
Function result  Real in Current value of the parameter

The Get database parameter command allows you to get the current value of a 4D database parameter. When the parameter value is a character string, it is returned in the stringValue parameter.

The selector parameter designates the parameter to get. 4D offers you the following predefined constants, which are in the “Database Parameters” theme:

Constant Type Value Comment
Direct2D disabled Longint 0 See selector 69 (Direct2D Status)
Direct2D hardware Longint 1 See selector 69 (Direct2D Status)
Seq order ratio Longint 1 **** Selector disabled ****
Direct2D hardware SVG and editors Longint 2 See selector 69 (Direct2D Status)
Seq access optimization Longint 2 **** Selector disabled ****
Direct2D software Longint 3 See selector 69 (Direct2D Status)
Seq distinct values ratio Longint 3 **** Selector disabled ****
Direct2D software SVG and editors Longint 4 See selector 69 (Direct2D Status)
Index compacting Longint 4 **** Selector disabled ****
Direct2D mixed Longint 5 See selector 69 (Direct2D Status)
Seq query select ratio Longint 5 **** Selector disabled ****
Minimum Web process Longint 6 Scope: 4D local, 4D Server
Kept between two sessions: Yes
Possible values: 0 -> 32 767
Description: Minimum number of Web processes to maintain in non-contextual mode with 4D in local mode and 4D Server. By default, the value is 0 (see below).
Maximum Web process Longint 7 Scope: 4D local, 4D Server
Kept between two sessions: Yes
Possible values: 0 -> 32 767
Description: Command SET DATABASE PARAMETERMaximum number of Web processes to maintain in non-contextual mode with 4D in local mode and 4D Server. By default, the value is 10.
In non-contextual mode, for the Web server to be reactive, 4D delays the Web processes for 5 seconds and reuses them to execute any possible future HTTP queries. In terms of performance, this is actually more advantageous than creating a new process for each query. Once a Web process is reused, it is delayed again for 5 seconds. When the maximum number of Web processes has been reached, the web process is then aborted. If no query has been attributed to a Web process within the 5 second delay, the process is aborted, except if the minimum number of Web processes has been reached (in which case the process is delayed again).
These parameters allow you to adjust how your Web server operates in relation to the number of requests and the memory available as well as other parameters.
Web conversion mode Longint 8 Scope: Current process
Kept between two sessions: No
Possible values: 0, 1, 2 or 3
  • 0 (Default mode) = Conversion to the HTML 4.0 format if it is allowed by the browser. Otherwise, HTML 3.2 format + use of arrays.
  • 1 = 6.0.x conversion mode,
  • 2 = 6.5 conversion mode,
  • 3 = Conversion to the HTML 4.0 format + CSS-P (since version 6.5.2).
Description: Command SET DATABASE PARAMETER Conversion mode of 4D forms for the Web with 4D in local mode and 4D Server. By default, the 4D Web Server uses the cascading style sheets (CSS1) to generate HTML pages similar to the 4D forms displayed in 4D. With this feature, the forms might not convert correctly for databases created with versions of 4D prior to 6.7. Consequently, you have the possibility of setting the form conversion mode.
This mode is set only for the process (Web context) within which the SET DATABASE PARAMETER was called. It can be called from within the On Web Connection Database Method to ensure the compatibility of all the forms of a database, or just before a single form is displayed. If the command is called outside either the contextual mode or a Web process, it has no effect.
Database cache size Longint 9 Scope: 4D application
Kept between two sessions: -
Description: Command Get database parameterAllows you to get the current memory cache size used by 4D for the data. This value is expressed in bytes.
The cache size is derived from the settings defined on the "Database/Memory" page of the Database Settings. The actual size allocated to the database cache, however, will depend on both the settings and the current system resources. This selector allows you to find out the actual size of the memory allocated to the database cache by 4D.
Warning: You cannot set the database cache memory size using the language. In other words, the Database Cache Size selector cannot be set using the SET DATABASE PARAMETER command.
4D Local mode scheduler Longint 10 Scope: 4D application
Kept between two sessions: Yes
Description: see selector 12
4D Server scheduler Longint 11 Scope: 4D application
Kept between two sessions: Yes
Description: see selector 12
4D Remote mode scheduler Longint 12
Scope: 4D application
Kept between two sessions: Yes
Possible values: for selectors 10, 11 and 12, the value parameter is expressed in hexadecimal 0x00aabbcc as follows:    
aa = minimum number of ticks per call to the system (0 to 100 included).
bb = maximum number of ticks per call to the system (0 to 100 included).
cc = number of ticks between calls to the system (0 to 20 included).
If one of the values is out of range, 4D sets it to its maximum. You can pass one of the following preset standard values in the value parameter:
  • value = -1: maximum priority allocated to 4D,
  • value = -2: average priority allocated to 4D,
  • value = -3: minimum priority allocated to 4D.
Description: This parameter allows you to dynamically set the 4D system internal calls. Depending on the Selector, the scheduler value will be set for:
  • 4D local mode when the command is called from a 4D single-user application (selector=10).
  • 4D Server when the command is called from 4D Server (selector=11).
  • 4D remote mode when the command is called from a 4D connected to 4D Server (selector=12).

Note: Command SET DATABASE PARAMETERThe operation of selector 12 (4D Remote Mode Scheduler) differs according to whether the SET DATABASE PARAMETER command is executed on the server machine or on the client machine:
- If the command is executed on the server machine, the new value will be applied to all the client machines that connect to it subsequently.
- If the command is executed on the client machine, the new value is applied to the client machine immediately as well as to all the client machines that connect to the server subsequently.
You can use this operation to implement a dynamic and individualized management of priority for each client machine. This consists in executing the command initially on the client machine to be configured, then a second time on the server machine using the default value, which will then be used for the client machines that connect to it subsequently.
This operation is in effect in 4D starting with versions 6.8.6, 2003.3 and 2004.

Warning: Configuring these selectors inappropriately can cause serious degradation of application performance. It is recommended to only modify the default values with full knowledge of the facts.

4D Server timeout Longint 13 Scope: 4D application if value positive
Kept between two sessions: Yes if value positive
Possible values: 0 -> 32 767
Description: Value of the 4D Server timeout. The default 4D Server timeout value is defined on the "Client-Server/Configuration" page of the Preferences dialog box on the server side.
The 4D Server Timeout selector allows you to set in the corresponding value parameter a new timeout, expressed in minutes. This feature is particularly useful to increase the timeout before executing a blocking and time-consuming operation on the client, such as printing a large number of pages, which can cause an unexpected timeout.
You also have two options:
  • If you pass a positive value in the value parameter, you set a global and permanent timeout: the new value is applied to all process and is stored in the preferences of the 4D application (equivalent to change in the Preferences dialog box).
  • If you pass a negative value in the value parameter, you set a local and temporary timeout: The new value is applied to the calling process only (the other processes keep the default values) and is reset to default as soon as the server receives any signal of activity from the client — for example, when the operation is finished. This option is useful for managing long operations initiated by 4D plug-ins.
To set the "No timeout" option, pass 0 in value. See example 1.
4D Remote mode timeout Longint 14 Scope: 4D application if value positive
Kept between two sessions: Yes if value positive
Description: Value of the timeout granted by the remote 4D machine to the 4D Server machine. The default timeout value used by 4D in remote mode is set on the "Client-Server/Configuration" page of the Preferences dialog box on the remote machine.
For more information about this selector, refer to 4D Server Timeout selector description (13). The 4D Remote Mode Timeout selector can be used in very specific cases.
Port ID Longint 15 Scope: 4D local, 4D Server
Kept between two sessions: No
Description: Command SET DATABASE     TCP port ID used by the 4D Web server with 4D in local mode and 4D Server. The default value, which can be set on the "Web/Configuration" page of the Preferences dialog box, is 80. You can use the constants of the TCP Port Numbers theme for the value parameter.
The Port ID selector is useful for 4D Web Servers compiled and merged with 4D Desktop (in which there is no access to the Design mode). For more information about the TCP port ID, refer to the Web Server Settings section.
IP Address to listen Longint 16 Scope: 4D local, 4D Server
Kept between two sessions: Yes
Description: Constant obsolete (kept for compatibility reasons only). We now recommend using the WEB SET OPTION and WEB GET OPTION commands for configuring the HTTP server.

Character set Longint 17 Scope: 4D local, 4D Server
Kept between two sessions: Yes
Description: Constant obsolete (kept for compatibility reasons only). We now recommend using the WEB SET OPTION and WEB GET OPTION commands for configuring the HTTP server.
Max concurrent Web processes Longint 18 Scope: 4D local, 4D Server
Kept between two sessions: Yes
Description: Constant obsolete (kept for compatibility reasons only). We now recommend using the WEB SET OPTION and WEB GET OPTION commands for configuring the HTTP server.
Client minimum Web process Longint 19 Scope: All 4D remote machines
Kept between two sessions: Yes
Possible values: See selector 6
Description: Used to specify this parameter for all the remote 4D machines used as Web servers. The values defined using these selectors are applied to all the remote machines used as Web servers. If you want to define values only for certain remote machines, use the Preferences dialog box of 4D in remote mode.
Client maximum Web process Longint 20 Scope: All 4D remote machines
Kept between two sessions: Yes
Possible values: See selector 7
Description: Used to specify this parameter for all the remote 4D machines used as Web servers. The values defined using these selectors are applied to all the remote machines used as Web servers. If you want to define values only for certain remote machines, use the Preferences dialog box of 4D in remote mode.
Client Max Web requests size Longint 21 Scope: All 4D remote machines
Kept between two sessions: Yes
Possible values: See selector 27
Description: Used to specify this parameter for all the remote 4D machines used as Web servers. The values defined using these selectors are applied to all the remote machines used as Web servers. If you want to define values only for certain remote machines, use the Preferences dialog box of 4D in remote mode.
Client port ID Longint 22 Scope: All 4D remote machines
Kept between two sessions: Yes
Possible values: See selector 15
Description: Used to specify this parameter for all the remote 4D machines used as Web servers. The values defined using these selectors are applied to all the remote machines used as Web servers. If you want to define values only for certain remote machines, use the Preferences dialog box of 4D in remote mode.
Client IP address to listen Longint 23 Scope: All 4D remote machines
Kept between two sessions: Yes
Possible values: See selector 16
Description: Used to specify this parameter for all the remote 4D machines used as Web servers. The values defined using these selectors are applied to all the remote machines used as Web servers. If you want to define values only for certain remote machines, use the Preferences dialog box of 4D in remote mode.
Client character set Longint 24 Scope: All 4D remote machines
Kept between two sessions: Yes
Possible values: See selector 17
Description: Used to specify this parameter for all the remote 4D machines used as Web servers. The values defined using these selectors are applied to all the remote machines used as Web servers. If you want to define values only for certain remote machines, use the Preferences dialog box of 4D in remote mode.
Client max concurrent Web proc Longint 25 Scope: All 4D remote machines
Kept between two sessions: Yes
Possible values: See selector 18
Description: Used to specify this parameter for all the remote 4D machines used as Web servers. The values defined using these selectors are applied to all the remote machines used as Web servers. If you want to define values only for certain remote machines, use the Preferences dialog box of 4D in remote mode.
Cache writing mode Longint 26 **** Selector disabled ****
Maximum Web requests size Longint 27 Scope: 4D local, 4D Server
Kept between two sessions: Yes
Description: Constant obsolete (kept for compatibility reasons only). We now recommend using the WEB SET OPTION and WEB GET OPTION commands for configuring the HTTP server.
4D Server log recording Longint 28 Scope: 4D Server, 4D remote
Kept between two sessions: No
Possible values: 0 or from 1 to X (0 = do not record, 1 to X = sequential number, added to the file name).
Description: Command SET DATABASE PARAMETERStarts or stops the recording of standard requests received by 4D Server (excluding Web requests). By default, the value is 0 (requests not recorded).
4D Server lets you record each request received by the server machine in a log file. When this mechanism is enabled, the log file is created next to the database structure file. Its name is "4DRequestsLogX," where X is the sequential number of the log. Once the file reaches a size of 10 MB, it is closed and a new file is generated, with an incremented sequential number. If a file of the same name already exists, it is replaced directly. You can set the starting number of the sequence using the value parameter.
This text file stores various information concerning each request in a simple tabulated format: time, process number, user, size of request, processing duration, etc. This information can be particularly useful when fine tuning the application or for statistical purposes. It can be imported, for example, into a spreadsheet software in order to be processed.

Note: It is possible to manually enable or disable the recording of requests using the Ctrl+Alt+L shortcut under Windows or the Command+Option+L shortcut under Mac OS.

Web Log recording Longint 29 Scope: 4D local, 4D Server
Kept between two sessions: Yes
Description: Constant obsolete (kept for compatibility reasons only). We now recommend using the WEB SET OPTION and WEB GET OPTION commands for configuring the HTTP server.
Client Web log recording Longint 30 Scope: All 4D remote machines
Kept between two sessions: Yes
Possible values: 0 = Do not record (default), 1 = Record in CLF format, 2 = Record in DLF format, 3 = Record in ELF format, 4 = Record in WLF format.
Description: Command SET DATABASE PARAMETEStarts or stops the recording of Web requests received by the Web servers of all the client machines. By default, the value is 0 (requests not recorded).
The operation of this selector is identical to that of selector 29; however, it applies to all the 4D remote machines used as Web servers. The "logweb.txt" file is, in this case, automatically placed in the Logs subfolder of the remote 4D database folder (cache folder). If you only want to set values for certain client machines, use the Preferences dialog box of 4D in remote mode.
Table sequence number Longint 31 Scope: 4D application
Kept between two sessions: Yes
Possible values: Any longint value.
Description: Command SET DATABASE PARAMETERThis selector is used to modify or get the current unique number for records of the table passed as parameter. "Current number" means "last number used": if you modify this value using SET DATABASE PARAMETER, the next record will be created with a number that consists of the value passed + 1. This new number is the one returned by the Sequence number command as well in any field of the table to which the "Autoincrement" property has been assigned in the Structure editor or via SQL.
By default, this unique number is set by 4D and corresponds to the order of record creation. For additional information, refer to the documentation of the Sequence number command.
_O_Real display precision Longint 32 **** Selector disabled ****
TCP_NODELAY Longint 33 **** Selector disabled ****
Debug log recording Longint 34 Scope: 4D application
Kept between two sessions: No
Description: Starts or stops the sequential recording of events occurring at the 4D programming level in the 4DDebugLog file, which is automatically placed in the Logs subfolder of the database, next to the structure file. A new, more compact, tabbed text format is used in the event log file "4DDebugLog[_n].txt" starting with 4D v14 (where _n is the segment number of the file).
Possible values: Longint containing a bit field: value = bit1(1)+bit2(2)+bit3(4)+bit4(8)+…).
- Bit 1 (value 1) requests to enable the file (note that any other non-null value also enables it as well)
- Bit 2 (value 2) requests call parameters to methods and commands.
- Bit 3 (value 4) enables new tabbed format.
- Bit 4 (value 8) disables immediate writing of each operation on disk (enabled by default). Immediate writing is slower but more effective, for example for investigating causes of a crash. If you disable this mode, the file contents are more compact and are generated more quickly.
- Bit 5 (value 16) disables recording of plug-in calls (enabled by default).
In the (former) non-tabbed format, execution times are expressed in milliseconds and the "< ms" value is displayed when an operation lasts less than one millisecond.
In the new tabbed format, execution times are expressed in microseconds.
Examples:
SET DATABASE PARAMETER (34;1) // enables mode v13 file without parameters, with runtimes
SET DATABASE PARAMETER (34;2) // enables mode v13 file with parameters and runtimes
SET DATABASE PARAMETER (34;2+4) // enables file with v14 format, with parameters and runtimes
SET DATABASE PARAMETER (34;0) // disables file
To avoid having a file record too much information, you can restrict the 4D commands that are examined by using selector 80, Log Command list.
This option can be enabled for any type of 4D application (4D all modes, 4D Server, 4D Volume Desktop), in interpreted or compiled mode.
Note:
This option is provided solely for the purpose of debugging and must not be put into production since it may lead to deterioration of the application performance and saturation of the hard disk. For more information about this format and on the use of the 4DDebugLog[_n].txt file, please contact the Technical Support of 4D Inc.
Client Server port ID Longint 35 Scope: Database
Kept between two sessions: Yes
Possible values: 0 to 65535
Description: TCP port number where the 4D Server publishes the database (bound for 4D remote machines). By default, the value is 19813.
Customizing this value means that several 4D client-server applications can be used on the same machine with the TCP protocol; in this case, you must indicate a different port number for each application.
The value is stored in the database structure file. It can be set with 4D in local mode but is only taken into account in client-server configuration.
When you modify this value, it is necessary to restart the server machine in order for the new value to be taken into account.
Invert objects Longint 37 Scope: Database
Kept between two sessions: Yes
Possible values: 0, 1 or 2 (0 = mode disabled, 1 = automatic mode, 2 = mode enabled).
Description: Configuration of the "object inversion" mode which is used to invert forms, objects, menu bars, and so on, in Application mode when the database is displayed under Windows in a right-to-left language. This mode can also be configured on the Database/Script Manager page of the application Preferences.
  • Value 0 indicates that the mode is never enabled, regardless of the system configuration (corresponds to the No value in the Preferences).
  • Value 1 indicates that the mode is enabled or disabled depending on the system configuration (corresponds to the Automatic value in the Preferences).
  • Value 2 indicates that the mode is enabled, regardless of the system configuration (corresponds to the Yes value in the Preferences).
For more information, refer to the Design Reference manual of 4D.
HTTPS Port ID Longint 39 Scope: 4D local, 4D Server
Kept between two sessions: Yes
Description: Constant obsolete (kept for compatibility reasons only). We now recommend using the WEB SET OPTION and WEB GET OPTION commands for configuring the HTTP server.
Client HTTPS port ID Longint 40 Scope: All 4D remote machines
Kept between two sessions: Yes
Possible values: 0 to 65535
Description: TCP port number used by the Web servers of the client machines for secure connections via SSL (HTTPS protocol). By default, the value is 443 (standard value).
This selector can be used to modify by programming the TCP port used by the Web servers of the client machines for secure connections via SSL (HTTPS protocol). By default, the value is 443 (standard value).
This selector operates exactly the same way as selector 39; however, it applies to all the 4D remote machines used as Web servers. If you only want to modify the value of certain specific client machines, use the Preferences dialog box of the remote 4D.
Unicode mode Longint 41 Scope: Database
Kept between two sessions: Yes
Possible values: 0 (compatibility mode) or 1 (Unicode mode)
Description: Current database operating mode, with regards to the character set. 4D supports the Unicode character set but can function in “compatibility” mode (based on the Mac ASCII character set). By default, converted databases are executed in compatibility mode (0) and databases created  with version 11 or higher are executed in Unicode mode. The execution mode can be controlled via an option in the Preferences and can also be read or (for testing purposes) modified via this selector. Modifying this option requires the database to be restarted in order for it to be taken into account. Note that within a component it is not possible to modify this value, but only to read it.
Temporary memory size Longint 42 **** Selector disabled ****
SQL Autocommit Longint 43 Scope: Database
Kept between two sessions: Yes
Possible values: 0 (deactivation) or 1 (activation)
Description: Activation or deactivation of the SQL auto-commit mode. By default, the value is 0 (deactivated mode)
The auto-commit mode is used to strengthen the referential integrity of the database. When this mode is active, all SELECT, INSERT, UPDATE and DELETE (SIUD) queries are automatically included in ad hoc transactions when they are not already executed within a transaction. This mode can also be set in the Preferences of the database.
SQL Engine case sensitivity Longint 44 Scope: Database
Kept between two sessions: Yes
Possible values: 0 (case not taken into account) or 1 (case-sensitive)
Description: Activation or deactivation of case-sensitivity for string comparisons carried out by the SQL engine.
By default, the value is 1 (case-sensitive): the SQL engine differentiates between upper and lower case when comparing strings (sorts and queries). For example “ABC”= “ABC” but “ABC” # “Abc.” In certain cases, for example so as to align the functioning of the SQL engine with that of the 4D engine, you may wish for string comparisons to not be case-sensitive (“ABC”=“Abc”).
This option can also be set on the SQL/Configuration page of the application Preferences.
Client log recording Longint 45 Scope: Remote 4D machine
Kept between two sessions: No
Possible values: 0 or from 1 to X (0 = do not record, 1 to X = sequential number, attached to file name).
Description: Starts or stops recording of standard requests carried out by the 4D client machine that executed the command (excluding Web requests). By default, the value is 0 (no recording of requests).
4D lets you record the log of requests carried out by the client machine. When this mechanism is activated, two files are created on the client machine, in the Logs subfolder of the local folder of the database. They are named 4DRequestsLog_X and 4DRequestsLog_ProcessInfo_X, where X is the sequential number of the log. Once the file 4DRequestsLog has reached a size of 10 MB, it is closed and a new one is generated, with an incremented sequential number. If a file with the same name already exists, it is directly replaced. You can set the starting number for the sequence using the value parameter.
These text files store various information concerning each request in a simple tabbed format: time, process number, size of request, processing duration, etc. This information is particularly useful during the development phase of the application or for statistical purposes
Query by formula on server Longint 46 Scope: Current table and process
Kept between two sessions: No
Possible values: 0 (use database configuration), 1 (execute on clientt) or 2 (execute on server)
Description: Execution location of QUERY BY FORMULA and QUERY SELECTION BY FORMULA commands for the table passed in the parameter.
When using a database in client-server mode, the query "by formula" commands can be executed either on the server or on the client machine:
  • In databases created with 4D v11 SQL, these commands are executed on the server.
  • In converted databases, these commands are executed on the client machine, as in previous versions of 4D.
  • In converted databases, a specific preference (Application/Compatibility page) can be used to globally modify the execution location of these commands.
This difference in execution location influences not only application performance (execution on the server is usually faster) but also programming. In fact, the value of the components of the formula (in particular variables called via a method) differ according to the execution context. You can use this selector to punctually adapt the operation of your application.
If you pass 0 in the value l’parameter, the execution location of query "by formula" commands will depend on the database configuration: in databases created with 4D v11 SQL, these commands will be executed on the server. In converted databases, they will be executed on the client machine or the server according to the database preferences. Pass 1 or 2 in value to "force" the execution of these commands, respectively, on the client or on the server machine.
Refer to example 4.
Note: If you want to be able to enable "SQL type" joins (see the QUERY BY FORMULA Joins selector), you must always execute formulas on the server so that they have access to the records. Be careful, in this context, the formula must not contain any calls to a method, otherwise it will automatically be switched to the remote machine.
Order by formula on server Longint 47 Scope: Current table and process
Kept between two sessions: No
Possible values: 0 (use database configuration), 1 (execute on client) or 2 (execute on server)
Description : Execution location of ORDER BY FORMULA command for the table passed in the parameter.
When using a database in client-server mode, this command can be executed either on the server or on the client machine. This selector can be used to specify the execution location of this command (server or client). This mode can also be set in the database preferences. For more information, please refer to the description of selector 46, Query By Formula On Server.
Note: If you want to be able to enable "SQL type" joins (see the QUERY BY FORMULA Joins selector), you must always execute formulas on the server so that they have access to the records. Be careful, in this context, the formula must not contain any calls to a method, otherwise it will automatically be switched to the remote machine.
Auto synchro resources folder Longint 48 Scope: 4D remote machine
Kept between two sessions: No
Possible values: 0 (no synchronization), 1 (auto synchronization) or 2 (ask).
Description: Dynamic synchronization mode for Resources folder of 4D client machine that executed the command with that of the server.
When the contents of the Resources folder on the server has been modified or a user has requested synchronization (for example via the resources explorer or following the execution of the SET DATABASE LOCALIZATION command), the server notifies the connected client machines.
Three synchronization modes are then possible on the client side. The Auto Synchro Resources Folder selector is used to specify the mode to be used by the client machine for the current session:
  • 0 (default value): no dynamic synchronization (synchronization request is ignored)
  • 1: automatic dynamic synchronization
  • 2: display of a dialog box on the client machines, with the possibility of allowing or refusing synchronization.
The synchronization mode can also be set globally in the application Preferences.
Query by formula joins Longint 49 Scope: Current process
Kept between two sessions: No
Possible values: 0 (use database configuration), 1 (always use automatic relations) or 2 (use SQL joins if possible).
Description: Operating mode of the QUERY BY FORMULA and QUERY SELECTION BY FORMULA commands relating to the use of "SQL joins."
In databases created starting with version 11.2 of 4D v11 SQL, these commands carry out joins based on the SQL joins model. This mechanism can be used to modify the selection of a table according to a query carried out on another table without these tables being connected by an automatic relation (necessary condition in previous versions of 4D).
The QUERY BY FORMULA Joins selector lets you specify the operating mode of the query by formula commands for the current process:
  • 0: Uses the current settings of the database (default value). In databases created starting with version 11.2 of 4D v11 SQL, "SQL joins" are always activated for queries by formula. In converted databases, this mechanism is not activated by default for compatibility reasons but can be implemented via a preference.
  • 1: Always use automatic relations (= functioning of previous versions of 4D). In this mode, a relation is necessary in order to set the selection of a table according to queries carried out on another table. 4D does not do "SQL joins."
  • 2: Use SQL joins if possible (= default operation of databases created in version 11.2 and higher of 4D v11 SQL ). In this mode, 4D establishes "SQL joins" for queries by formula when the formula is suited for it (with two notable exceptions, see the description of the QUERY BY FORMULA or QUERY SELECTION BY FORMULA command).
Note: With 4D in remote mode, "SQL joins" can only be used if the formulas are executed on the server (they must have access to the records). To configure where formulas are to be executed, please refer to selectors 46 and 47.
HTTP compression level Longint 50 Scope: 4D application
Kept between two sessions: No
Description: Constant obsolete (kept for compatibility reasons only). We now recommend using the WEB SET OPTION and WEB GET OPTION commands for configuring the HTTP server.
HTTP compression threshold Longint 51 Scope:4D application
Kept between two sessions: No
Description: Constant obsolete (kept for compatibility reasons only). We now recommend using the WEB SET OPTION and WEB GET OPTION commands for configuring the HTTP server.
Server base process stack size Longint 53 Scope: 4D Server
Kept between two sessions: No
Possible values: Positive longint.
Description: Size of the stack allocated to each preemptive system process on the server, expressed in bytes. By default, this value is 1 000 000 (1 MB).
Preemptive system processes (processes of the 4D client base process type) are loaded to control the main 4D client processes. The size allocated by default to the stack of each preemptive process allows a good ease of execution but may prove to be consequential when very large numbers of processes (several hundred) are created.
For optimization purposes, this size can be reduced considerably if the operations carried out by the database allow for it (for example if the database does not carry out sorts of large quantities of records). Values of 512 or even 256 KB are possible. Be careful, under-sizing the stack is critical and can be harmful to the operation of 4D Server. Setting this parameter should be done with caution and must take the database conditions of use into account (number of records, type of operations, etc.).
In order to be taken into account, this parameter must be executed on the server machine (for example in the On Server Startup Database Method).
Idle connections timeout Longint 54 Scope:4D application unless value is negative
Kept between two sessions: No
Possible values: Whole value expressing a duration in seconds. The value can be positive (new connections) or negative (existing connections). By default, the value is 0 (no timeout) with 4D v11 SQL and 20 with 4D v12.
Description: Maximum period of inactivity (timeout) for connections to the both the 4D database engine and the SQL engine. When an idle connection reaches this limit, it is automatically put on standby, which freezes the client/server session and closes the network socket. This functioning is completely transparent for the user: as soon as there is new activity on the connection which is on standby, the socket is automatically reopened and the client/server session is restored.
On the one hand, this setting lets you save resources on the server: connections on standby close the socket and free up a process on the server. On the other hand, it lets you avoid losing connections due to the closing of idle sockets by the firewall. For this, the timeout value for idle connections must be lower than that of the firewall in this case.
If you pass a positive value in value, it applies to all new connections in all the processes. If you pass a negative value, it applies to connections that are open in the current process. If you pass 0, idle connections are not subjected to a timeout.
With 4D v11SQL, this parameter is only taken into account on the server.
With 4D v12, this parameter can be set on both the server and client side. If you pass two different durations, the shorter one is taken into account. Usually, you do not need to change this value.
PHP interpreter IP address Longint 55 Scope: 4D application
Kept between two sessions: No
Values: Formatted string of the type "nnn.nnn.nnn.nnn" (for example "127.0.0.1").
Description:  IP address used locally by 4D to communicate with the PHP interpreter via FastCGI. By default, the value is "127.0.0.1". This address must correspond to the machine where 4D is located. This parameter can also be set globally for all the machines via the Database Settings.
For more information about the PHP interpreter, please refer to the Design Reference manual.
PHP interpreter port Longint 56 Scope: 4D application
Kept between two sessions: No
Values: Positive long integer type value. By default, the value is 8002.
Description: Number of the TCP port used by the PHP interpreter of 4D. This parameter can also be modified globally for all the machines via the Database Settings. For more information about the PHP interpreter, please refer to the Design Reference manual.
PHP number of children Longint 57 Scope: 4D application
Kept between two sessions: No
Values: Positive long integer type value. By default, the value is 5.
Description: Number of child processes to be created and maintained locally by the PHP interpreter of 4D. For optimization reasons, the PHP interpreter creates and uses a set (pool) of system processes called "child processes" for processing script execution requests. You can vary the number of child processes according to the needs of your application. This parameter can also be modified globally for all the machines via the Database Settings. For more information about the PHP interpreter, please refer to the Design Reference manual.
Note: Under Mac OS, all the child processes share the same port. Under Windows, each child process uses a specific port number. The first number is the one set for the PHP interpreter; the other child processes increment the first one. For example, if the default port is 8002 and you launch 5 child processes, they will use ports 8002 to 8006.
PHP max requests Longint 58 Scope: 4D application
Kept between two sessions: No
Values: Positive long integer type value. By default, the value is 500.
Description: Maximum number of requests accepted by the PHP interpreter. When this maximum number is reached, the interpreter returns errors of the "server busy" type. For security or performance reasons, you can modify this value. This parameter can also be modified globally for all the machines via the Database Settings. For more information about this parameter, please refer to the FastCGI-PHP documentation.
Note: On the 4D side, these parameters are applied dynamically; it is not necessary to exit 4D in order for them to be taken into account. On the other hand, if the PHP interpreter is already launched, it will be necessary to exit and relaunch it in order for these modifications to be taken into account.
PHP use external interpreter Longint 60 Scope: 4D application
Kept between two sessions: No
Values : 0 = use internal interpreter, 1 = use external interpreter
Description: Value indicating whether PHP requests in 4D are sent to the internal interpreter provided by 4D or to an external interpreter. By default the value is 0 (use of interpreter provided by 4D). If you want to use your own PHP interpreter, for example in order to use additional modules or a specific configuration, pass 1 in value. In this case, 4D does not launch its internal interpreter in the case of PHP requests.
The custom PHP interpreter must have been compiled in FastCGI and be located on the same machine as the 4D engine. Note that in this case, you must manage the interpreter entirely; it will not be started nor stopped by 4D. This parameter can also be modified globally for all the machines via the Database Settings.
Maximum temporary memory size Longint 61 Scope: 4D application
Kept between two sessions: No
Possible values: Positive longint.
Description: Maximum size of temporary memory that 4D can allocate to each process, expressed in MB. By default, the value is 0 (no maximum size). 4D uses a special temporary memory dedicated to indexing and sorting operations. This memory is intended to preserve the "standard" cache memory during massive operations. It is activated only when needed. By default, the size of the temporary memory is limited only by the resources available (according to the system memory configuration).
This mechanism is suitable for most applications. However, in certain specific contexts, more particularly when a client-server application simultaneously carries out a large number of sequential sorts, the size of the temporary memory can increase critically, to the point where it can render the system unstable. In this context, setting a maximum size for the temporary memory allows you to preserve proper functioning of the application. In return, the running speed might be affected: when the maximum size is reached for a process, 4D uses disk files which may slow down processing. For specific needs such as those described above, a maximum size of around 50 MB is generally a good compromise. However, the ideal value will need to be determined according to the specificities of the application and will generally be the result of real-time volumetric testing.
SSL cipher list String 64 Scope: 4D application
Kept between two sessions: No
Possible values: Sequence of strings separated by colons (for example "RC4-MD5:RC4-64-MD5:....")
Description: Cipher list used by 4D for the secure protocol. This list modifies the priority of ciphering algorithms implemented by 4D. For example, you can pass the following string in the value parameter: "AES:ALL:!aNULL:!eNULL:+RC4:@STRENGTH". For a complete description of the syntax for the ciphers list, refer to the ciphers page of the OpenSSL site.
This setting applies to the entire 4D application (it concerns the HTTP server, SQL server, client/server connections, as well as the HTTP client and all the 4D commands that make use of the secure protocol) but it is temporary (it is not maintained between sessions).
When the cipher list has been modified, you will need to restart the server concerned in order for the new settings to be taken into account.
To reset the cipher list to its default value (stored permanently in the SLI file), call the SET DATABASE PARAMETER command and pass an empty string ("") in the value parameter.
Note: With the Get database parameter command, the cipher list is returned in the optional stringValue parameter and the return parameter is always 0.

Cache unload minimum size Longint 66 Scope: 4D application
Kept between two sessions: No
Possible values: Positive longint > 1.
Description: Minimum size of memory to release from the database cache when the engine needs to make space in order to allocate an object to it (value in bytes).
The purpose of this selector is to reduce the number of times that data is released from the cache in order to obtain better performance. You can vary this setting according to the size of the cache and that of the blocks of data being handled in your database.
By default, if this selector is not used, 4D unloads at least 10% of the cache when space is needed.
Direct2D status Longint 69 Scope: 4D application
Kept between two sessions: No
Description: Activation mode to implement Direct2D under Windows.
Possible values: One of the following constants (mode 5 by default):
Direct2D Disabled (0): Direct2D mode is not enabled and the database functions in the previous mode (GDI/GDIPlus).
Direct2D Hardware (1): Use Direct2D as graphics hardware context for entire 4D application. If this context is not available, use Direct2D graphics software context (except under Vista, in which case GDI/GDIPlus mode is used for better performance).
Direct2D Hardware SVG and Editors (2): Use Direct2D as graphics hardware context for SVG and for the code and structure editors. If this context is not available, use Direct2D graphics software context (except under Vista, in which case GDI/GDIPlus mode is used for better performance).
Direct2D Software (3): Beginning with Windows 7, use Direct2D graphics software context for entire 4D application. Under Vista, GDI/GDIPlus mode is used for better performance.
Direct2D Software SVG and Editors (4): Beginning with Windows 7, use Direct2D graphics software context for SVG and for the code and structure editors. Under Vista, GDI/GDI/GDIPlus mode is used for better performance.
Direct2D Mixed (5) (Default mode): Beginning with Windows 7, use Direct2D graphics hardware context for SVG and for the code and structure editors, and use Direct2D graphics software context for the rest of the 4D application. Under Vista, GDI/GDIPlus mode is used for better performance.
Direct2D get active status Longint 74 Note: You can only use this selector with the Get database parameter command and its value cannot be set.
Description: Returns active implementation of Direct2D under Windows.
Possible values: 0, 1, 2, 3, 4 or 5 (see values of selector 69). The value returned depends on the availability of Direct2D, the hardware and the quality of Direct2D support by the operating system.
For example, if you execute:
 SET DATABASE PARAMETER(Direct2D status;Direct2D Hardware)
 $mode:=Get database parameter(Direct2D get active status)

- On Windows 7 and higher, $mode is set to 1 when the system detects hardware compatible with Direct2D; otherwise, $mode is set to 3 (software context).
- On Windows Vista, $mode is set to 1 when the system detects hardware compatible with Direct2D; otherwise, $mode is set to 0 (disabling of Direct2D).
- On Windows XP, $mode is always set to 0 (not compatible with Direct2D).
Diagnostic log recording Longint 79 Scope: 4D application
Kept between two sessions: No
Possible values: 0 or 1 (0 = do not record, 1 = record)
Description: Starts or stops recording of the 4D diagnostic file. By default, the value is 0 (do not record).
4D can continuously record a set of events related to the internal application operation into a diagnostic file. Information contained in this file is intended for the development of 4D applications and can be analyzed with the help of the 4D tech support. When you pass 1 in this selector, a diagnostic file, named DatabaseName.txt, is automatically created (or opened) in the database Logs folder. Once this file reaches a size of 10 MB, it is closed and a new file named DatabaseNameN.txt is generated, with an incremented sequence number N.
Note that you can include custom information in this file using the LOG EVENT command.
Log command list String 80 Scope: 4D application
Kept between two sessions: No
Possible values: String containing a list of 4D command numbers to record (separated by semi-colons) or "all" to record all the commands or "" (empty string) to record none of them.
Description: List of 4D commands to record in the debugging file (see selector 34, Debug Log Recording). By default, all 4D commands are recorded.
This selector restricts the quantity of information saved in the debugging file by limiting the 4D commands whose execution you want to record. For example, you can write:
 SET DATABASE PARAMETER(Log command list;"277;341") //Record only the QUERY and QUERY SELECTION commands
Spellchecker Longint 81 Scope: 4D application
Kept between two sessions: No
Possible values: 0 (default) = native OS X spellchecker (Hunspell disabled), 1 = Hunspell spellcheck enabled.
Description: Enables the Hunspell spellcheck under OS X. By default, the native spellchecker is enabled on this platform. You may prefer to use the Hunspell spellcheck, for example, in order to unify the interface for your cross-platform applications (under Windows, only the Hunspell spellcheck is available). For more information, refer to Support of Hunspell dictionaries.
QuickTime support Longint 82 Scope: 4D application
Kept between two sessions: Yes
Possible values: 0 (default) = QuickTime disabled, 1 = QuickTime activated.
Description: In 4D starting with v14, by default QuickTime codecs are no longer supported. For compatibility, you can use this selector to re-enable them in your database. Modification of this option requires that the database be restarted. Nevertheless, you should note that in future versions of 4D, QuickTime support is permanently removed.
JSON use local time Longint 85 Scope: Current process
Kept between two sessions: No
Possible values: 0 = ignore local time zone, 1 (default) = take time zone into account.
Description: By default, 4D dates converted to JSON format take the local time zone into account. For example, converting the date !23/08/2013! gives you "2013-08-22T22:00:00Z" in JSON format when the operation is performed in France during Daylight Savings Time (GMT+2). This principle conforms to the standard operation of JavaScript.
This can be a source of errors when you want to send JSON date values to someone in a different time zone. This is the case, for example, when you export a table using  Selection to JSON in France that is meant to be reimported in the US using JSON TO SELECTION. By default, since dates are re-interpreted in each time zone, the values stored in the database will be different. In this case, you can modify the conversion mode for dates so that they do not take the time zone into account by passing 0 in this selector. Converting the date !23/08/2013! will then give you "2013-08-23T00:00:00Z" in all cases.

The following method allows you to get 4D scheduler current values:

 C_LONGINT($ticksbtwcalls;$maxticks;$minticks;$lparams)
 If(Application type=4D Local Mode) ` 4D local mode is used
    $lparams:=Get database parameter(4D Local Mode Scheduler)
    $ticksbtwcalls:=$lparams &0x00ff
    $maxticks:=($lparams>>8)&0x00ff
    $minticks:=($lparams>>16)&0x00ff
 End if

The selector 16 (IP Address to listen) lets you get the IP address on which the 4D Web server receives HTTP requests. The following example splits up the hexadecimal value:

 C_LONGINT($a;$b;$c;$d)
 C_LONGINT($addr)
 $addr:=Get database parameter(IP Address to listen)
 $a:=($addr>>24)&0x000000ff
 $b:=($addr>>16)&0x000000ff
 $c:=($addr>>8)&0x000000ff
 $d:=$addr&0x000000ff

 
PROPERTIES 

Product: 4D
Theme: 4D Environment
Number: 643

 
HISTORY 

Modified: 4D v11 SQL Release 4
Modified: 4D v11 SQL Release 5
Modified: 4D v12
Modified: 4D v13

 
SEE ALSO 

DISTINCT VALUES
QUERY SELECTION
SET DATABASE PARAMETER

 
ARTICLE USAGE

4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v13.5)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)

Inherited from : Get database parameter ( 4D v12.4)