README.trim 997 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. SQL Language Extension: TRIM
  2. Function:
  3. Remove leading, trailing or both substring from a string.
  4. Author:
  5. Adriano dos Santos Fernandes <[email protected]>
  6. Format:
  7. <trim function> ::=
  8. TRIM <left paren> [ [ <trim specification> ] [ <trim character> ] FROM ] <value expression> <right paren>
  9. <trim specification> ::=
  10. LEADING
  11. | TRAILING
  12. | BOTH
  13. <trim character> ::=
  14. <value expression>
  15. Syntax Rules:
  16. 1) If <trim specification> is not specified, BOTH is assumed.
  17. 2) If <trim character> is not specified, ' ' is assumed.
  18. 3) If <trim specification> and/or <trim character> is specified, FROM should be specified.
  19. 4) If <trim specification> and <trim character> is not specified, FROM should not be specified.
  20. Examples:
  21. A)
  22. select
  23. rdb$relation_name, trim(leading 'RDB$' from rdb$relation_name)
  24. from rdb$relations
  25. where rdb$relation_name starting with 'RDB$';
  26. B)
  27. select
  28. trim(rdb$relation_name) || ' is a system table'
  29. from rdb$relations
  30. where rdb$system_flag = 1;