INGRES_SET_ENVIRONMENT(3) 1 INGRES_SET_ENVIRONMENT(3)
ingres_set_environment - Set environment features controlling output options
SYNOPSIS
bool ingres_set_environment (resource $link, array $options)
DESCRIPTION
ingres_set_environment(3) is called to set environmental options that affect the output of certain values from Ingres, such as the time-
zone, date format, decimal character separator, and float precision.
PARAMETERS
o $link
- The connection link identifier
o $options
- An enumerated array of option name/value pairs. The following table lists the option name and the expected type
+----------------------+---------------------------------------------------+
| Option name | |
| | |
| | Option type |
| | |
| | Description |
| | |
| | Example |
| | |
+----------------------+---------------------------------------------------+
|date_century_boundary | |
| | |
| | |
| | integer |
| | |
| | The threshold by which a 2-digit year is deter- |
| | mined to be in the current century or in the next |
| | century. Equivalent to II_DATE_CENTURY_BOUNDARY |
| | |
| | 50 |
| | |
| timezone | |
| | |
| | |
| | string |
| | |
| | Controls the timezone of the session. If not set, |
| | it will default the value defined by II_TIME- |
| | ZONE_NAME. If II_TIMEZONE_NAME is not defined, |
| | NA-PACIFIC (GMT-8 with Daylight Savings) is used. |
| | |
| | UNITED-KINGDOM |
| | |
| date_format | |
| | |
| | |
| | integer |
| | |
| | Sets the allowable input and output format for |
| | Ingres dates. Defaults to the value defined by |
| | II_DATE_FORMAT. If II_DATE_FORMAT is not set, the |
| | default date format is US, for example mm/dd/yy. |
| | Valid values for date_format are: |
| | |
| | oINGRES_DATE_DMY |
| | |
| | oINGRES_DATE_FINISH |
| | |
| | oINGRES_DATE_GERMAN |
| | |
| | oINGRES_DATE_ISO |
| | |
| | oINGRES_DATE_ISO4 |
| | |
| | oINGRES_DATE_MDY |
| | |
| | oINGRES_DATE_MULTINATIONAL |
| | |
| | oINGRES_DATE_MULTINATIONAL4 |
| | |
| | oINGRES_DATE_YMD |
| | |
| | oINGRES_DATE_US |
| | |
| | INGRES_DATE_ISO4 |
| | |
| decimal_separator | |
| | |
| | |
| | string |
| | |
| | The character identifier for decimal data |
| | |
| | "," |
| | |
| money_lort | |
| | |
| | |
| | integer |
| | |
| | Leading or trailing currency sign. Valid values |
| | for money_lort are: |
| | |
| | oINGRES_MONEY_LEADING |
| | |
| | oINGRES_MONEY_TRAILING |
| | |
| | INGRES_MONEY_LEADING |
| | |
| money_sign | |
| | |
| | |
| | string |
| | |
| | The currency symbol to be used with the MONEY |
| | datatype |
| | |
| | EUR |
| | |
| money_precision | |
| | |
| | |
| | integer |
| | |
| | The precision of the MONEY datatype |
| | |
| | 2 |
| | |
| float4_precision | |
| | |
| | |
| | integer |
| | |
| | Precision of the FLOAT4 datatype |
| | |
| | 10 |
| | |
| float8_precision | |
| | |
| | |
| | integer |
| | |
| | Precision of the FLOAT8 data |
| | |
| | 10 |
| | |
| blob_segment_length | |
| | |
| | |
| | integer |
| | |
| | The amount of data in bytes to fetch at a time |
| | when retrieving BLOB or CLOB data. Defaults to |
| | 4096 bytes when not set explicitly |
| | |
| | 8192 |
| | |
+----------------------+---------------------------------------------------+
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Set date_format to ISO4
<?php
$options = array( "date_format" => INGRES_DATE_ISO4 );
if (ingres_set_environment($link, $options))
{
$result=ingres_query($link,"select date('now') as date");
while ( $object = ingres_fetch_object ($result) ) {
echo $object->date."
";
}
}
?>
Example #2
Set timezone to HONG-KONG
<?php
$options = array( "timezone" => "HONG-KONG");
if (ingres_set_environment($link, $options))
{
$result=ingres_query($link,"select date('now') as date");
while ( $object = ingres_fetch_object ($result) ) {
echo $object->date."
";
}
}
?>
SEE ALSO
ingres_connect(3), ingres_query(3).
PHP Documentation Group INGRES_SET_ENVIRONMENT(3)