Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Do 23.01.03 12:18 
Hi,
weiß jemand, wie man bei einer existierenden Paradox-Tabelle nachträglich (zur Laufzeit) einen Primärindex erstellen kann? Manuell mit dem Datenbankeditor gehts nämlich...
Danke Euch,
Oliver

Moderiert von user profile iconTino: E-Mailadresse entfernt.
olliterski
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 105
Erhaltene Danke: 2

Win7 64-Bit
D7 Ent.
BeitragVerfasst: Do 23.01.03 15:10 
Hi,

wie wär´s mit dem Setzen des Indexproperties von TTable?

Gruß Oliver

_________________
Viele Grüße
Oliver
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Fr 24.01.03 09:18 
Welche Property? IndexFieldNames? IndexName?
olliterski
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 105
Erhaltene Danke: 2

Win7 64-Bit
D7 Ent.
BeitragVerfasst: Fr 24.01.03 09:42 
ausblenden Quelltext
1:
Table1.IndexName:='Indexspalte'					

'Indexspalte' steht hier als Synonym für deine Primärindexspalte.

MfG
Oliver

_________________
Viele Grüße
Oliver
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Fr 24.01.03 09:45 
Olliterski hat folgendes geschrieben:
Table1.IndexName:='Indexspalte'


wenn ich das so mache dann sagt der immer der Index ist nicht vorhanden muss ich da noch etwas davor setzten?? würde ich auch gerne wissen =)

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
olliterski
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 105
Erhaltene Danke: 2

Win7 64-Bit
D7 Ent.
BeitragVerfasst: Fr 24.01.03 10:00 
es gibt unter der ASA8 eine Syntax die wie folgt aussieht:
ausblenden Quelltext
1:
2:
3:
ALTER TABLE <Tablename> (
  ADD PRIMARY KEY ( <Column> )
)

Wenn ihr diesen wieder raushaben wollt geht das mit folgender Syntax:
ausblenden Quelltext
1:
2:
ALTER TABLE <Tablename>
  DELETE PRIMARY KEY

Man sollte jetzt meinen, naja ist halt Sybasesyntax - weit gefehlt! Auf der ASA8 wird vorwiegend mit Standard-SQL gearbeitet. Unterschiede gibt es nur bei den Funktionen.

Also das wäre soweit ich das sehe eure einzige Möglichkeit!

Erst primary Key setzen - mit SQL, dann TTable.Indexname... und wenn ihr ihn nicht mehr braucht, dann löscht ihr ihn einfach wieder mit SQL!

Gestern habe ich bei einem Freund noch eine andere Möglichkeit gesehen (Codefetzen).
ausblenden Quelltext
1:
...'Column'+' [ixPrimary] '+ ' [ixUnique] '					

Die genaue Vorgehensweise, damit kann ich euch aber erst ab 13:00 Uhr hier reinstellen!!!

Viele Grüße

Oliver

_________________
Viele Grüße
Oliver
foxy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 814

Ubuntu, Gentoo
C++, PHP, Java, Ruby, Perl (Eclipse)
BeitragVerfasst: Fr 24.01.03 10:12 
thx ich werde mal das so versuchen

_________________
"Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." (Linus Torvalds)
OperatingSystem Laptop (Ubuntu Hardy)
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Fr 24.01.03 10:40 
Einfach einen Indexnamen zuzuweisen, ohne daß der Index existiert endet in einer Excpetion...

Aber mit SQL solls wohl funktionieren...

DANKE EUCH
olliterski
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 105
Erhaltene Danke: 2

Win7 64-Bit
D7 Ent.
BeitragVerfasst: Fr 24.01.03 11:00 
wenn Du einen Index erstellst, ihn dann im TTable setzt und später wieder löscht (erst aus TTable und dann per SQL auf der Datenbank), dürfte es keine Exception geben!!!

Wenn Du ihn setzt, dann ist er doch bekannt!

Sollte das beim Compilieren Probs geben benutze einfach die Try-Anweisung!! Damit ist sichergestellt das er ihn erst zur Laufzeit sucht, wenn er nicht vorhanden ist dann soll eben nix passieren!

Viele Grüße

Oliver

_________________
Viele Grüße
Oliver