MentDB, The digital brain.  About me Home
Back / All functions / FX

Like all languages, you have a few data manipulation functions.

Atom

atom before_excludatom before_includatom countatom count_distinctatom count_lrtrimatom count_lrtrim_distinctatom distinctatom distinct_lrtrimatom distinct_lrtrim_1sbeforeatom findatom find_lrtrimatom getatom get_firstatom get_first_lrtrimatom get_lastatom get_last_lrtrimatom get_lrtrimatom lrtrimatom positionatom position_lrtrimatom size

File

file createfile load

Date

date adddate addtdate current_msdate current_nsdate curdatedate current_datedate current_timedate current_timestampdate curtimedate curtimestampdate dateadddate dateaddtdate datediffdate datedifftdate ts_to_longdate dt_to_longdate day_of_monthdate day_of_weekdate day_of_yeardate daynamedate diffdate difftdate full_systimestampdate hourdate is_valid_datedate is_valid_datedate is_valid_timedate is_valid_timestampdate is_valid_timestampdate formatdate minutedate monthdate monthnamedate secondedate sysdatedate systimedate systimestampdate systimestamp_mindate timedate year

Math

math absmath acosmath asinmath atanmath atan2math avgmath bit_andmath bit_ormath bit_xormath cbrtmath ceilmath ceilingmath cosmath coshmath cotmath decimal_formatmath deg_to_radmath emath expmath expm1math floormath hypotmath logmath log10math log1pmath maxmath minmath modmath pimath powmath powermath rad_to_degmath randommath rintmath roundmath signmath signummath sinmath sinhmath sqrtmath tanmath tanhmath ulp

String

string asciistring binstring bit_lengthstring charstring char_lengthstring char_to_intconcatstring levenshtein_distancestring countstring encode_b64string decode_b64string del_char_before_each_linestring ends_withstring first_letter_upperstring first_letterstring generate_random_strstring hexstring hex_to_intstring hex_to_strstring indentstring instrstring instrstring int_to_charstring int_to_hexstring int_to_octstring is_letterstring is_alpha_num_udsstring is_alpha_numstring is_number_charstring itrimstring lcasestring leftstring lengthstring likestring locatestring locatestring lowerstring lpadstring lrtrimstring lrtrim0string ltrimstring matchesstring midstring midstring not_likestring not_regexpstring octstring oct_to_intstring positionstring positionstring regexpstring repeatstring repeat_insert_strstring replacestring reversestring rightstring rpadstring rtrimstring spacestring splitstring starts_withstring str_to_hexstring strcmpstring strposstring strposstring sublrcharstring substrstring substrstring substringstring substringstring to_stringstring encodestring empty_if_nullstring null_if_emptystring trimstring txtstring txt2string ucasestring unhexstring upperstring zero

Type

type is_booltype is_chartype is_datetype is_decimaltype is_emailtype is_hourtype is_timetype is_hour_without_sectype is_integertype is_numbertype is_bytetype is_small_inttype is_medium_inttype is_inttype is_big_inttype is_floattype is_doubletype is_timestamptype is_valid_datetype is_valid_datetype is_valid_timetype is_valid_timestamptype is_valid_timestamptype is_varchartype data showtype data reload

atom before_exclud <atomList> <index> <separator>

Description

    get the atom list before the first occurrence of an atom in an atom list (excluded atom).

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    index:   The index atom - Number - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom before_exclud " A, B,A ,A ,C, D " "3" ","
mentdb
A, B

atom before_includ <atomList> <index> <separator>

Description

    get the atom list before the first occurrence of an atom in an atom list (included atom).

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    index:   The index atom - Number - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom before_includ " A, B,A ,A ,C, D " "3" ","
mentdb
A, B,A

atom count <atomList> <atomToCount> <separator>

Description

    count the occurrence number of an atom in an atom list.

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    atomToCount:   The atom to search - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom count " A, B,A ,A ,C, D " "A " ","
mentdb
2

atom count_distinct <atomList> <atomToCount> <separator>

Description

    count the occurrence number of a distinct atom in an atom list.

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    atomToCount:   The atom to search - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom count_distinct " A, B,A ,A ,C, D " "A " ","
mentdb
1

atom count_lrtrim <atomList> <atomToCount> <separator>

Description

    count the occurrence number of a lrtrim atom in an atom list.

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    atomToCount:   The atom to search - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom count_lrtrim " A, B,A ,A ,C, D " "A " ","
mentdb
3

atom count_lrtrim_distinct <atomList> <atomToCount> <separator>

Description

    count the occurrence number of a lrtrim distinct atom in an atom list.

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    atomToCount:   The atom to search - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom count_lrtrim_distinct " A, B,A ,A ,C, D " "A " ","
mentdb
1

atom distinct <atomList> <separator>

Description

    get distinct atom for each atom in a list

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom distinct "A,B,A,A ,C,D" ","
mentdb
A,B,A ,C,D

atom distinct_lrtrim <atomList> <separator>

Description

    get lrtrim distinct atom for each atom in a list

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom distinct_lrtrim " A, B,A ,A ,C, D " ","
mentdb
A,B,C,D

atom distinct_lrtrim_1sbefore <atomList> <separator>

Description

    get lrtrim distinct atom for each atom in a list. add one space before all atoms, except the first.

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom distinct_lrtrim_1sbefore " A, B,A ,A ,C, D " ","
mentdb
A, B, C, D

atom find <atomList> <atomToFind> <separator>

Description

    find the position of atom in an atom list.

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    atomToFind:   The atom to search - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom find " A, B,A ,A ,C, D " "A " ","
mentdb
3

atom find_lrtrim <atomList> <atomToFind> <separator>

Description

    find the position of atom in an atom list. lrtrim on each atom before.

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    atomToFind:   The atom to search - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom find_lrtrim " A, B,A ,A ,C, D " "A " ","
mentdb
1

atom get <atomList> <index> <separator>

Description

    get atom at the specific index in an atom list

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    index:   Position of the atom (start to 1) - Number - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom get "A,B,C,D" 2 ","
mentdb
B

atom get_first <atomList> <separator>

Description

    get the first atom in an atom list

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom get_first "A, B ,C,D" ","
mentdb
A

atom get_first_lrtrim <atomList> <separator>

Description

    get the first lrtrim atom in an atom list

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom get_first_lrtrim " A, B ,C,D" ","
mentdb
A

atom get_last <atomList> <separator>

Description

    get the last atom in an atom list

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom get_last "A, B ,C,D" ","
mentdb
D

atom get_last_lrtrim <atomList> <separator>

Description

    get the last lrtrim atom in an atom list

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom get_last_lrtrim " A, B ,C, D" ","
mentdb
D

atom get_lrtrim <atomList> <index> <separator>

Description

    get lrtrim atom at the specific index in an atom list

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    index:   Position of the atom (start to 1) - Number - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom get_lrtrim "A, B ,C,D" 2 ","
mentdb
B

atom lrtrim <atomList> <separator>

Description

    get lrtrim atom for each atom in a list

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom lrtrim " A, B,A ,A ,C, D " ","
mentdb
A,B,A,A,C,D

atom position <atomList> <atomToFind> <separator>

Description

    find the position of atom in an atom list.

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    atomToFind:   The atom to search - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom position " A, B,A ,A ,C, D " "A " ","
mentdb
3

atom position_lrtrim <atomList> <atomToFind> <separator>

Description

    find the position of atom in an atom list. lrtrim on each atom before.

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    atomToFind:   The atom to search - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom position_lrtrim " A, B,A ,A ,C, D " "A " ","
mentdb
1

atom size <atomList> <separator>

Description

    get size atom of an atom list (size >=1)

Parameters

    atomList:   Atom list (example A,B,C) - String - required
    separator:   List Separator (in this example ','), 1 CHAR MAX - Number - required
admin
atom size "A,B,C,D" ","
mentdb
4

file create <filePath> <data>

Description

    Create a new text file

Parameters

    filePath:   The path to the file - String - required
    data:   String data - String - required
admin
file create "data/.id" (string generate_random_str 12;)
mentdb
1

file load <filePath>

Description

    To get text from a file

Parameters

    filePath:   The path to the file - String - required
admin
file load "data/.id"
mentdb
2pvrPdmfuTrz

date add <date> <field> <number>

Description

    add a number to a date.

Parameters

    date:   The date - String - required
    field:   The field to add (DAY|MONTH|YEAR) - String - required
    number:   The number to add - Number - required
admin
date add "1980-06-18" "DAY" 1
mentdb
1980-06-19

date addt <timestamp> <field> <number>

Description

    add a number to a time stamp.

Parameters

    timestamp:   The timestamp - String - required
    field:   The field to add (SEC|MIN|HOUR|DAY|MONTH|YEAR) - String - required
    number:   The number to add - Number - required
admin
date addt "1980-06-18 00:00:00" "DAY" 1
mentdb
1980-06-19 00:00:00

date current_ms

Description

    returns the current time in milli second.

admin
date current_ms
mentdb
1496164604097

date current_ns

Description

    returns the current time in nano second.

admin
date current_ns
mentdb
823603146305304

date curdate

Description

    returns the current date.

admin
date curdate
mentdb
2015-09-13

date current_date

Description

    returns the current date.

admin
date current_date
mentdb
2015-09-13

date current_time

Description

    returns the current time.

admin
date current_time
mentdb
14:01:22

date current_timestamp

Description

    returns the current timestamp.

admin
date current_timestamp
mentdb
2015-09-13 14:01:42

date curtime

Description

    returns the current time.

admin
date curtime
mentdb
14:01:57

date curtimestamp

Description

    returns the current timestamp.

admin
date curtimestamp
mentdb
2015-09-13 14:02:13

date dateadd <date> <field> <number>

Description

    add a number to a date.

Parameters

    date:   The date - String - required
    field:   The field to add (DAY|MONTH|YEAR) - String - required
    number:   The number to add - Number - required
admin
date dateadd "1980-06-18" "DAY" 1
mentdb
1980-06-19

date dateaddt <timestamp> <field> <number>

Description

    add a number to a timestamp.

Parameters

    timestamp:   The timestamp - String - required
    field:   The field to add (SEC|MIN|HOUR|DAY|MONTH|YEAR) - String - required
    number:   The number to add - Number - required
admin
date dateaddt "1980-06-18 00:00:00" "DAY" 1
mentdb
1980-06-19 00:00:00

date datediff <date> <field> <number>

Description

    sub a number to a date.

Parameters

    date:   The date - String - required
    field:   The field to add (DAY|MONTH|YEAR) - String - required
    number:   The number to add - Number - required
admin
date datediff "1980-06-18" "DAY" 1
mentdb
1980-06-17

date datedifft <timestamp> <field> <number>

Description

    sub a number to a date.

Parameters

    timestamp:   The timestamp - String - required
    field:   The field to add (SEC|MIN|HOUR|DAY|MONTH|YEAR) - String - required
    number:   The number to add - Number - required
admin
date datedifft "1980-06-18 00:00:00" "DAY" 1
mentdb
1980-06-17 00:00:00

date ts_to_long <timestamp>

Description

    timestamp to long.

Parameters

    timestamp:   The timestamp - String - required
admin
date ts_to_long "1980-06-18 00:00:00"
mentdb
330120000000

date dt_to_long <date>

Description

    date to long.

Parameters

    date:   The date - String - required
admin
date dt_to_long "1980-06-18"
mentdb
330120000000

date day_of_month <date>

Description

    get the day of month of a date.

Parameters

    date:   The date - String - required
admin
date day_of_month "1980-06-18"
mentdb
18

