The System supports these functions forDocumentation Index
Fetch the complete documentation index at: https://docs.ocient.com/llms.txt
Use this file to discover all available pages before exploring further.
IP and IPV4 data types.
IP
Casts theIPV4 data type to the IP data type. The returned value is the IPv6-mapped IPv4 address.
Syntax
SQL
| Argument | Data Type | Description |
|---|---|---|
ipv4_col | CHAR or IPV4 | IP address in the IPV4 data type to cast. |
128.1.2.3 to the IPv6-mapped IPv4 address.
SQL
Text
IPV4
Returns the IPv4 portion of the IPv6 address. You can only cast the IP data type to IPv4 if the IPv6 value has an IPv4 semantic equivalent. The database can convert these IPv6 address formats to IPv4:- IPv4-compatible IPv6
::x.x.x.x - IPv6-mapped IPv4
::ffff:x.x.x.x - NAT64-prefixed
64:ff9b::x.x.x.x
SQL
| Argument | Data Type | Description |
|---|---|---|
ip_col | IP | IPv6-mapped IP address in the IP data type to cast.If the IPv6 address is not IPv4-compatible, IPv6-mapped, or NAT64-prefixed, the cast returns an INVALID DATA TYPE CONVERSION error. |
::ffff:128.1.2.3 to the IPV4 data type. Return the IPv4 portion of the address.
SQL
Text
IS_IPV4
TheIS_IPV4 function tests whether the database can convert the IP value to the IPV4 data type. The database can convert these IPv6 address formats to IPv4:
- IPv4-compatible IPv6
::x.x.x.x - IPv6-mapped IPv4
::ffff:x.x.x.x - NAT64-prefixed
64:ff9b::x.x.x.x
true or false) that indicates whether the conversion works from the specified IP address to the IPv4 address.
Syntax
SQL
| Argument | Data Type | Description |
|---|---|---|
ip_col | IP | Specified IP address for conversion to an IPv4 address. |
::fffe:128.1.2.3 string is a valid IPv4 address. Use the IP function to cast the string as an IP address.
SQL
Text
SUBNET
TheSUBNET function computes the prefix from an IP or IPV4 value and the size of the prefix. The function returns a value of the same type as the ip_col argument.
Syntax
SQL
| Argument | Data Type | Description |
|---|---|---|
ip_col | IP or IPV4 | The IP address for the prefix calculation. |
prefix_size | Integer | The size of the subnet network prefix. For IPV4 addresses, the size must be in the range [0, 32], and for IP addresses, the size must be in the range [0, 128]. If the prefix exceeds these range values, the function returns an INVALID ARGUMENT error. |
64:ff9b::128.2.3.4 with prefix size 98. Use the IP function to cast the string as an IP address.
SQL
Text

