This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
dev:sql:functions:rpad [2010/07/08 17:53] els |
dev:sql:functions:rpad [2010/07/09 03:38] els |
||
---|---|---|---|
Line 3: | Line 3: | ||
====== Omnidex SQL Function: $RPAD ====== | ====== Omnidex SQL Function: $RPAD ====== | ||
===== Description ===== | ===== Description ===== | ||
- | Right-justify the string. | + | Pad the string on the right with spaces or the named character. If the string is already padded, as happens with a CHARACTER datatype, the string must first be trimmed using the TRIM function. |
+ | |||
+ | This function returns a C STRING datatype. | ||
===== Syntax ===== | ===== Syntax ===== | ||
Line 23: | Line 26: | ||
==== Example: Column ==== | ==== Example: Column ==== | ||
- | //In this example, the name must first be trimmed since it is already padded with spaces.// | + | In this example, the name must first be trimmed since it is already padded with spaces. |
- | <code SQL> | + | <code> |
> select $rpad(trim(name), 40, '.') nme from individuals; | > select $rpad(trim(name), 40, '.') nme from individuals; | ||