Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
dev:sql:functions:trim [2010/07/08 21:02]
els
dev:sql:functions:trim [2010/07/09 03:31]
els
Line 4: Line 4:
 ===== Description ===== ===== Description =====
 The TRIM function removes any leading and/or trailing pad characters from a string. The pad character is a single character and defaults to a space character. The TRIM function removes any leading and/or trailing pad characters from a string. The pad character is a single character and defaults to a space character.
 +
 +This function returns a C STRING datatype.
  
 ===== Syntax ===== ===== Syntax =====
Line 24: Line 26:
  
 ===== Examples ===== ===== Examples =====
-==== Example 1 ==== +==== Example 1: Column ​==== 
-<​code ​SQL>+<​code>​
 > select trim(name) from individuals;​ > select trim(name) from individuals;​
  
Line 38: Line 40:
 KATHLEEN TUCKER KATHLEEN TUCKER
 </​code>​ </​code>​
-==== Example 2 ====+==== Example 2: Column with LEADING ​====
  
-<​code ​SQL>+<​code>​
 > select individual, trim(leading '​0'​ from individual) ind from individuals;​ > select individual, trim(leading '​0'​ from individual) ind from individuals;​
  
Line 53: Line 55:
 000900240828 ​ 900240828 000900240828 ​ 900240828
 </​code>​ </​code>​
-==== Example 3 ====+==== Example 3: Complex expression ​====
 The following complex example creates a string containing the name and an optional email. The following complex example creates a string containing the name and an optional email.
  
-<​code ​SQL>+<​code>​
 > Select ​       (((trim($proper(NAME)) || > Select ​       (((trim($proper(NAME)) ||
 >> ​              case >> ​              case
 
Back to top
dev/sql/functions/trim.txt · Last modified: 2016/06/28 22:38 (external edit)