Einzelnen Beitrag anzeigen

borwin

Registriert seit: 14. Sep 2006
Ort: Rostock
72 Beiträge
 
Delphi 2007 Enterprise
 
#7

AW: substring in firebird

  Alt 16. Jul 2010, 08:05
Die Buildin Funktionen sind auch im Verzeichnis von FB unter
doc\sql.extensions\README.builtin_functions.txt
beschrieben. Leider nicht Substring. Hier nachsehen was Thomas beschreibt.

Hier noch der Text aus der Release Nodes
Zitat:
(1.0) SUBSTRING( <string expr> FROM <pos> [FOR <length>])
Internal function, available in SQL and DSQL, implementing the ANSI SQL SUBSTRING() function. It will
return a stream consisting of the byte at <pos> and all subsequent bytes up to the end of the string. If the optional
FOR <length> is specified, it will return the lesser of <length> bytes or the number of bytes up to the end
of the input stream.
The first argument can be any expression, constant or identifier that evaluates to a string.
<pos> must evaluate to an integer. <pos> in the string starts at 1, like other SQL positional elements.
Neither <pos> nor <length> can be query parameters: they must evaluate to constants.
Because <pos> and <length> are byte positions, the identifier of the input string can be a binary blob, or a
sub_type 1 text blob with an underlying one-byte-per-character charset. The function currently does not handle
text blobs with Chinese (2 byte/char maximum) or Unicode (3 byte/char maximum) character sets.
For a string argument (as opposed to a blob), the function will tackle ANY charset.
Example
UPDATE ATABLE
SET COLUMNB = SUBSTRING(COLUMNB FROM 4 FOR 99)
WHERE ...
Gruß Borwin
  Mit Zitat antworten Zitat