date day_of_week <date>

Description

    get the day of week of a date.

Parameters

    date:   The date - String - required
admin
date day_of_week "1980-06-18"
mentdb
3

date day_of_year <date>

Description

    get the day of year of a date.

Parameters

    date:   The date - String - required
admin
date day_of_year "1980-06-18"
mentdb
170

date dayname <date>

Description

    get the day name of a date.

Parameters

    date:   The date - String - required
admin
date dayname "1980-06-18"
mentdb
mercredi

date diff <date> <field> <number>

Description

    sub a number to a date.

Parameters

    date:   The date - String - required
    field:   The field to add (DAY|MONTH|YEAR) - String - required
    number:   The number to add - Number - required
admin
date diff "1980-06-18" "DAY" 1
mentdb
1980-06-17

date difft <timestamp> <field> <number>

Description

    sub a number to a time stamp.

Parameters

    timestamp:   The timestamp - String - required
    field:   The field to add (SEC|MIN|HOUR|DAY|MONTH|YEAR) - String - required
    number:   The number to add - Number - required
admin
date difft "1980-06-18 00:00:00" "DAY" 1
mentdb
1980-06-17 00:00:00

date full_systimestamp

Description

    returns the current full timestamp.

admin
date full_systimestamp
mentdb
2015-09-13 14:03:20.395+0400

date hour <time>

Description

    get the hour of a time.

Parameters

    time:   The time - String - required
admin
date hour "12:15:56"
mentdb
12

date is_valid_date <dateToValidate>

Description

    check if a date is valid.

Parameters

    dateToValidate:   The date - String - required
admin
date is_valid_date "1980-06-18"
mentdb
1

date is_valid_date <dateToValidate> <format>

Description

    check if a date is valid.

Parameters

    dateToValidate:   The date - String - required
    format:   The date format - String - required
admin
date is_valid_date "1980-06-18" "yyyy-MM-dd"
mentdb
1

date is_valid_time <timeToValidate>

Description

    check if a time is valid.

Parameters

    timeToValidate:   The time (12:00:01) - String - required
admin
date is_valid_time "12:00:01"
mentdb
1

date is_valid_timestamp <timestampToValidate>

Description

    check if a timestamp is valid.

Parameters

    timestampToValidate:   The timestamp - String - required
admin
date is_valid_timestamp "1980-06-18 12:00:01"
mentdb
1

date is_valid_timestamp <timestampToValidate> <format>

Description

    check if a timestamp is valid.

Parameters

    timestampToValidate:   The timestamp - String - required
    format:   The format (ex: yyyy MM dd HH:mm:ss) - String - required
admin
date is_valid_timestamp "1980-06-18 12:00:01" "yyyy-MM-dd HH:mm:ss"
mentdb
1

date format <timestampToFormat> <formatIn> <formatOut>

Description

    format a timestamp to another format.

Parameters

    timestampToFormat:   The timestamp - String - required
    formatIn:   The in format (ex: yyyyMMdd HH:mm) - String - required
    formatOut:   The out format (ex: yyyy MM dd HH:mm:ss) - String - required
admin
date format "19800618 12:00" "yyyyMMdd HH:mm" "yyyy-MM-dd HH:mm:ss"
mentdb
1980-06-18 12:00:01

date minute <time>

Description

    get the minute of a time.

Parameters

    time:   The time - String - required
admin
date minute "12:15:56"
mentdb
15

date month <date>

Description

    get the month of a date.

Parameters

    date:   The date - String - required
admin
date month "1980-06-18"
mentdb
6

date monthname <date>

Description

    get the month name of a date.

Parameters

    date:   The date - String - required
admin
date monthname "1980-06-18"
mentdb
juin

date seconde <time>

Description

    get the seconde of a time.

Parameters

    time:   The time - String - required
admin
date seconde "12:15:56"
mentdb
56

date sysdate

Description

    returns the current date.

admin
date sysdate
mentdb
2015-09-13

date systime

Description

    returns the current time.

admin
date systime
mentdb
14:04:18

date systimestamp

Description

    returns the current timestamp.

admin
date systimestamp
mentdb
2015-09-13 14:04:32

date systimestamp_min

Description

    returns the current timestamp in minimum format.

admin
date systimestamp_min
mentdb
20150913140446

date time <timestamp>

Description

    get the time of a timestamp.

Parameters

    timestamp:   The timestamp - String - required
admin
date time "1980-06-18 12:25:56"
mentdb
12:25:56

date year <date>

Description

    get the year of a date.

Parameters

    date:   The date - String - required
admin
date year "1980-06-18"
mentdb
1980

math abs <number>

Description

    get the absolute value of a number

Parameters

    number:   A number - Number - required
admin
math abs -56
mentdb
56

math acos <number>

Description

    get the arc cosine of a number

Parameters

    number:   A number - Number - required
admin
math acos 42
mentdb
NaN

math asin <number>

Description

    get the arc sine of a number

Parameters

    number:   A number - Number - required
admin
math asin 0.5
mentdb
0.5235987755982989

math atan <number>

Description

    get the arc tangent of a number

Parameters

    number:   A number - Number - required
admin
math atan 42
mentdb
1.5469913006098266

math atan2 <number1> <number2>

Description

    get the angle theta from the conversion of rectangular coordinates (x, y) to polar coordinates (r, theta)

Parameters

    number1:   A number - Number - required
    number2:   A number - Number - required
admin
math atan2 4 2
mentdb
1.1071487177940904

math avg <json_array>

Description

    get the avg of a json array of vales

Parameters

    json_array:   A json array (of double values) - String - required
admin
math avg "[10 20]"
mentdb
15.0

math bit_and <number1> <number2>

Description

    the bitwise and operation

Parameters

    number1:   A number - Number - required
    number2:   A number - Number - required
admin
math bit_and 4456 234
mentdb
104

math bit_or <number1> <number2>

