Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: So 24.06.07 21:15 
Hi, Delpher,

ich habe ein Feld namens ISBN und ich möchte es in ISBN_10 umbenennen. Das scheint nicht so einfach zu sein.

Wie mache ich es richtig?

Danke für Hilfe,
Detlef
Blawen
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 616
Erhaltene Danke: 33

Win XP, Vista, 7
Delphi 5 Prof., BDS 2006 Prof. RAD Studio XE
BeitragVerfasst: So 24.06.07 21:20 
user profile iconD. Annies hat folgendes geschrieben:
Hi, Delpher,

ich habe ein Feld namens ISBN und ich möchte es in ISBN_10 umbenennen. Das scheint nicht so einfach zu sein.

Wie mache ich es richtig?

Danke für Hilfe,
Detlef
Welche DB?

_________________
Es kompilert, wir können ausliefern.
Und es kompiliert wieder - das Update ist fertig - bitte 100 Euro ;-)
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 24.06.07 21:20 
ausblenden SQL-Anweisung
1:
ALTER TABLE tabelle RENAME isbn isbn_10					


bzw. bei einigen DBs auch:
ausblenden SQL-Anweisung
1:
ALTER TABLE tabelle MODIFY isbn isbn_10 VARCHAR(20)					

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: So 24.06.07 21:29 
Hi, blawen und benny,

es ist eine DBASE-Tabelle (igitt, ja ich weiß ... )

ich habe auch persistente Felder in meiner Deklaration ...

Ich kann natürlich auch mit dem Feldnamen ISBN leben, aber es gibt ja ISBN_10 und
ISBN_13 als Klasssifizierung bei Buchgeschäften, wäre halt "schöner"

Gruß, Detlef
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Di 26.06.07 19:42 
Hi, Delpher,

leider bin ich allein noch nicht weitergekommen, muss ich die persistenten Felder löschen und neu wieder aufnehmen?

Danke for help,
Detlef
Blawen
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 616
Erhaltene Danke: 33

Win XP, Vista, 7
Delphi 5 Prof., BDS 2006 Prof. RAD Studio XE
BeitragVerfasst: Di 26.06.07 20:23 
Wieso nimmst Du nicht einfach die "Datenbankoberfläche" von Delphi?
(Ist zumindest bei den "älteren" Delphi Versionen dabei)

_________________
Es kompilert, wir können ausliefern.
Und es kompiliert wieder - das Update ist fertig - bitte 100 Euro ;-)
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 27.06.07 08:42 
In eine TTable die Felddefinitionen einzutragen ist keine gute Iee. Ansonsten wie gesagt die Datenbank-Oberfläche mit nutzen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Do 28.06.07 17:43 
Hi, Benny und Blawen,

also, wenn ich es richtig verstanden habe, lösche ich die persistenten Felder und benenne ganz "normal", z.B. mit der BDE das Feld um. Richtig?

Danke erstmal für eure Hilfestellung,
Detlef
raiguen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 374

WIN 2000prof, WIN XP prof
D7EP, MSSQL, ABSDB
BeitragVerfasst: Fr 29.06.07 09:10 
user profile iconD. Annies hat folgendes geschrieben:
... muss ich die persistenten Felder löschen und neu wieder aufnehmen?
...

Genau! NAchdem du in der Datenbankoberfläche (so heisst das komische Teil) das Feld ISBN in ISBN_10 umbenannt und die Änderung gespeichert hast, musst du bei allen Tabellen im FeldEditor das alte Feld ISBN löschen und dann das neue Feld ISBN_10 wieder eintragen.
Weiterhin musst du natürlich im Code überall da, wo du direkt auf das Feld ISBN zugreifst (alá FieldByName('ISBN') und dergleichen) enttsprechene Änderungen vornehmen. Sonst bekommst du nämlich eine schöne Fehlermeldung 'Feld nicht gefunden..' oder so ähnlich.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Sa 30.06.07 08:38 
danke, Rainer, nun sehe ich klar!

Gruß, Detlef