Autor Beitrag
raiha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 152



BeitragVerfasst: Mi 18.05.05 07:56 
Hi,

wie kann ich aus dem Programm heraus feststellen ob die Tabelle xyz schon in meiner DB vorhanden ist?

Danke Rainer
Amiga-Fan
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Mi 18.05.05 08:13 
indem du ein select drauf machst und er dann eine exception zurückliefert
aber es gibt bei Datenbanken auch Systemtabellen, wo alle von dir angelegten Tabellen gespeichert sind. Müsste je nach DB unterschiedlich sein.

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen
raiha Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 152



BeitragVerfasst: Mi 18.05.05 08:40 
Klingt vielversprechend. Wie heißt die Systemtabelle bei Firebird(Interbase)?

Danke Rainer
Amiga-Fan
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Mi 18.05.05 08:54 
gute Frage. Zu hause werde ich nachschauen... wenn mir nicht jemand zuvorkommt mit dem antworten.

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen
Amiga-Fan
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Mi 18.05.05 14:28 
probier mal das:

SELECT * FROM RDB$RELATIONS

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen
raiha Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 152



BeitragVerfasst: Mi 18.05.05 14:32 
da steht sie leider nicht drin
kachel81
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 63



BeitragVerfasst: Mi 18.05.05 14:44 
Doch die Tabellen und Views stehen da drin:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
  select
    tab.rdb$relation_name
  from
    rdb$relations tab
  where
    tab.rdb$system_flag = 0


Also zumindest bei Interbase :D
Amiga-Fan
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Sa 21.05.05 22:08 
der thread ist noch nicht als erledigt markiert... bei mir ist es so:

ausblenden Delphi-Quelltext
1:
select * from RDB$RELATIONS where (RDB$RELATION_NAME not like ''RDB$%'') and (RDB$VIEW_SOURCE IS NULL) order by RDB$RELATION_NAME					

_________________
- Leg dich nie mit einem Berufsprogrammierer an
- Wahre Profis akzeptieren keine einfachen Lösungen