Description

    the bitwise or operation

Parameters

    number1:   A number - Number - required
    number2:   A number - Number - required
admin
math bit_or 4456 234
mentdb
4586

math bit_xor <number1> <number2>

Description

    the bitwise xor operation

Parameters

    number1:   A number - Number - required
    number2:   A number - Number - required
admin
math bit_xor 4456 234
mentdb
4482

math cbrt <number>

Description

    returns the cube root of a double value

Parameters

    number:   A number - Number - required
admin
math cbrt 42
mentdb
3.4760266448864496

math ceil <number>

Description

    get the smallest integer value not less than the number specified as an argument

Parameters

    number:   A number - Number - required
admin
math ceil 1.2
mentdb
2

math ceiling <number>

Description

    get the smallest integer value not less than the number specified as an argument

Parameters

    number:   A number - Number - required
admin
math ceiling 1.2
mentdb
2

math cos <number>

Description

    get the cosine of a number

Parameters

    number:   A number - Number - required
admin
math cos 42
mentdb
-0.39998531498835127

math cosh <number>

Description

    get the hyperbolic cosine of a number

Parameters

    number:   A number - Number - required
admin
math cosh 42
mentdb
8.696374707602505E17

math cot <number>

Description

    get the cotangent of a number

Parameters

    number:   A number - Number - required
admin
math cot 42
mentdb
0.4364167060752729

math decimal_format <number> <pattern> <decimalSeparator> <groupingSeparator>

Description

    convert a number to another formated decimal number

Parameters

    number:   A number - Number - required
    pattern:   The pattern - String - required
    decimalSeparator:   The decimal separator - String - required
    groupingSeparator:   The grouping separator - String - required
admin
math decimal_format 42.456 "##.##" "." " "
mentdb
42.46

math deg_to_rad <number>

Description

    converts an angle measured in degrees to an approximately equivalent angle measured in radians

Parameters

    number:   A number - Number - required
admin
math deg_to_rad 42
mentdb
0.7330382858376184

math e

Description

    get e value

admin
math e
mentdb
2.718281828459045

math exp <number>

Description

    returns euler's number e raised to the power of a double value

Parameters

    number:   A number - Number - required
admin
math exp 42
mentdb
1.73927494152050099E18

math expm1 <number>

Description

    returns e^x -1

Parameters

    number:   A number - Number - required
admin
math expm1 42
mentdb
1.73927494152050099E18

math floor <number>

Description

    get the largest integer value not greater than a number specified as argument

Parameters

    number:   A number - Number - required
admin
math floor 1.2
mentdb
1

math hypot <number1> <number2>

Description

    returns sqrt(x^2 +y^2) without intermediate overflow or underflow

Parameters

    number1:   A number - Number - required
    number2:   A number - Number - required
admin
math hypot 4456 234
mentdb
4462.139845410496

math log <number>

Description

    get the natural logarithm of the argument

Parameters

    number:   A number - Number - required
admin
math log 42
mentdb
3.7376696182833684

math log10 <number>

Description

    get the base 10 logarithm of the argument

Parameters

    number:   A number - Number - required
admin
math log10 42
mentdb
1.6232492903979006

math log1p <number>

Description

    returns the natural logarithm of the sum of the argument and 1

Parameters

    number:   A number - Number - required
admin
math log1p 42
mentdb
3.7612001156935624

math max <number1> <number2>

Description

    returns the greater

Parameters

    number1:   A number - Number - required
    number2:   A number - Number - required
admin
math max 4456 234
mentdb
4456

math min <number1> <number2>

Description

    returns the smaller of two int values

Parameters

    number1:   A number - Number - required
    number2:   A number - Number - required
admin
math min 4456 234
mentdb
234

math mod <number1> <number2>

Description

    the modulo operation

Parameters

    number1:   A number - Number - required
    number2:   A number - Number - required
admin
math mod 4456 234
mentdb
10

math pi

Description

    get pi value

admin
math pi
mentdb
3.141592653589793

math pow <number1> <number2>

Description

    get the value of a number raised to the power of another number

Parameters

    number1:   A number - Number - required
    number2:   A number - Number - required
admin
math pow 0.5 7
mentdb
0.0078125

math power <number1> <number2>

Description

    get the value of a number raised to the power of another number

Parameters

    number1:   A number - Number - required
    number2:   A number - Number - required
admin
math power 0.5 7
mentdb
0.0078125

math rad_to_deg <number>

Description

    converts an angle measured in radians to an approximately equivalent angle measured in degrees

Parameters

    number:   A number - Number - required
admin
math rad_to_deg 42
mentdb
2406.4227395494577

math random <number>

Description

    get the random number between 0 and the argument

Parameters

    number:   A number - Number - required
admin
math random 42
mentdb
1

math rint <number>

Description

    returns the double value that is closest in value to the argument and is equal to a mathematical integer

Parameters

    number:   A number - Number - required
admin
math rint 42
mentdb
42

math round <number1> <number2>

Description

    rounds a number specified as an argument up to a number specified as another argument

Parameters

    number1:   A number - Number - required
    number2:   A number - Number - required
admin
math round 1.23654 2
mentdb
1.24

math sign <number>

Description

    get the sign of a number

Parameters

    number:   A number - Number - required
admin
math sign 42
mentdb
1

math signum <number>

Description

    get the sign of a number

Parameters

    number:   A number - Number - required
admin
math signum 42
mentdb
1

math sin <number>

Description

    get the sine of a number

Parameters

    number:   A number - Number - required
admin
math sin 42
mentdb
-0.9165215479156338

math sinh <number>

Description

    get the hyperbolic sine of a number

Parameters

    number:   A number - Number - required
admin
math sinh 42
mentdb
8.696374707602505E17

math sqrt <number>

Description

    get the square root of a non-negative number of the argument

Parameters

    number:   A number - Number - required
