©SQL :: Manager
HomeProgram InformationTechnical detailsFree downloadDonate for a cup of coffee
myway SQL Manager for MySQL and MariaDB, Download on Uptodown
SQL functionMySQLMariaDB

The IS_IPV6 SQL Function in MySQL and MariaDB - Check if IPv6 address

IS_IPV6Syntax:IS_IPV6(String)
Return value:INTEGER
Function type:Miscellaneous function
Function Description

The IS_IPV6() function returns 1 if the IPv6 address specified in the "String" expression is valid.

If the IPv6 address is invalid or NULL, the function returns 0.

IPv4 addresses are assumed to be invalid in this function.

SQL Examples for the IS_IPV6 function

 1
 2
 3
 4
 5
 6
 7
 8
 9

SELECT IS_IPV6('fe80::8ade:7cff:fef7:e3a5');
SELECT IS_IPV6('2a02:3030:81e:d48d:cd91:e972:5c6b:90a8');
SELECT IS_IPV6('::1');

SELECT IS_IPV6('127.0.0.1');
SELECT IS_IPV6('');
SELECT IS_IPV6(null);

IS_IPV6('fe80::8ade:7cff:fef7:e3a5')
int(1)
1
IS_IPV6('2a02:3030:81e:d48d:cd91:e972:5c6b:90a8')
int(1)
1
IS_IPV6('::1')
int(1)
1
IS_IPV6('127.0.0.1')
int(1)
0
IS_IPV6('')
int(1)
0
IS_IPV6(null)
int(1)
0
The examples were created with the MyWAY SQL manager: Download

How to use the IS_IPV6() function in MySQL and MariaDB databases

The IS_IPV6() function in MySQL and MariaDB can be used to determine whether a specific string represents a valid IPv6 address. The function takes a character string within the adress as an argument and returns 1 if the string contains a valid IPv6 address, otherwise 0. The function only performs a basic syntax check on the input string to determine if the argument follows the IPv6 format. It does not perform network-level validation and does not check if the IPv6 address is reachable or assigned.

For example, the feature can validate IP addresses to ensure they conform to IPv6 format before further processing or storage. In queries, for example, the function can be used to filter and retrieve only rows that contain valid IPv6 addresses from a table. Applying IS_IPV6() as a constraint or validation rule can ensure that only valid IPv6 addresses are inserted or updated in a table.
INSTRINTERVALIS_IPV4IS_IPV6IS_UUIDISNULLLAST_INSERT_ID

Further MySQL und MariaDB SQL Miscellaneous functions

BIN_TO_UUIDBIN_TO_UUID(Binary string [, Swap])
More about BIN_TO_UUID Function

GET_LOCKGET_LOCK()

INET6_ATONINET6_ATON(String)
More about INET6_ATON Function

INET6_NTOAINET6_NTOA(Binary string)
More about INET6_NTOA Function

INET_ATONINET_ATON(String)
More about INET_ATON Function

INET_NTOAINET_NTOA(Value)
More about INET_NTOA Function

IS_FREE_LOCKIS_FREE_LOCK()

IS_IPV4IS_IPV4(String)
More about IS_IPV4 Function

IS_IPV4_COMPATIS_IPV4_COMPAT(String)

IS_IPV4_MAPPEDIS_IPV4_MAPPED(String)

IS_USED_LOCKIS_USED_LOCK()

IS_UUIDIS_UUID(String)
More about IS_UUID Function

MASTER_GTID_WAITMASTER_GTID_WAIT()

MASTER_POS_WAITMASTER_POS_WAIT()

NAME_CONSTNAME_CONST(Name, Value)
More about NAME_CONST Function

RELEASE_ALL_LOCKSRELEASE_ALL_LOCKS()

RELEASE_LOCKRELEASE_LOCK()

SYS_GUIDSYS_GUID()
More about SYS_GUID Function

UUIDUUID()
More about UUID Function

UUID_SHORTUUID_SHORT()
More about UUID_SHORT Function

UUID_TO_BINUUID_TO_BIN(String [, Swap])
More about UUID_TO_BIN Function

Numeric functionsString functionsRegular ExpressionsDate and Time functions
Comparison functionsEncryption & CompressionConversion functionsNULL functions
Aggregate functionsWindow functionsJSON functionsGeometric functions
Sequence functionsInformation functionsDynamic ColumnsMiscellaneous functions
More information about the IS_IPV6 SQL function: mysql.com and mariadb.com
Updated: 2023-09-17ImprintContactTerms & conditionsPrivacy & CookiesUpdatesSitemapFacebookLinkedinTwitterStatistics©2020-2024 Heino Cunze-Fischer