Autor Beitrag
DelphiMan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 73



BeitragVerfasst: Di 21.01.03 16:45 
Hallo zusammen!

Ich möchte gern mit SQL eine DB-Tabelle erstellen. Das Problem besteht nun darin, dass ein Feldname (Spaltenname) der Tabelle "xxx.yyy" heißen muss. Dabei kommt es stets zu Fehlermeldungen; hab auch schon vieles probiert, wie bspw. "xxx"."yyy" - "xxx.yyy" usw.

Bitte um schnelle Hilfe! Vielen Dank im Voraus!

MfG
DelphiMan
Luncustaf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Di 21.01.03 17:00 
Hi.


nimm anstatt einem . einen _ da punkte in feldnamen nicht erlaubt sind.


gr€€tz
DelphiMan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 73



BeitragVerfasst: Di 21.01.03 17:04 
Titel: PUNKT MUSS SEIN!!!
Das das mit einem _ geht weiß ich auch. Der Feldname MUSS jedoch "xxx.yyy" heißen - und Spaltennamen in dieser Formatierung, sprich mit Punkt, sind erlaubt und funktionieren. Nur mit SQL kann man anscheinend keine "xxx.yyy" Spalten erstellen!?
MfG
DelphiMan
Luncustaf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324

Win 2k
D7 Ent.
BeitragVerfasst: Di 21.01.03 17:08 
hmm

ich weis aus dem kopf net genau wie man mit sql nen feldname erstellt

aber probs mal so

also das CREATE ...... bla ..... 'xxx'+.+'yyy';


gr€€tz
neojones
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1206
Erhaltene Danke: 1



BeitragVerfasst: Di 21.01.03 17:12 
Punkte sind NICHT erlaubt! Les mal den ANSI-92-Standard durch! Punkte sind das Trennzeichen zwischen Datenbank-, Tabellen- und Feldnamen. Jede konforme Datenbank wird da vollends aussteigen.

_________________
Ha! Es compiliert! Wir können ausliefern!
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Di 21.01.03 17:32 
Versuchs mal mit einfachen Anführungszeichen. Eigentlich müsste das doch gehen, nur wird das halt beim Aufrufen etwas umständlich.

Gruß
Alfons-G
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 307

Win XP Prof, Linux, Win 7
D5 Prof, D7 Architect, D2005 Architect, D2007 Architect
BeitragVerfasst: Di 21.01.03 17:33 
Zumindest bei Oracle kann man es machen - wenn man den Namen immer in Anführungszeichen setzt. Dann sind auch Umlaute, Groß- und Kleinschreibung, Leerzeichen usw. kein Problem.

Die BDE und Komponenten-Eigenschaften, welche von BDE-Komponenten geerbt sind, können mit solchen Namen jedoch nichts anfangen. So kann auf einen derartigen Namen z.B. in einer Filter-Eigenschaft nicht zugegriffen werden.
Bei Fremdkomponenten geht es zum Teil, wenn die Eigenschaft nicht von einer BDE-Komponente geerbt wurde.

:)

_________________
Alfons Grünewald
DelphiMan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 73



BeitragVerfasst: Di 21.01.03 18:37 
Titel: danke
Hi!
Ich habe es nun auf umwegen geschafft (so wie ich es eigentlich nicht machen wollte), nämlich mittels TTable. So kann ich problemlos ein Feld namens "xxx.yyy" erstellen.
MfG
DelphiMan
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Di 21.01.03 18:54 
Warum muß es denn unbedingt das Format "xxx.yyy" sein ? Denn ein mischen von TTable und TQuery ist nicht gerade das non plus ultra.