admin
math sqrt 42
mentdb
6.48074069840786

math tan <number>

Description

    get the tangent of a number

Parameters

    number:   A number - Number - required
admin
math tan 42
mentdb
2.2913879924374863

math tanh <number>

Description

    get the hyperbolic tangent of a number

Parameters

    number:   A number - Number - required
admin
math tanh 42
mentdb
1

math ulp <number>

Description

    returns the size of an ulp of the argument. an ulp of a double value is the positive distance between this floating-point value and the double value next larger in magnitude

Parameters

    number:   A number - Number - required
admin
math ulp 42
mentdb
7.105427357601002E-15

string ascii <chr>

Description

    convert a character to integer

Parameters

    chr:   The string - String - required
admin
string ascii "a"
mentdb
97

string bin <num>

Description

    returns a string representation of the binary value of n, where n is a long (bigint) number

Parameters

    num:   The number - Number - required
admin
string bin 97
mentdb
1100001

string bit_length <str>

Description

    returns the length of the string str in bits

Parameters

    str:   The string - String - required
admin
string bit_length 61
mentdb
16

string char <num>

Description

    convert an integer to character

Parameters

    num:   The number - Number - required
admin
string char 97
mentdb
a

string char_length <str>

Description

    returns the length of the string. the length is equal to the number of unicode code units in the string.

Parameters

    str:   The string - String - required
admin
string char_length "azerty"
mentdb
6

string char_to_int <chr>

Description

    convert a character to integer

Parameters

    chr:   The string - String - required
admin
string char_to_int "a"
mentdb
97

concat <str1> <strN>

Description

    concat all parameters (do not use this function with string. before)

Parameters

    str1:   The string - String - required
    strN:   The string - String - required
admin
concat 97 "a" "r"
mentdb
97ar

string levenshtein_distance <word1> <word2>

Description

    To get the levenshtein distance between two words

Parameters

    word1:   The word 1 - String - required
    word2:   The word 2 - String - required
admin
string levenshtein_distance "admn" "admin"
mentdb
2

string count <string> <find>

Description

    count the occurrence number of a string in another string

Parameters

    string:   The string - String - required
    find:   The string - String - required
admin
string count "azertyaze" "a"
mentdb
2

string encode_b64 <string>

Description

    encode a string into b64

Parameters

    string:   The string - String - required
admin
string encode_b64 "azerty"
mentdb
YXplcnR5

string decode_b64 <string>

Description

    decode a string from b64

Parameters

    string:   The string - String - required
admin
string decode_b64 "YXplcnR5"
mentdb
azerty

string del_char_before_each_line <data> <nbChar>

Description

    delete a number of char on each lines

Parameters

    data:   The data - String - required
    nbChar:   The number of chars - Number - required
admin
string del_char_before_each_line "sdlfkjdf
dfgdfgdfgdfgd" 4
mentdb
kjdf
fgdfgdfgd

string ends_with <stringValue> <stringToEnd>

Description

    check if a value ends with another string

Parameters

    stringValue:   The string - String - required
    stringToEnd:   The end string - String - required
admin
string ends_with "azertyaze" 3
mentdb
0

string first_letter_upper <str>

Description

    returns the string in lower case. the first letter in upper case.

Parameters

    str:   The string - String - required
admin
string first_letter_upper "azerty"
mentdb
Azerty

string first_letter <str>

Description

    returns the first letter from a string.

Parameters

    str:   The string - String - required
admin
string first_letter "azerty"
mentdb
a

string generate_random_str <size>

Description

    generate a random string

Parameters

    size:   The size of the string - String - required
admin
string generate_random_str 1
mentdb
D

string hex <num>

Description

    returns a string representation of the hexadecimal value of n, where n is a long (bigint) number

Parameters

    num:   The number - Number - required
admin
string hex 97
mentdb
61

string hex_to_int <hex>

Description

    convert a hexadecimal number to (bigint) number

Parameters

    hex:   The hex number - String - required
admin
string hex_to_int 97
mentdb
151

string hex_to_str <hex>

Description

    get a string from a hexadecimal representation (ascii).

Parameters

    hex:   The hexadecimal number - String - required
admin
string hex_to_str 61
mentdb
a

string indent <str> <nbSpaceBefore>

Description

    returns the indented string

Parameters

    str:   The string - String - required
    nbSpaceBefore:   The string - String - required
admin
string indent "azerty
a
b
c" 3
mentdb
azerty
a
b
c

string instr <str1> <str2>

Description

    returns the index within this string of the first occurrence of the specified substring

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
admin
string instr "azerty" "r"
mentdb
3

string instr <str1> <str2> <fromIndex>

Description

    returns the index within this string of the first occurrence of the specified substring, starting at the specified index

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
    fromIndex:   starting to index - Number - required
admin
string instr "azerty" "r" 4
mentdb
-1

string int_to_char <num>

Description

    convert an integer to character

Parameters

    num:   The number - Number - required
admin
string int_to_char 97
mentdb
a

string int_to_hex <num>

Description

    returns a string representation of the hexadecimal value of n, where n is a long (bigint) number

Parameters

    num:   The number - Number - required
admin
string int_to_hex 97
mentdb
61

string int_to_oct <num>

Description

    returns a string representation of the octal value of n, where n is a long (bigint) number

Parameters

    num:   The number - Number - required
admin
string int_to_oct 97
mentdb
141

string is_letter <value>

Description

    check if a value contains only letters

Parameters

    value:   The value - String - required
admin
string is_letter "abcd"
mentdb
1

string is_alpha_num_uds <value>

Description

    check if a value contains only letters, underscore char or numbers

Parameters

    value:   The value - String - required
admin
string is_alpha_num_uds "abc_12d"
mentdb
1

string is_alpha_num <value>

Description

    check if a value contains only letters or numbers

Parameters

    value:   The value - String - required
admin
string is_alpha_num "abc12d"
mentdb
1

