Autor Beitrag
Aton
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Mo 28.02.05 10:49 
Hallo Forum,

wie kann ich einen LineBreak in ein SQL-Befehl (für Firebird) packen?

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
INSERT INTO tabelle (
  stringfeld
)
VALUES (
  'Ein String mit ENTERZEICHEN. Zweite Zeile. ?!?'
);


Wie bekomme ich #13#10 in den SQL-String?

Vielen Dank,
MfG Jens.
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Mo 28.02.05 11:21 
Hallo,

wie wäre es damit?

ausblenden Quelltext
1:
2:
3:
4:
...
VALUES (  
  'Ein String mit ENTERZEICHEN.'+#13#10+'Zweite Zeile. ?!?'  
);

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
Aton Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Mo 28.02.05 11:41 
Hallo,

ausblenden Quelltext
1:
2:
3:
VALUES (  
  'Ein String mit ENTERZEICHEN.'+#13#10+'Zweite Zeile. ?!?'  
);


Firebird kann diese SQL-Anweisung nicht verstehen. "#" Unbekanntes Token ...
Noch jemand eine Idee?

Gruß Jens.
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mo 28.02.05 12:17 
Ideen hätt ich genug ;)
probier mal:
'Erste Zeile\nZweite Zeile'
Luca
Hält's aus hier
Beiträge: 13



BeitragVerfasst: Mo 28.02.05 21:59 
Schreib die Delphi function CHR in eine UDF-DLL für Firebird

Danach kanns du schreiben
ausblenden Quelltext
1:
VALUES ('STRING1' || CHR(13) || CHR(10) || 'STRING2');					


Wenn du nicht weist wie eine UDF-DLL geschrieben wird ein Beispiel findest du unter www.ibexpert.com/download/udf/
Aton Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Di 01.03.05 20:46 
Danke für den Tipp,

zwar etwas umständlich, aber zumindestens geht's so. :wink:

Gruß Jens.