PROJECT INDEX - UDF LIB HOME

MySQL UDF & Plugin Library

(LibCtype user defined functions library)
Introduction :

LibCtype : several functions that are useful for classifying and mapping codes from the target character or string
Installation :

There are only a few steps you have to follow, or refer to how to install udf lib :
List of functions:
is_alnum, is_alpha, is_cntrl, is_digit, is_graph, is_lower, is_print, is_punct, is_space, is_upper, is_xdigit
BOOL is_alnum(string str)
Function name is_alnum
Purpose

is_alnum() Check for alphanumeric character(s) : a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z o 1 2 3 4 5 6 7 8 9


Returns: 1 if STR is an alnum, 0 if not.

STR : The string to check.

Aggregate function No
Input parameter(s) 1
Conditions -
Output value(s) 1 (STRING)
Examples SELECT is_alnum('test001');
Registration CREATE FUNCTION is_alnum RETURNS STRING SONAME "libctype.so";
UNINSTALL DROP FUNCTION IF EXISTS is_alnum;
goto top

BOOL is_alpha(string str)
Function name is_alpha
Purpose

is_alpha() Check for alphabetic character(s): a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


Returns: 1 if STR is an alnum, 0 if not.

STR : The string to check.

Aggregate function No
Input parameter(s) 1
Conditions -
Output value(s) 1 (STRING)
Examples SELECT is_alpha('azertyQERTY');
Registration CREATE FUNCTION is_alpha RETURNS STRING SONAME "libctype.so";
UNINSTALL DROP FUNCTION IF EXISTS is_alpha;
goto top

BOOL is_cntrl(string str)
Function name is_cntrl
Purpose

is_cntrl() Check for control character(s) : BEL BS CR FF HT NL VT


Returns: 1 if STR is an alnum, 0 if not.

STR : The string to check.

Aggregate function No
Input parameter(s) 1
Conditions -
Output value(s) 1 (STRING)
Examples SELECT is_cntrl('145244855256');
Registration CREATE FUNCTION is_cntrl RETURNS STRING SONAME "libctype.so";
UNINSTALL DROP FUNCTION IF EXISTS is_cntrl;
goto top

BOOL is_digit(string str)
Function name is_digit
Purpose

is_digit() Check for numeric character(s) : 0 1 2 3 4 5 6 7 8 9


Returns: 1 if STR is an alnum, 0 if not.

STR : The string to check.

Aggregate function No
Input parameter(s) 1
Conditions -
Output value(s) 1 (STRING)
Examples SELECT is_digit('145244855256');
Registration CREATE FUNCTION is_digit RETURNS STRING SONAME "libctype.so";
UNINSTALL DROP FUNCTION IF EXISTS is_digit;
goto top

BOOL is_graph(string str)
Function name is_graph
Purpose

is_graph() Check for any printable character(s) except space


Returns: 1 if STR is an alnum, 0 if not.

STR : The string to check.

Aggregate function No
Input parameter(s) 1
Conditions -
Output value(s) 1 (STRING)
Examples SELECT is_graph('QERTY');
Registration CREATE FUNCTION is_graph RETURNS STRING SONAME "libctype.so";
UNINSTALL DROP FUNCTION IF EXISTS is_graph;
goto top

BOOL is_lower(string str)
Function name is_lower
Purpose

is_lower() Check for lowercase character(s) : a b c d e f g h i j k l m n o p q r s t u v w x y z


Returns: 1 if STR is an alnum, 0 if not.

STR : The string to check.

Aggregate function No
Input parameter(s) 1
Conditions -
Output value(s) 1 (STRING)
Examples SELECT is_lower('azerty');
Registration CREATE FUNCTION is_lower RETURNS STRING SONAME "libctype.so";
UNINSTALL DROP FUNCTION IF EXISTS is_lower;
goto top

BOOL is_print(string str)
Function name is_alpha
Purpose

is_print() Check for printable character(s)


Returns: 1 if STR is an alnum, 0 if not.

STR : The string to check.

Aggregate function No
Input parameter(s) 1
Conditions -
Output value(s) 1 (STRING)
Examples SELECT is_print('azerty145244855256');
Registration CREATE FUNCTION is_print RETURNS STRING SONAME "libctype.so";
UNINSTALL DROP FUNCTION IF EXISTS is_print;
goto top

BOOL is_punct(string str)
Function name is_punct
Purpose

is_punct() Check for any printable character which is not whitespace or an alphanumeric character : ! " # % & ' ( ) ; < = > ? [ \ ] * + , - . / : ^ _ { | } ~

Returns: 1 if STR is an alnum, 0 if not.

STR : The string to check.

Aggregate function No
Input parameter(s) 1
Conditions -
Output value(s) 1 (STRING)
Examples SELECT is_punct('...!');
Registration CREATE FUNCTION is_punct RETURNS STRING SONAME "libctype.so";
UNINSTALL DROP FUNCTION IF EXISTS is_punct;
goto top

BOOL is_space(string str)
Function name is_space
Purpose

is_space() Check for whitespace character(s) : CR FF HT NL VT space


Returns: 1 if STR is an alnum, 0 if not.

STR : The string to check.

Aggregate function No
Input parameter(s) 1
Conditions -
Output value(s) 1 (STRING)
Examples SELECT is_space('a ze\n\bszfs\t.');
Registration CREATE FUNCTION is_space RETURNS STRING SONAME "libctype.so";
UNINSTALL DROP FUNCTION IF EXISTS is_space;
goto top

BOOL is_upper(string str)
Function name is_upper
Purpose

is_upper() Check for uppercase character(s) : A B C D E F G H I J K L M N O P Q R S T U V W X Y Z


Returns: 1 if STR is an alnum, 0 if not.

STR : The string to check.

Aggregate function No
Input parameter(s) 1
Conditions -
Output value(s) 1 (STRING)
Examples SELECT is_upper('SAMPLe');
Registration CREATE FUNCTION is_upper RETURNS STRING SONAME "libctype.so";
UNINSTALL DROP FUNCTION IF EXISTS is_upper;
goto top

BOOL is_xdigit(string str)
Function name is_xdigit
Purpose

is_xdigit() Check for character(s) representing a hexadecimal digit : 0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F


Returns: 1 if STR is an hexa number, 0 if not.

STR : The string to check.

Aggregate function No
Input parameter(s) 1
Conditions -
Output value(s) 1 (STRING)
Examples SELECT is_xdigit('AFD0008');
Registration CREATE FUNCTION is_xdigit RETURNS STRING SONAME "libctype.so";
UNINSTALL DROP FUNCTION IF EXISTS is_xdigit;
goto top

INDEX - TOP - CONTACT