string is_number_char <value>

Description

    check if a value contains only number char

Parameters

    value:   The value - String - required
admin
string is_number_char "-456.45"
mentdb
0

string itrim <str>

Description

    returns the string with one space character between other chars

Parameters

    str:   The string - String - required
admin
string itrim "aze rty"
mentdb
aze rty

string lcase <str>

Description

    converts all of the characters in this string to lower case using the rules of the default locale

Parameters

    str:   The string - String - required
admin
string lcase "AZERTY"
mentdb
azerty

string left <str> <len>

Description

    get the leftmost len characters from the string str.

Parameters

    str:   The string - String - required
    len:   The length - Number - required
admin
string left "AZERTY" 3
mentdb
AZE

string length <str>

Description

    returns the length of this string. the length is equal to the number of unicode code units in the string.

Parameters

    str:   The string - String - required
admin
string length "azerty"
mentdb
6

string like <str> <pat>

Description

    performs a pattern match of a string expression expr against a pattern pat

Parameters

    str:   the string - String - required
    pat:   the paterne - String - required
admin
string like "azerty" ".*ze.*"
mentdb
1

string locate <str1> <str2>

Description

    returns the index within this string of the first occurrence of the specified substring

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
admin
string locate "azerty" "r"
mentdb
3

string locate <str1> <str2> <fromIndex>

Description

    returns the index within this string of the first occurrence of the specified substring, starting at the specified index

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
    fromIndex:   starting to index - Number - required
admin
string locate "azerty" "r" 4
mentdb
-1

string lower <str>

Description

    converts all of the characters in this string to lower case using the rules of the default locale

Parameters

    str:   The string - String - required
admin
string lower "AZERTY"
mentdb
azerty

string lpad <str> <padString> <paddedLength>

Description

    pads the left-side of a string with a specific set of characters

Parameters

    str:   The string - String - required
    padString:   The pad string - String - required
    paddedLength:   The end of the sub string - Number - required
admin
string lpad "azertyaze" "#" 10
mentdb
#azertyaze

string lrtrim <str>

Description

    returns the string without space character on the left and on the right

Parameters

    str:   The string - String - required
admin
string lrtrim " azerty "
mentdb
azerty

string lrtrim0 <str>

Description

    returns the string without 0 character on the left and on the right

Parameters

    str:   The string - String - required
admin
string lrtrim0 " 123 "
mentdb
123

string ltrim <str>

Description

    returns the string without space character on the left

Parameters

    str:   The string - String - required
admin
string ltrim " azerty "
mentdb
azerty   

string matches <str> <pat>

Description

    performs a pattern match of a string expression expr against a pattern pat

Parameters

    str:   the string - String - required
    pat:   the paterne - String - required
admin
string matches "azerty" ".*ze.*"
mentdb
1

string mid <str> <index>

Description

    returns a new string that is a substring of this string. the substring begins with the character at the specified index and extends to the end of this string.

Parameters

    str:   The string - String - required
    index:   The begin of the sub string - Number - required
admin
string mid "azertyaze" 3
mentdb
rtyaze

string mid <str> <beginIndex> <endIndex>

Description

    returns a new string that is a substring of this string. the substring begins at the specified beginindex and extends to the character at index endindex - 1. thus the length of the substring is endindex-beginindex

Parameters

    str:   The string - String - required
    beginIndex:   The begin of the sub string - Number - required
    endIndex:   The end of the sub string - Number - required
admin
string mid "azertyaze" 3 5
mentdb
rt

string not_like <str> <pat>

Description

    not performs a pattern match of a string expression expr against a pattern pat

Parameters

    str:   the string - String - required
    pat:   the paterne - String - required
admin
string not_like "azerty" ".*ze.*"
mentdb
0

string not_regexp <str> <pat>

Description

    not performs a pattern match of a string expression expr against a pattern pat

Parameters

    str:   the string - String - required
    pat:   the paterne - String - required
admin
string not_regexp "azerty" ".*ze.*"
mentdb
0

string oct <num>

Description

    returns a string representation of the octal value of n, where n is a long (bigint) number

Parameters

    num:   The number - Number - required
admin
string oct 97
mentdb
141

string oct_to_int <oct>

Description

    convert a octal number to (bigint) number

Parameters

    oct:   The octal number - String - required
admin
string oct_to_int "15"
mentdb
13

string position <str1> <str2>

Description

    returns the index within this string of the first occurrence of the specified substring

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
admin
string position "azerty" "r"
mentdb
3

string position <str1> <str2> <fromIndex>

Description

    returns the index within this string of the first occurrence of the specified substring, starting at the specified index

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
    fromIndex:   starting to index - Number - required
admin
string position "azerty" "r" 4
mentdb
-1

string regexp <str> <pat>

Description

    performs a pattern match of a string expression expr against a pattern pat

Parameters

    str:   the string - String - required
    pat:   the paterne - String - required
admin
string regexp "azerty" ".*ze.*"
mentdb
1

string repeat <str> <count>

Description

    returns a string consisting of the string str repeated count times

Parameters

    str:   The string - String - required
    count:   The count number - Number - required
admin
string repeat "AZERTY" 3
mentdb
AZERTYAZERTYAZERTY

string repeat_insert_str <str> <strToInsert> <incr>

Description

    returns a string with a string inserted all n char

Parameters

    str:   The string - String - required
    strToInsert:   The string to insert - String - required
    incr:   The increment - Number - required
admin
string repeat_insert_str "azertyuiop" "-" 3
mentdb
aze-rty-uio-p-

string replace <str> <target> <replacement>

Description

    replaces each substring of this string that matches the literal target sequence with the specified literal replacement sequence

Parameters

    str:   The string - String - required
    target:   The string target - String - required
    replacement:   The replacement - String - required
admin
string replace "azerty" "z" 9
mentdb
a9erty

string reverse <str>

