File: README.trim

package info (click to toggle)
firebird3.0 3.0.13.ds7-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 42,632 kB
  • sloc: ansic: 374,403; cpp: 319,973; sql: 14,691; pascal: 14,532; yacc: 7,557; fortran: 5,645; sh: 5,336; makefile: 1,041; perl: 194; sed: 83; awk: 76; xml: 19; csh: 15
file content (38 lines) | stat: -rw-r--r-- 997 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
SQL Language Extension: TRIM

Function:
	Remove leading, trailing or both substring from a string.

Author:
	Adriano dos Santos Fernandes <adrianosf@uol.com.br>

Format:
	<trim function> ::=
		TRIM <left paren> [ [ <trim specification> ] [ <trim character> ] FROM ] <value expression> <right paren>

	<trim specification> ::=
		  LEADING
		| TRAILING
		| BOTH

	<trim character> ::=
		<value expression>

Syntax Rules:
	1) If <trim specification> is not specified, BOTH is assumed.
	2) If <trim character> is not specified, ' ' is assumed.
	3) If <trim specification> and/or <trim character> is specified, FROM should be specified.
	4) If <trim specification> and <trim character> is not specified, FROM should not be specified.

Examples:
A)
	select
		rdb$relation_name, trim(leading 'RDB$' from rdb$relation_name)
		from rdb$relations
		where rdb$relation_name starting with 'RDB$';

B)
	select
		trim(rdb$relation_name) || ' is a system table'
		from rdb$relations
		where rdb$system_flag = 1;