~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/functions/string.rst

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
String Functions and Operators
2
 
===============================
3
 
 
4
 
**(See tables with each function listed with a brief description below.)**
5
 
 
6
 
.. toctree::
7
 
   :maxdepth: 2
8
 
 
9
 
   string/comparative
10
 
   string/conversion
11
 
   string/length 
12
 
   string/modification
13
 
   string/position
14
 
   string/other
15
 
 
16
 
 
17
 
List of string operators and descriptions by type of function:
18
 
 
19
 
 
20
 
Comparative and regular functions
21
 
---------------------------------
22
 
 
23
 
===================     ====================================================================================================
24
 
Operator                  Description
25
 
===================     ==================================================================================================== 
26
 
LIKE                      Matches a simple pattern
27
 
NOT LIKE                  Negation of simple pattern matching
28
 
STRCMP()                  Compare two strings
29
 
NOT REGEXP                Negation of REGEXP
30
 
REGEXP                    Returns values that match a regular expression pattern
31
 
RLIKE                     Synonym for REGEXP
32
 
===================     ====================================================================================================
33
 
 
34
 
 
35
 
Conversion and translation functions
36
 
------------------------------------
37
 
===================     ====================================================================================================
38
 
Operator                  Description
39
 
===================     ====================================================================================================
40
 
ASCII()                   Return numeric value of left-most character
41
 
BIN()                     Return a string representation of the argument
42
 
CHAR()                    Return the character for each integer passed
43
 
HEX()                     Return a hexadecimal representation of a decimal or string value
44
 
LOWER()                   Return the argument in lowercase
45
 
LCASE()                   Synonym for LOWER()
46
 
UCASE()                   Synonym for UPPER()
47
 
UNHEX()                   Convert each pair of hexadecimal digits to a character
48
 
UPPER()                   Convert to uppercase
49
 
===================     ====================================================================================================
50
 
 
51
 
 
52
 
Length and size functions
53
 
-------------------------
54
 
===================     ====================================================================================================
55
 
Operator                  Description
56
 
===================     ====================================================================================================
57
 
BIT_LENGTH()              Return length of argument in bits
58
 
CHAR_LENGTH()             Return number of characters in argument
59
 
LENGTH()                  Return the length of a string in bytes
60
 
OCTET_LENGTH()            A synonym for LENGTH()
61
 
===================     ====================================================================================================
62
 
 
63
 
 
64
 
Formatting and modification functions
65
 
-------------------------------------
66
 
===================     ====================================================================================================
67
 
Operator                  Description
68
 
===================     ====================================================================================================
69
 
CONCAT()                  Returns a concatenated string
70
 
TRIM()                    Remove leading and trailing spaces
71
 
LTRIM()                   Remove leading spaces
72
 
RTRIM()                   Remove trailing spaces
73
 
===================     ====================================================================================================
74
 
 
75
 
 
76
 
Position functions
77
 
-------------------
78
 
 
79
 
===================     ====================================================================================================
80
 
Operator                  Description
81
 
===================     ==================================================================================================== 
82
 
FIELD()                   Return the index (position) of the first argument in the sequent arguments
83
 
FIND_IN_SET()             Return the index position of the first argument within the second argument
84
 
INSTR()                   Return the index of the first occurrence of substring
85
 
LEFT()                    Return the leftmost number of characters as specified
86
 
INSERT()                  Insert a substring at the specified position up to the specified number of characters
87
 
LOCATE()                  Return the position of the first occurrence of substring
88
 
POSITION()                A synonym for LOCATE()
89
 
===================     ==================================================================================================== 
90
 
 
91
 
 
92
 
Other string functions
93
 
----------------------
94
 
 
95
 
===================     ====================================================================================================
96
 
Operator                  Description
97
 
===================     ==================================================================================================== 
98
 
ELT()                     Return string at index number
99
 
EXPORT_SET()              Return a string
100
 
FORMAT()                  Return a number formatted to specified number of decimal places
101
 
LOAD_FILE()               Load the named file
102
 
LPAD()                    Return the string argument, left-padded with the specified string
103
 
MAKE_SET()                Return a set of comma-separated strings that have the corresponding bit in bits set
104
 
MATCH                     Perform full-text search
105
 
MID()                     Return a substring starting from the specified position
106
 
ORD()                     Return character code for leftmost character of the argument
107
 
QUOTE()                   Escape the argument for use in an SQL statement
108
 
REPEAT()                  Repeat a string the specified number of times
109
 
REPLACE()                 Replace occurrences of a specified string
110
 
REVERSE()                 Reverse the characters in a string
111
 
RIGHT()                   Return the specified rightmost number of characters
112
 
RPAD()                    Append string the specified number of times
113
 
SOUNDEX()                 Return a soundex string
114
 
SUBSTR()                  Return the substring as specified
115
 
SUBSTRING_INDEX()         Return a substring from a string before the specified number of occurrences of the delimiter
116
 
SUBSTRING()               Return the substring as specified
117
 
===================     ====================================================================================================
118
 
 
 
2
==============================
 
3
 
 
4
==========     ===========================================
 
5
Operator         Description
 
6
==========     ===========================================
 
7
LIKE            Simple pattern matching
 
8
NOT LIKE        Negation of simple pattern matching
 
9
STRCMP()        Compare two strings
 
10
==========     ===========================================