Description

    returns the string str with the order of the characters reversed.

Parameters

    str:   The string - String - required
admin
string reverse "AZERTY"
mentdb
YTREZA

string right <str> <len>

Description

    get the rightmost len characters from the string str.

Parameters

    str:   The string - String - required
    len:   The length - Number - required
admin
string right "AZERTY" 3
mentdb
RTY

string rpad <str> <padString> <paddedLength>

Description

    pads the right-side of a string with a specific set of characters

Parameters

    str:   The string - String - required
    padString:   The pad string - String - required
    paddedLength:   The end of the sub string - Number - required
admin
string rpad "azertyaze" "#" 10
mentdb
azertyaze#

string rtrim <str>

Description

    returns the string without space character on the right

Parameters

    str:   The string - String - required
admin
string rtrim " azerty "
mentdb
  azerty

string space <count>

Description

    returns a string consisting of n space characters

Parameters

    count:   The number of space - String - required
admin
string space "5"
mentdb
     

string split <str> <regex> <limit>

Description

    Split a string

Parameters

    str:   The string - String - required
    regex:   The regex - String - required
    limit:   The limit - Number - required
admin
string split "a b c" " " -1
mentdb
["a","b","c"]

string starts_with <stringValue> <stringToStart>

Description

    check if a value starts with another string

Parameters

    stringValue:   The string - String - required
    stringToStart:   The start string - String - required
admin
string starts_with "azertyaze" 3
mentdb
0

string str_to_hex <str>

Description

    get a hexadecimal string representation of str where each character in str is converted to two hexadecimal digits.

Parameters

    str:   The string - String - required
admin
string str_to_hex 97
mentdb
3937

string strcmp <str1> <str2>

Description

    compare two string

Parameters

    str1:   The string 1 - String - required
    str2:   The string 2 - String - required
admin
string strcmp "AZERTY" "iop"
mentdb
-40

string strpos <str1> <str2>

Description

    returns the index within this string of the first occurrence of the specified substring

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
admin
string strpos "azerty" "r"
mentdb
3

string strpos <str1> <str2> <fromIndex>

Description

    returns the index within this string of the first occurrence of the specified substring, starting at the specified index

Parameters

    str1:   The string - String - required
    str2:   The string - String - required
    fromIndex:   starting to index - Number - required
admin
string strpos "azerty" "r" 4
mentdb
-1

string sublrchar <str> <numberDeleteChar>

Description

    delete a number of char at the start and at the end of the string

Parameters

    str:   The string - String - required
    numberDeleteChar:   The number of char to delete - Number - required
admin
string sublrchar "azerty" 1
mentdb
zert

string substr <str> <index>

Description

    returns a new string that is a substring of this string. the substring begins with the character at the specified index and extends to the end of this string.

Parameters

    str:   The string - String - required
    index:   The begin of the sub string - Number - required
admin
string substr "azertyaze" 3
mentdb
rtyaze

string substr <str> <beginIndex> <endIndex>

Description

    returns a new string that is a substring of this string. the substring begins at the specified beginindex and extends to the character at index endindex - 1. thus the length of the substring is endindex-beginindex

Parameters

    str:   The string - String - required
    beginIndex:   The begin of the sub string - Number - required
    endIndex:   The end of the sub string - Number - required
admin
string substr "azertyaze" 3 5
mentdb
rt

string substring <str> <index>

Description

    returns a new string that is a substring of this string. the substring begins with the character at the specified index and extends to the end of this string.

Parameters

    str:   The string - String - required
    index:   The begin of the sub string - Number - required
admin
string substring "azertyaze" 3
mentdb
rtyaze

string substring <str> <beginIndex> <endIndex>

Description

    returns a new string that is a substring of this string. the substring begins at the specified beginindex and extends to the character at index endindex - 1. thus the length of the substring is endindex-beginindex

Parameters

    str:   The string - String - required
    beginIndex:   The begin of the sub string - Number - required
    endIndex:   The end of the sub string - Number - required
admin
string substring "azertyaze" 3 5
mentdb
rt

string to_string <str>

