AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

substring in firebird

Ein Thema von khh · begonnen am 16. Jul 2010 · letzter Beitrag vom 16. Jul 2010
Antwort Antwort
khh

Registriert seit: 18. Apr 2008
Ort: Südbaden
1.903 Beiträge
 
FreePascal / Lazarus
 
#1

substring in firebird

  Alt 16. Jul 2010, 07:15
Datenbank: firebird • Version: 2.1 • Zugriff über: zeos
hallo zusammen, in einem anderen tread habt ihr mir sehr geholfen als es darum ging einen substring in einer mysql-DB zu bearbeiten.

jatz versuche ich das Gleiche unter firebird, und das klappt nicht.
Ist das zu mysql-spezifisch?
Zitat:
UPDATE artikel
SET bezeichnung2 = SUBSTRING(bezeichnung1,-(LOCATE('/',REVERSE(bezeichnung1)) - 1))
Danke gruss KHH
Karl-Heinz
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.115 Beiträge
 
Delphi 12 Athens
 
#2

AW: substring in firebird

  Alt 16. Jul 2010, 07:23
das SubStr scheint 'ne andere Syntax zu haben und man kann anscheinend nicht die Position von hinten (negativer Y-Wert) angeben.
http://wiki.firebirdsql.org/wiki/ind...page=SUBSTRING

LOCATE, sowie REVERSE kennt FB anscheinend nicht ... diese Funktionen werden dort wohl einen anderen Namen besitzen.
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests

Geändert von himitsu (16. Jul 2010 um 07:29 Uhr)
  Mit Zitat antworten Zitat
khh

Registriert seit: 18. Apr 2008
Ort: Südbaden
1.903 Beiträge
 
FreePascal / Lazarus
 
#3

AW: substring in firebird

  Alt 16. Jul 2010, 07:28

LOCATE, sowie REVERSE kennt FB anscheinend nicht ... diese Funktionen werden dort wohl einen anderen Namen besitzen.
ja aber welchen ?
Karl-Heinz
  Mit Zitat antworten Zitat
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.115 Beiträge
 
Delphi 12 Athens
 
#4

AW: substring in firebird

  Alt 16. Jul 2010, 07:29
eventuell POSITION statt LOCATE
http://tracker.firebirdsql.org/browse/CORE-1511
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat
khh

Registriert seit: 18. Apr 2008
Ort: Südbaden
1.903 Beiträge
 
FreePascal / Lazarus
 
#5

AW: substring in firebird

  Alt 16. Jul 2010, 07:33
ok, ist nicht soooo dringend, werd ich bei Gelegenheit ausprobieren,

danke dir
Karl-Heinz
  Mit Zitat antworten Zitat
tsteinmaurer

Registriert seit: 8. Sep 2008
Ort: Linz, Österreich
530 Beiträge
 
#6

AW: substring in firebird

  Alt 16. Jul 2010, 07:55
Mit Firebird 2.1: SUBSTRING, REVERSE, POSITION. Siehe Firebird 2.1 Release Notes S.150ff

Thomas
  Mit Zitat antworten Zitat
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
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:57 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz