Autor Beitrag
TheOutlaw
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19


Delphi 6-7,2007
BeitragVerfasst: Di 22.08.06 14:06 
Hallo,

wie nutze ich unter Delphi7 mit Zeos 6.5.1 alpha CVS as of 13/10/2005 das UpdateSQL?

Wenn ich mich mit einer DB verbinde, dann eine INSERT SQL Anweisung in die Updatesql.InsertSQL.Add schreibe und danach ein sqlquery.ExecSQL passiert garnix... wenn ich nun statt ExecSQL das .ApplyUpdates gefolgt von .CommitUpdates nutze, gibt es die Fehlermeldung "Operation bei geschlossender Datenmenge nicht ausführbar"... benutze folgende Komponenten: TZConnection, TZQuery, TZUpdateSQL und 'ne Standard TDataSource...

Was mache ich falsch??? Hat jemand ein Besipiel für mich?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 22.08.06 14:45 
In sqlquery steht ja ein Select-Statement oder?

Das UpdateSQL brauchst du nur bei DBMS die keine Updateable Views haben oder es sich um einen zusammengesetzten Query handelt. Das Insert-Statement des UpdateSQL wird bei sqlquery.insert / sqlquery.Post oder sqlquery.Append / sqlquery.Post aufgerufen.

_________________
Markus Kinzler.
TheOutlaw Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19


Delphi 6-7,2007
BeitragVerfasst: Di 22.08.06 15:13 
Hab ich glaube ich nciht ganz so verstanden... also der Sinn bei mir ist, das ich mit einem Schlaf eine Liste von Insertbefehlen eintragen möchte. Wenn die dieses normal mache. z.B.
ausblenden Delphi-Quelltext
1:
2:
3:
Query.SQL.Add('INSERT INTO LOGS (ANummer, Zielnummer, Projekt, Haltedauer) VALUES (''123'',''1234'',''Test'',''60'');');
Query.SQL.Add('INSERT INTO LOGS (ANummer, Zielnummer, Projekt, Haltedauer) VALUES (''321'',''4321'',''Test2'',''30'');');
Query.ExecSQL;

müsste er ja eigentlich alles nacheinander ab arbeiten und eintragen... ich bekomme dann aber immer ne Syntaxfehlermeldung, obwohl die SQL Anweisungen richtig sind (hab mir vorher query.SQL.Text in einem Memo ausgegeben und in MySQL getestet)...

Vielleicht sollte ich auch nochmal erwähnen das ich versuche in eine MySQL5 Tabelle zu schreiben...

Moderiert von user profile iconmatze: Delphi-Tags hinzugefügt
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 22.08.06 15:19 
Dann ist aber TUpdateSQl die falsche Komponente. zum Ausführen eines ganzen Skriptes dient TZSQLProcessor

_________________
Markus Kinzler.
TheOutlaw Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19


Delphi 6-7,2007
BeitragVerfasst: Di 22.08.06 15:25 
:D Juhuuu..... Danke... das muss man ja erstmal wissen ;)... hab das vorher in Delphi6 mit ner älternen Zeos Komponente gemacht und da ging es nur über TZUpdateSQL... geht nun alles!