version 2003 (Modified)
Get database parameter ({table; }selector) Longint
| Parameter | Type | Description | |
| table | Table | Table number or, | |
| Default table if this parameter is omitted | |||
| selector | Longint | Code of the database's parameter | |
| Function result | Longint | Current value of the parameter |
Description
The command Get database parameter allows you to read, for the current process, the current value of the 4D database parameters .
The selector parameter designates the parameter to read. 4th Dimension offers you the following predefined constants, which are in the "Database Parameters" theme:
| Constant | Type | Value |
| Seq Order Ratio | Longint | 1 |
| Seq Access Optimization | Longint | 2 |
| Seq Distinct Values Ratio | Longint | 3 |
| Index Compacting | Longint | 4 |
| Seq Query Select Ratio | Longint | 5 |
| Minimum Web Process | Longint | 6 |
| Maximum Web Process | Longint | 7 |
| Web conversion mode | Longint | 8 |
| Database Cache Size | Longint | 9 |
| 4th Dimension Scheduler | Longint | 10 |
| 4D Server Scheduler | Longint | 11 |
| 4D Client Scheduler | Longint | 12 |
| 4D Server Timeout | Longint | 13 |
| 4D Client Timeout | Longint | 14 |
| Port ID | Longint | 15 |
| IP Address to listen | Longint | 16 |
| Character set | Longint | 17 |
| Max Concurrent Web Processes | Longint | 18 |
| Client Minimum process Web | Longint | 19 |
| Client Maximum process Web | Longint | 20 |
| Client Maximum Web requests size | Longint | 21 |
| Client Port ID | Longint | 22 |
| Client IP Address to listen | Longint | 23 |
| Client Character set | Longint | 24 |
| Client Max Concurrent Web Proc | Longint | 25 |
| Cache Writing Mode | Longint | 26 |
| Maximum Web requests size | Longint | 27 |
To know the values that could be returned by this function for the selectors 1 to 8 and 10 to 27, please refer to the description of the SET DATABASE PARAMETER command.
The Database Cache Size (9) selector allows you to get the current database memory cache size. The returned value is expressed in bytes.
The Maximum Cache size can be set on both Windows and Mac OS platforms and the minimum cache size can be only set on the Mac OS platform. Those settings are accessed through the Database properties dialog box. The actual size allocated to the databse cache will however depend on both the settings and the current system resources. The command Get database parameter allows you to get the actual size of the memory allocated to the database cache by 4D.
Note: 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.
Examples
(1) The following method allows you to get 4D scheduler current values:
C_LONGINT($ticksbtwcalls;$maxticks;$minticks;$lparams) If (Application type=4th Dimension) ` 4D single user is used $lparams:=Get database parameter(4th Dimension scheduler) $ticksbtwcalls:=$lparams & 0x00ff $maxticks:=($lparams>>8) & 0x00ff $minticks:=($lparams>>16) & 0x00ff End if
(2) The selector 16 (IP Address to listen) allows you to obtain 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
See Also
DISTINCT VALUES, QUERY SELECTION, SET DATABASE PARAMETER.