SET DATABASE PARAMETER

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 11.3 (Modified)


SET DATABASE PARAMETER ({aTable; }selector; value)

ParameterTypeDescription
aTableTableTable for which to set the parameter or,
Default table if this parameter is omitted
selectorLongintCode of the database parameter to modify
valueLongint | StringValue of the parameter

Description

The SET DATABASE PARAMETER command allows you to modify various internal parameters of the 4D database.

The selector designates the database parameter to modify. 4D offers predefined constants, which are located in the "Database Parameters" theme. The following table lists each constant, describes its scope and indicates whether any changes made are kept between two sessions:

Constant for selectorValueScopeChanges kept
Seq Order Ratio1**** Selector disabled****-
Seq Access Optimization2**** Selector disabled****-
Seq Distinct Values Ratio3**** Selector disabled****-
Index Compacting4**** Selector disabled****-
Seq Query Select Ratio5**** Selector disabled****-
Minimum Web Process64D local, 4D Server (*)Yes
Maximum Web Process74D local, 4D Server (*)Yes
Web conversion mode8Current process-
Database cache size94D application (*) (**)-
4D Local Mode Scheduler104D application (*)Yes
4D Server Scheduler114D application (*)Yes
4D Remote Mode Scheduler124D application (*)Yes
4D Server Timeout134D application if positive value (***)Yes
4D Client Timeout144D application if positive value (***)Yes
Port ID154D local, 4D Server (*)-
IP Address to listen164D local, 4D Server (*)Yes
Character set174D local, 4D Server (*)Yes
Max Concurrent Web Processes184D local, 4D Server (*)Yes
Client Minimum process Web19All 4D remote machines (*)Yes
Client Maximum process Web20All 4D remote machines (*)Yes
Client Max Web requests size21All 4D remote machines (*)Yes
Client Port ID22All 4D remote machines (*)Yes
Client IP Address to listen23All 4D remote machines (*)Yes
Client Character set24All 4D remote machines (*)Yes
Client Max Concurrent Web Proc25All 4D remote machines (*)Yes
Cache writing mode26**** Selector disabled****-
Maximum Web requests size274D local, 4D Server (*)Yes
4D Server Log Recording284D Server, 4D remote (*)-
Web Log Recording294D local, 4D Server (*)Yes
Client Web Log Recording30All 4D remote machines (*)Yes
Table Sequence Number314D ApplicationYes
Real Display Precision324D Application-
TCP_NODELAY334D Application (*)-
Debug Log Recording344D Application (*)-
Client Server Port ID35Database (*)Yes
WEDD Signature 36Database (*)Yes
Invert Objects37Database (*)Yes
HTTPS Port ID394D local, 4D Server (*)Yes
Client HTTPS Port ID40All 4D remote machines (*)Yes
Unicode mode 41Database (*)Yes
Temporary memory size424D Application (*)-
SQL Autocommit43Database (*)Yes
SQL Engine Case Sensitivity44Database (*)Yes
Client Log Recording454D remote machine(*)-
Query By Formula On Server46Current table and process-
Order By Formula On Server47Current table and process-
Auto Synchro Resources Folder484D remote machine(*)-
QUERY BY FORMULA Joins49Current process(*)-
HTTP Compression Level 504D Application (*)-
HTTP Compression Threshold 514D Application (*)-

(*) The table parameter is ignored in this case.

(**) This selector can only be read (see Get database parameter command).

(***) If the value parameter is negative, the setting is local to the current process and is reset for the next request.

The value designates the value of the parameter. The value passed depends on the parameter that you want to modify. Here are the possible values for each selector:

Selector = 1 (Seq Order Ratio)

This selector has been disabled since it corresponds to a mechanism that has been optimized in 4D version 11.

Selector = 2 (Seq Access Optimization)

This selector has been disabled since it corresponds to a mechanism that has been optimized in 4D version 11.

Selector = 3 (Seq Distinct Values Ratio)

This selector has been disabled since it corresponds to a mechanism that has been optimized in 4D version 11.

Selector = 4 (Index Compacting)

This selector has been disabled since it corresponds to a mechanism that has been optimized in 4D version 11.

Selector = 5 (Seq Query Select Ratio)

This selector has been disabled since it corresponds to a mechanism that has been optimized in 4D version 11.

Selector = 6 (Minimum Web Process)

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).

Selector = 7 (Maximum Web Process)

Values: 0 -> 32,767

Description: Maximum 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.

Selector = 8 (Web conversion mode)

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 + array use.

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: 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.

