4D v13.4

Get database parameter

Home

 
4D v13.4
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.
Real Display Precision Longint 32 Scope:4D application
Kept between two sessions: No
Possible values: Any positive longint value.
Description: This selector lets you modify or get the number of non-significant digits truncated from the right by the real screen display algorithm. This value is set for the current application and session.
By default, the value of this option is 4. The value 0 indicates that the default value is used and that the parameter has not been modified during the session.
For historical reasons, 4D works with real numbers stored on 10 bytes and converts them to 8 bytes during processing (see the section). This is entirely transparent and does not affect calculations; however certain results may not be displayed as anticipated. For example, the operation 4,1-4,09 displays the result 0.009999999999999780000, but searching for 0.01 finds the correct value.
Here is how 4D goes about displaying a real number: let's take the value 8.97499999999996158 obtained by a calculation as an example (the expected result would normally be 8.975). The algorithm which rounds off most accurately removes the last four digits (6158) by default and then checks whether the last remaining digit is a 0 or a 9. If it is 0, the algorithm goes back to the first 0 and removes all the others. If the value is 9, the algorithm goes back to the first 9 and rounds the decimal up to the next value. In our example, the value 8.974999999999996158 is thus transformed into 8.975
It may happen that certain results end with 5 non-significant digits, like 8.9749999999999986158 for instance. In this case, the algorithm cannot round the value off correctly because the last remaining digit (after removing the last four) is neither 0 nor 9 and it will thus do nothing.
You may want for the precision algorithm to truncate more or less digits according to the specific characteristics of your database. In this case, pass a custom value. Except for zero (4D internal value choice), this value will indicate the number of digits truncated by the precision algorithm.
Keep in mind that this setting does not affect the display of numbers, nor their internal processing.
TCP_NODELAY Longint 33 **** Selector disabled ****
Debug Log Recording Longint 34 Scope: 4D application
Kept between two sessions: No
Possible values: 0, 1, 2, 3 or 4 (0 = do not record, 1 = record, 2 = record in detailed mode, 3 = record in detailed mode with values, 4 = record in detailed mode with values and execution time)
Description: Starts or stops the sequential recording of events occurring at the 4D programming level, intended for debugging the application. By default, the value is 0 (events are not saved).
When this mode is enabled, various types of information can be recorded, more particularly:
- For each event, the number of milliseconds since the creation of the file and the process number ([n])
- The execution of each 4D command (cmd) and each calling of a plug-in (plugInName); in this case, the stack level is indicated (n),
- Each calling of project methods (meth), object methods (obj) and form methods (form).
- When the detailed mode is activated (value = 2), additional information concerning the plug-ins are recorded: events in the plug-in areas (EventCode) and calls to 4D by the plug-ins (externCall).
- When the detailed mode with values is activated (value = 3), the values of the parameters passed to commands, project methods and plug-in commands are also recorded.
- When the detailed mode with execution time is activated (value = 4), the execution time (in milliseconds) of each operation is also indicated. The value "< ms" is shown when a command executes in less than one millisecond.
The events are stored in a file named “4DDebugLog.txt” that is automatically placed in the Logs subfolder of the database, next to the structure file. Each event is systematically recorded in the file before its execution, which guarantees its presence in the file even when the application quits unexpectedly. Be careful, this file is erased and rewritten each time the application is launched. 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 activated 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.
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 MissingRef, MissingRef, MissingRef and MissingRef (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 SSL protocol. For example, you can use this selector to implement SSL 3.0 ciphering algorithms and thus refuse any connections in SSL 2.0.
This setting applies to the entire application (it concerns the HTTP server and the SQL server as well as all the 4D functions that make use of the SSL 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.
By default, 4D uses the RC4 cipher algorithm. If you want to use the (more recent) AES algorithm, pass the following string in the value parameter: "AES:ALL:!aNULL:!eNULL:+RC4:@STRENGTH".
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

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

 
INDEX

Alphabetical list of commands

 
HISTORY 

New
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