Description

    return a valid sql string data (example: 'i'am a man')

Parameters

    str:   The string - String - required
admin
string to_string "az\"erty"
mentdb
'az"erty'

string encode <str> <sourceEnc> <destinationEnc>

Description

    encode a string to another encoding format

Parameters

    str:   The string - String - required
    sourceEnc:   The source encoding format - String - required
    destinationEnc:   The destination encoding format - String - required
admin
string encode "az\"erty" "ISO-8859-1" "UTF-8"
mentdb
az"erty

string empty_if_null <str>

Description

    set the string to empty if the string is null

Parameters

    str:   The string - String - required
admin
string empty_if_null "a b@mail.com"
mentdb
a b@mail.com

string null_if_empty <str>

Description

    set the string to null if the string is empty

Parameters

    str:   The string - String - required
admin
string null_if_empty "a b@mail.com"
mentdb
a b@mail.com

string trim <str>

Description

    returns the string without space character on the right, left and with one space inside

Parameters

    str:   The string - String - required
admin
string trim " aze rty "
mentdb
aze rty

string txt <data>

Description

    return a valid sql string data (example: 'i'am a man')

Parameters

    data:   The data - String - required
admin
string txt "az'erty"
mentdb
'az\'erty'

string txt2 <data>

Description

    return a valid sql string data (example: 'i''am a man')

Parameters

    data:   The data - String - required
admin
string txt2 "az'erty"
mentdb
'az''erty'

string ucase <str>

Description

    converts of all the characters in this string to upper case using the rules of the default locale

Parameters

    str:   The string - String - required
admin
string ucase "azerty"
mentdb
AZERTY

string unhex <hex>

Description

    convert a hexadecimal number to (bigint) number

Parameters

    hex:   The hex number - String - required
admin
string unhex 97
mentdb
151

string upper <str>

Description

    converts of all the characters in this string to upper case using the rules of the default locale

Parameters

    str:   The string - String - required
admin
string upper "azerty"
mentdb
AZERTY

string zero <str>

Description

    return a 0 if empty string else return the string

Parameters

    str:   The string - String - required
admin
string zero "az'erty"
mentdb
az'erty

type is_bool <value> <bool1> <bool2>

Description

    check if a value is equal than two booleans

Parameters

    value:   The value - String - required
    bool1:   The first boolean - String - required
    bool2:   The second boolean - String - required
admin
type is_bool 1 1 0
mentdb
1

type is_char <value> <size>

Description

    check if a value is char type (with size)

Parameters

    value:   The value - String - required
    size:   The char size authorized - Number - required
admin
type is_char 1 1
mentdb
1

type is_date <date>

Description

    check if a value is a valid date (example: 1980-06-18) in english format

Parameters

    date:   The date - String - required
admin
type is_date "1980-06-18"
mentdb
1

type is_decimal <stringDecimal> <digitBeforeTheDecimalPoint> <digitAfterTheDecimalPoint>

Description

    check if a value is a decimal number or not

Parameters

    stringDecimal:   The string in decimal format - String - required
    digitBeforeTheDecimalPoint:   The number of digit before the decimal point - Number - required
    digitAfterTheDecimalPoint:   The number of digit after the decimal point - Number - required
admin
type is_decimal 12.23 4 5
mentdb
1

type is_email <emailAddress>

Description

    check if a value is an email address

Parameters

    emailAddress:   The email - String - required
admin
type is_email "contact@data-prisme.com"
mentdb
1

type is_hour <stringHour>

Description

    check if a value is in hour format (example: 12:35:56)

Parameters

    stringHour:   The hour - String - required
admin
type is_hour "12:35:56"
mentdb
1

type is_time <stringHour>

Description

    check if a value is in hour format (example: 12:35:56)

Parameters

    stringHour:   The hour - String - required
admin
type is_time "12:35:56"
mentdb
1

type is_hour_without_sec <stringHour>

Description

    check if a value is in hour format (example: 12:35) without seconds

Parameters

    stringHour:   The hour - String - required
admin
type is_hour_without_sec "12:35:56"
mentdb
0

type is_integer <value> <size>

Description

    check if a value is an integer or not (with size)

Parameters

    value:   The value - String - required
    size:   The char size authorized - Number - required
admin
type is_integer 1456 5
mentdb
1

type is_number <value>

Description

    check if a value is a number

Parameters

    value:   The value - String - required
admin
type is_number 1456
mentdb
1

type is_byte <value>

Description

    check if a value is a byte

Parameters

    value:   The value - String - required
admin
type is_byte 13
mentdb
1

type is_small_int <value>

Description

    check if a value is a small integer

Parameters

    value:   The value - String - required
admin
type is_small_int 13000
mentdb
1

type is_medium_int <value>

Description

    check if a value is a medium integer

Parameters

    value:   The value - String - required
admin
type is_medium_int 130000
mentdb
1

type is_int <value>

Description

    check if a value is an integer

Parameters

    value:   The value - String - required
admin
type is_int 1300000
mentdb
1

type is_big_int <value>

Description

    check if a value is a big integer

Parameters

    value:   The value - String - required
admin
type is_big_int 1300000
mentdb
1

type is_float <value>

Description

    check if a value is a float number

Parameters

    value:   The value - String - required
admin
type is_float 1300000.4
mentdb
1

type is_double <value>

Description

    check if a value is a double number

Parameters

    value:   The value - String - required
admin
type is_double 1300000.4
mentdb
1

type is_timestamp <value>

Description

    check if a value is a timestamp format (example: '2009-06-18 12:00:00')

Parameters

    value:   The value - String - required
admin
type is_timestamp "2009-06-18 12:00:00"
mentdb
1

type is_valid_date <dateToValidate>

Description

    check if a date is valid.

Parameters

    dateToValidate:   The date - String - required
admin
type is_valid_date "1980-06-18"
mentdb
1

type is_valid_date <dateToValidate> <format>

Description

    check if a date is valid.

Parameters

    dateToValidate:   The date - String - required
    format:   The date format - String - required
admin
type is_valid_date "1980-06-18" "yyyy-MM-dd"
mentdb
1

type is_valid_time <timeToValidate>

Description

    check if a time is valid.

Parameters

    timeToValidate:   The time (12:00:01) - String - required
admin
type is_valid_time "12:00:01"
mentdb
1

type is_valid_timestamp <timestampToValidate>

Description

    check if a timestamp is valid.

Parameters

    timestampToValidate:   The timestamp - String - required
admin
type is_valid_timestamp "1980-06-18 12:00:01"
mentdb
1

type is_valid_timestamp <timestampToValidate> <format>

Description

    check if a timestamp is valid.

Parameters

    timestampToValidate:   The timestamp - String - required
    format:   The format (ex: yyyy MM dd HH:mm:ss) - String - required
admin
type is_valid_timestamp "1980-06-18 12:00:01" "yyyy-MM-dd HH:mm:ss"
mentdb
1

type is_varchar <value> <size>

Description

    check if a value is varchar type (with size)

Parameters

    value:   The value - String - required
    size:   The char size authorized - Number - required
admin
type is_varchar 1 1
mentdb
1

type data show

Description

    To show all data type

admin
type data show
mentdb
[
{
"condition": "word exist [TH1] fr;",
"relation_id": "4q"
},
{
"condition": "or (type is_bool [TH1] \"true\" \"false\";) (type is_bool [TH1] 1 0;);",
"relation_id": "4p"
},
{
"condition": "type is_number [TH1];",
"relation_id": "4o"
}
]

type data reload

Description

    To reload all data type

admin
type data reload
mentdb
Data type reloaded with successful




© 2012-2017 - Jimmitry Payet.