Note: An additional selector can be used with the Get database parameter command: Database Cache Size (9). This selector cannot be used with the SET DATABASE PARAMETER command. For more information, please refer to the description of the Get database parameter command.

Selector = 10 (4D Local Mode Scheduler)

Selector = 11 (4D Server Scheduler)

Selector = 12 (4D Remote Mode Scheduler)

Values: For these three selectors, the value parameter is expressed in hexadecimal 0x00aabbcc detailed 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: The 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.

Selector = 13 (4D Server Timeout)

Description: This parameter allows changing the 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).

Selector = 14 (4D Client Timeout)

Description: This parameter allows changing the value of the 4D Client timeout. The default 4D Client timeout value is defined on the "Client-Server/Configuration" page of the Preferences dialog box on the client side.

For more information about this selector, refer to 4D Server Timeout selector description (13).

The 4D Client Timeout selector can be used in very specific cases.

Selector = 15 (Port ID)

Description: This parameter allows changing on the fly the 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 Services, Configuration section.

Selector = 16 (IP Address to listen)

Description: This parameter allows the user to change on the fly the IP address on which the 4D Web server will receive HTTP requests with 4D in local mode and 4D Server. By default, no specific address is defined (value = 0). This parameter can be set in the Preferences of the database.

The IP Address to listen selector is useful for 4D Web Servers compiled and merged with 4D Desktop (in which there is no access to the Design mode).

You will pass in the value parameter a hexadecimal IP address. That is, to designate a IP address such as "a.b.c.d", you should write:

   C_LONGINT($addr)
   $addr:=($a<<24)|($b<<16)|($c<<8)|$d
   SET DATABASE PARAMETER(IP Address to listen;$addr)

See also example 2. For more information on how to designate the IP address, refer to the Web Services, Web Server Settings section.

Selector = 17 (Character set)

Description: This parameter allows the user to change on the fly the character set that the 4D Web Server (with 4D in local mode and 4D Server) should use to communicate with browsers connecting to the database. The default value actually depends on the language of the operating system.

This parameter can be set in Preferences of the database. The Character set selector is useful for 4D Web Servers compiled and merged with 4D Desktop (in which there is no access to the Design mode).

Values: The possible values depend on the operating mode of the database relating to the character set.

Unicode Mode: When the application is operating in Unicode mode, the values to pass for this parameter are character set identifiers (MIBEnum, identifiers defined by IANA, see the following address: http://www.iana.org/assignments/character-sets). Here is the list of identifiers corresponding to the character sets supported by the 4D Web server:

4 = ISO-8859-1
12 = ISO-8859-9
13 = ISO-8859-10
17 = ShiftJIS
2026 = Big5
38 = euc-kr
106 = UTF-8
2250 = Windows-1250
2251 = Windows-1251
2253 = Windows-1253
2255 = Windows-1255
2256 = Windows-1256

Note: In the context of the Character set parameter, the Get database parameter command returns the IANA name of the character set in the optional stringValue parameter.

ASCII compatibility mode:

0: Western European
1: Japanese
2: Chinese
3: Korean
4: User-defined
5: Reserved
6: Central European
7: Cyrillic
8: Arabic
9: Greek
10: Hebrew
11: Turkish
12: Baltic

Note: For more information about Unicode mode, please refer to the description of selector 41.

Selector = 18 (Max Concurrent Web Processes)

Values: You can pass any value between 10 and 32 000. The default value is 32 000.

Description: This parameter allows setting the strictly high limit of concurrent Web processes of any type (contextual, non-contextual or belonging to the "pool of processes"— see selector 7, Maximum Web Process) supported by the 4D Web Server with 4D in local mode and 4D Server. When this number (minus one) is reached, 4D will not create any other processes and returns the HTTP status 503 - Service Unavailable to all new requests.

This parameter can prevent the 4D Web Server from saturation, which can occur when an exceedingly large number of concurrent requests are sent, or when too many context creations are requested. This parameter can also be set in the Preferences dialog box (see the Web Services, Web Server Settings section).

In theory, the maximum number of Web processes is the result of the following formula: Available memory/Web process stack size. Another solution is to visualize the information on Web processes displayed in the Runtime Explorer: the current number of Web processes and the maximum number reached since the Web server boot are indicated.

Note: If you pass a value inferior to the high limit of the "pool of processes," this limit is reduced in order to match the value of the selector 18. If necessary, the low limit of the pool (see selector 6, Minimum Web Process) is also modified.

Selector = 19 (Client Minimum process Web)

Selector = 20 (Client Maximum process Web)

Selector = 21 (Client Max Web requests size)

Selector = 22 (Client Port ID)

Selector = 23 (Client IP Address to listen)

Selector = 24 (Client Character set)

Selector = 25 (Client Max Concurrent Web Proc)

Values: Identical to those of the corresponding 4D in local mode or 4D Server selectors (see selectors 6 to 8, 15 to 18 and 27).

Description: These selectors are used to specify the operating parameters of 4D Client machines used as Web servers.

The values defined using these selectors are applied to all the 4D Client machines used as Web servers. If you want to define values only for certain 4D Client machines, use the 4D Client Preferences dialog box.

Selector = 26 (Cache writing mode)

This selector has been disabled since it corresponds to a mechanism that has been optimized in 4D version 11.

Selector = 27 (Maximum Web requests size)

Values: 500 000 to 2 147 483 648.

Description: Maximum size (in bytes) of incoming HTTP requests (POST) that the Web server is authorized to process. By default, the value is 2 000 000, i.e. a little less than 2 MB. Passing the maximum value (2 147 483 648) means that, in practice, no limit is set.

This limit is used to avoid Web server saturation due to incoming requests that are too large. When a request reaches this limit, the 4D Web server refuses it.

Selector = 28 (4D Server Log Recording)

Values: 0 or from 1 to X (0 = do not record, 1 to X = sequential number, added to the file name).

Description: Starts 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.

Selector = 29 (Web Log Recording)

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: Starts or stops the recording of Web requests received by the Web server of 4D in local mode or 4D Server. By default, the value is 0 (requests not recorded).

The log of Web requests is stored as a text file named "logweb.txt" that is automatically placed next to the database structure file. The format of this file is determined by the value that you pass. For more information about Web log file formats, please refer to the Information about the Web Site section.

This file can also be activated on the "Web/Advanced" page of the 4D Preferences.

WARNING: Formats 3 and 4 are custom formats whose contents must be set beforehand in the application Preferences on the "Web/Log Format" page. If you use one of these formats without any of its fields having been selected on this page, the log file will not be generated.

Selector = 30 (Client Web Log Recording)

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: Starts 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 Client machines used as Web servers. If you only want to set values for certain client machines, use the Preferences dialog box of 4D Client.

Selector = 31 (Table Sequence Number)

Values: Any longint value.

Description: This 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).

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.

Selector = 32 (Real Display Precision)

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 Display of Real Numbers 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.

Selector = 33 (TCP_NODELAY)

Possible values: 0 or 1 (0 = disable, 1 = enable)

Description: Enabling or disabling of the TCP_NODELAY network option. This option, which is internal to the TCP/IP protocol, controls a network communications optimization mechanism. It can be set separately for the server machine and the client machines. By default, the value is 1 (option enabled) on all the machines (server and clients).

In specific cases, in particular in the case of client/server connections by DSL or by VPN (Virtual Private Network), disabling this option can noticeably improve application performance. This operation should be carried out with caution and must be accompanied by load testing in the different client/server configurations.

If you modify this value, it will be necessary to restart the application in order for the new value to be taken into account.

Selector = 34 (Debug Log Recording)

Possible values: 0, 1 or 2 (0 = do not record, 1 = record, 2 = record in detailed mode)

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).

The events are stored in a file named "4DDebugLog.txt" that is automatically placed next to the database 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.

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.

Selector = 35 (Client Server Port ID)

Possible values: 0 to 65535

Description: This parameter can be used to change the TCP port number where the 4D Server publishes the database (bound for 4D Client machines) by programming. 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.

Selector = 36 (WEDD Signature)

Possible values: String of 1 to 255 c haracters.

Description: This parameter can be used to modify the WEDD signature of the open database (structure file and data file). By default, this signature is blank (the parameter is not defined). Keep in mind that the signature is case senstive.

The WEDD signature is used to associate a structure file with a specific data file. A structure file containing a WEDD signature can only be opened with the data file containing the same WEDD signature and vice versa. For more information about the WEDD signature, please refer to the Design Reference manual.

Setting this value by programming facilitates the distribution of upgrades for applications that have a custom signature.

Note: When you use this selector with the Get database parameter command, the string defined as the WEDD signature is returned in the optional stringValue parameter and the command returns 0.

Selector = 37 (Invert Objects)

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.

Selector = 39 (HTTPS Port ID)

Possible values: 0 to 65535

