Genezzo::Havok::SQLScalar - scalar SQL functions
See perlfunc(1) for descriptions.
Return the string with the trailing newline removed.
Return the string with the last character removed.
Returns the character represented by the number in the character set.
Returns the plaintext string encrypted with the C crypt routine.
Returns the position (0-based) of the first character of the substring in the string, or -1 if not found, starting at start_position. Start_position defaults to zero if not specified.
Returns the lowercased char_str.
Returns char_str with only the first character lowercased.
Returns the number of characters in char_str.
Returns the numeric encoding of the first character of char_str.
Converts a list of values into a string using the perl pack function.
Returns the string in reverse order.
Like index, but backwards: finds the last occurrence of the substr in char_str.
Returns a string formatted using the C sprintf.
Note that the sprintf format string must be single-quoted (SQL-style), not double-quoted.
Returns the substring of char_str, starting at the offset, of the specified length. If length is omitted the it returns from the offset to the end of the string. Special rules for negative offset, length.
Returns the uppercased char_str.
Returns char_str with only the first character uppercased.
Arctangent (in radians)
Cosine (in radians).
Treats char_str as a hexadecimal value and converts to number.
Returns the integer portion of number.
Treats char_str as a octal value and converts to number.
Returns returns a random number N, where 0 <= N < number. Note that N is not an integer, so use an expression like int(rand(Max_N)) to obtain integer values where 0 <= N <= (Max_N - 1).
Sine (in radians)
Set the random seed.
The perl string join, renamed to avoid conflict with the SQL relational join. Concatenates the strings with the join_expr. Example: perl_join(':', 'foo', 'bar', 'baz') returns 'foo:bar:baz'.
Find the greatest element in a list
Return the string with the initial letter of each word capitalized, where words are defined as contiguous groups of alphanumeric chars separated by non-word chars.
Find the smallest element in a list
Return the string with all letters lowercase
Returns the string char_str1 padded out on the left to length n with copies of char_str2. If char_str2 is not specified blanks are used. If char_str1 is larger than length n it is truncated to fit.
Returns the string which is trimmed on the left up to the first character which is not in the specified set. If set is unspecified, blanks are trimmed.
Knuth's soundex from Text::Soundex.
Returns char_str with all occurrences of the search_str replaced by replace_str. If the replace_str is unspecified or null, it removes all occurrences of the search_str.
Returns the string char_str1 padded out on the right to length n with copies of char_str2. If char_str2 is not specified blanks are used. If char_str1 is larger than length n it is truncated to fit.
Returns the string which is trimmed on the right up to the first character which is not in the specified set. If set is unspecified, blanks are trimmed.
Similar to perl transliteration tr/ (see perlop(1) ), returns a string where all occurrences of a character in the search string are replaced with the corresponding character in the replace string.
Returns the string with all characters uppercase.
Returns the smallest integer greater than or equal to n
Returns the largest integers less than or equal to n
Log base 10.
Returns the Log base base_N on num.
Returns the remainder of m divided by n.
Return num rounded to m places to the right of the decimal point. M=0 if not specified. If m is negative num is rounded to the left of the decimal point.
Similar to "spaceship", returns -1 for N < 0, 0 for N==0, and 1 for N > 0.
Return num truncated to m places to the right of the decimal point. M=0 if not specified. If m is negative num is truncated to the left of the decimal point.
These functions return a value of a different type than their operands.
Return the ascii value of the first char of the string.
Returns the index (1 based, not zero based) of the substring in the char_str, starting at position. If occurrence and position are not specified they default to one: instr returns the index of the first occurrence of the substring. If occurrence is specified instr returns the index of the Nth occurrence. If position is negative instr begins the search from the tail end of char_str.
Returns char_str2 if char_str1 is NULL, else returns char_str1
"Quote URL" - Replace all non-alphanumeric chars in a string with '%hex' values, similar to the standard URL-style quoting.
"Quote URL" - Replace most non-alphanumeric chars in a string with '%hex' values, leaving spaces and most punctuation (with the exception of '%') untouched.
Convert a "quoted url" string back.
In Perl, "log" is a natural log, but the standard SQL log function is log base N. To prevent confusion in usage, Genezzo supplies a natural log function "ln", a base 10 function "log10", and a log of variable base called "logN".
The current implementation does not do any compile-time type checking of arguments for any functions.
Jeffrey I. Cohen, firstname.lastname@example.org
Copyright (c) 2005, 2006, 2007 Jeffrey I Cohen. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Address bug reports and comments to: email@example.com
For more information, please visit the Genezzo homepage at http://www.genezzo.com