Autor Beitrag
Josef-B
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 293

2003 Server, Win7, Win8
Delphi 2010 Pro, Firebird 2.5
BeitragVerfasst: So 07.01.07 19:16 
Habe mir mal ein view gebastelt und wollte es dann mit TIBQuery in Delphi darstellen.

Das geht aber nicht, weil er da wohl nur Tabellen verarbeiten kann. Hab ich da was übersehen?
Oder gibt es andere Kompos mit denen man Views z.B. in einem DB Grid darstellen kann?
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: Mo 08.01.07 09:27 
Warum geht das nicht? Wird eine Fehlermeldung ausgegeben?

Es sollte eigentlich funktionieren.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 08.01.07 10:04 
Auf Views kann man eigentlich wie auf Tabellen zugreifen.

_________________
Markus Kinzler.
Josef-B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 293

2003 Server, Win7, Win8
Delphi 2010 Pro, Firebird 2.5
BeitragVerfasst: Mo 08.01.07 10:16 
Wenn ich aber im TIBQUERY auf den Anweisungstext-Editor beim SQL-Text gehe sieht das View nicht, nur die Tabellen.

Wenn ich dann eingebe: 'Select * from myview' kommt eben die Fehlermeldung, Tabelle nicht gefunden.

Ich kann dann auch nicht die Felder einlesen. So ist es dann auch nicht ganz einfach das Grid oder DBedits anzulegen.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 08.01.07 10:31 
Und wenn du die Abfrage manuell setzt?

_________________
Markus Kinzler.
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: Mo 08.01.07 10:40 
Ich hab das gerade mal probiert, um sicherzugehen. Ich sehe mit D7 Pro sowohl in der Auswahlliste die View, als auch kann ich sie abfragen und die Daten werden korrekt in meinem Grid angezeigt.

Wie sieht denn das Create-Statement für Deine View aus? Und das für Deine Tabelle?
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 08.01.07 10:57 
Ist sichergestellt, dass das View tatsächlich existiert?
Falls ja, hast Du dann auch die Rechte um das View zu sehen/benutzen?
Josef-B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 293

2003 Server, Win7, Win8
Delphi 2010 Pro, Firebird 2.5
BeitragVerfasst: Mo 08.01.07 16:51 
Habe das View in ibexpert erstellt, da bestätigt er mir das auch. In der Liste unter Views wird es auch angezeigt, allerdings habe ich jetzt gesehen, das ein select
unter
 select * from view_art_preise_1 nicht funzt, da kommt tatsächlich, dass
er die Tabelle nicht findet. Anscheinend ist es nicht in der Datenbank angekommen? Aber
warum sehe ich das dann in ibexpert?



ausblenden SQL-Anweisung
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
CREATE VIEW VIEW_ART_PREISE_1(
    ID_ART,
    ARTNR,
    ARTIKEL_NR,
    .
    .
    FAKT_EINHEIT_BEZ)

AS
select

    a.ID_ART,
    a.ARTNR,
    a.ARTIKEL_NR,
    .
    .
    .
    me.abkuerzung

    from
    artikel_handel a  left join preise_lager_handel p
    on (a.artikel_nr = p.artikel_nr) left join mengeneinheiten me
    on (a.fakt_einheit = me.id)
    where p.lager = 1;


Moderiert von user profile iconmatze: Code- durch SQL-Tags ersetzt
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 08.01.07 17:03 
Hast du committed ?

_________________
Markus Kinzler.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 08.01.07 17:05 
Sowas wird meines Wissens immer committed.
Ich vermute ein Rechte-Problem.
Josef-B Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 293

2003 Server, Win7, Win8
Delphi 2010 Pro, Firebird 2.5
BeitragVerfasst: Mo 08.01.07 22:18 
Bin als Sysdba eingeloggt.

Kann ich da noch irgendwelche Rechte setzen?

Auch über die Delphi_kompos ist die Datenbank Komponente über Sysdba drin.

Andere Nutzer habe ich auch nicht angelegt.