Description: This selector can be used to modify by programming the TCP port number used by the Web server of 4D in local mode and of 4D Server for secure connections via SSL (HTTPS protocol). The HTTPS port number is set on the "Web/Configuration" page of the Preferences dialog box. For more information, please refer to the Web Server Settings section.

By default, the value is 443 (standard value). You can use the constants of the "TCP Port Numbers" theme for the value parameter.

Selector = 40 (Client HTTPS Port ID)

Possible values: 0 to 65535

Description: 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 Client machines used as Web servers. If you only want to modify the value of certain specific client machines, use the Preferences dialog box of 4D Client.

Selector = 41 (Unicode mode)

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.

Selector = 42 (Temporary memory size)

Possible values: Positive longint > 50,000,000

Description: Temporary memory size expressed in bytes. By default, this size is 50,000,000 (50 MB).

4D uses a special temporary memory that is devoted to indexing and sorting operations. The purpose of this memory is to protect the "standard" cache memory during mass operations. When the maximum size of temporary memory is reached (critical case), 4D automatically interrupts the last operation requested in order to avoid penalizing other processing underway. In most cases, the default configuration of the temporary memory will be perfectly adequate. However, in certain specific applications carrying out sorts or indexing in an especially intensive manner, increasing this memory size might help to noticeably improve performance. The ideal value will need to be determined empirically according to the specific features of the application and will generally be the result of real volumetric testing.

Selector = 43 (SQL Autocommit)

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.

Selector = 44 (SQL Engine Case Sensitivity)

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.

Selector = 45 (Client Log Recording)

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.

Selector = 46 (Query By Formula On Server)

Possible values: 0 (use database configuration), 1 (execute on client) 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 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.

Selector = 47 (Order By Formula On Server)

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, the ORDER BY FORMULA 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). For more information, please refer to the description of selector 46, Query By Formula On Server.

Selector = 48 (Auto Synchro Resources Folder)

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 NOTIFY RESOURCES FOLDER MODIFICATION 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:

- value = 0 (default value) = no dynamic synchronization (synchronization request is ignored)

- value = automatic dynamic synchronization

- value = 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

Selector = 49 (QUERY BY FORMULA Joins)

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:

- value = 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.

- value = 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."

- value = 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).

Selector = 50 (HTTP Compression Level)

Possible values: 1 to 9 (1 = faster, 9 = more compressed) or -1 = best compromise.

Description: Sets the level of compression for all compressed HTTP exchanges for Web Services (client requests or server replies). Compressed exchanges are an optimization that you can implement when you have two 4D applications that are communi-cating via Web services (see the SET WEB SERVICE OPTION command). This selector lets you optimize exchanges by either privileging speed of execution (less compression) or the amount of compres-sion (less speed). The choice of a value depends on the size and type of data exchanged. Pass 1 to 9 in the value parameter where 1 is the fastest compression and 9 the highest. You can also pass -1 to get a compromise between speed and rate of compression. By default, the compression level is 1 (faster compression).

Selector = 51 (HTTP Compression Threshold)

Possible values: Any Longint type value.

Description: In the framework of inter-4D Web Services exchanges in optimized mode (see above), sets the size threshold for requests below which exchanges should not be compressed. This configura-tion is useful in order to avoid losing machine time by compressing small exchanges.

Pass the size expressed in bytes in value. By default, the compression threshold is set to 1024 bytes.

Examples

1. The following statement will avoid any unexpected timeout:

      `Increasing the timeout to 3 hours for the current process
   SET DATABASE PARAMETER(4D Server Timeout;-60*3)
      `Executing a time-consuming operation with no control from 4D
   ...
   WR PRINT MERGE (Area;3;0)
   ...

2. The IP address 192.193.194.195 will be set with the following statement:

   SET DATABASE PARAMETER(IP Address to listen;0xC0C1C2C3)

3. This code can be used to switch the current character set and restart the database:

   Current_unicode_mode:=Get database parameter(Unicode mode)
   SET DATABASE PARAMETER(Unicode mode;1-Current_unicode_mode)
   OPEN DATA FILE(Data file)

4. This example temporarily forces the execution of a query by formula command on the client machine:

   curVal:= Get database parameter([table1];Query By Formula On Server)   `Store the current setting
   SET DATABASE PARAMETER([table1];Query By Formula On Server;1)  `Force execution on the client machine
   QUERY BY FORMULA([table1];myformula)
   SET DATABASE PARAMETER([table1];Query By Formula On Server;curVal)  `Re-establish current setting

See Also

Get database parameter, QUERY SELECTION.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next