🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.pascal
2 messages
2 total messages Started by Koriolan Sat, 31 Jul 2010 21:43
Lazarus i SQLQuery.
#89691
Author: Koriolan
Date: Sat, 31 Jul 2010 21:43
27 lines
767 bytes
Jak zmusi� SQLQuery do zmian ? Update, Insert itp.
Szuka�em po necie ale przyk�ady mi nie dzia��j�.
Nie chc� tu opisywa� co mi si� nie uda�o ale np.

==============
With SQLQuer ...

       UpdateSQL.Clear;  //Clear Update SQL Statement if Any
       UpdateSQL.Add('update pit_tmp_zm'); 
                   //
       UpdateSQL.Add('set kod_gl=''101010'' ');   //Create SQL
       UpdateSQL.Add('where pit_id= 10;'); 
            //
       ExecSQL;
       Edit; //Put Query in Edit(Update) Mode
       Post;
       ApplyUpdates; //Post and Apply Updates
       Close;
       SQLTrans1.CommitRetaining;
       ....

================

Nie dzia�a :-(
Generalnie czepia si�, �e nie ma SQL (jest Update) ExecSQL zamiast Open
te� nie chodzi :-(

Re: Lazarus i SQLQuery.
#89701
Author: Koriolan
Date: Mon, 16 Aug 2010 17:43
36 lines
927 bytes
Koriolan pisze:
> Jak zmusi� SQLQuery do zmian ? Update, Insert itp.
> Szuka�em po necie ale przyk�ady mi nie dzia��j�.
> Nie chc� tu opisywa� co mi si� nie uda�o ale np.
> ......[CIACH]
> Nie dzia�a :-(
> Generalnie czepia si�, �e nie ma SQL (jest Update) ExecSQL zamiast Open
> te� nie chodzi :-(

Poradzi�em sobie ..

Operowanie SQLQuery przy operacjach innych ni� 'SELECT' wychodzi mi tak :

--------------------------

procedure TModyfik1.ButtDoCennikaClick(Sender: TObject);
begin
   // Dodaj Lek do Cennika
   WITH DataModule1 DO BEGIN
     if SQLTransaction3.Active then SQLTransaction3.Commit;
     SQLQuery3.close;
     SQLQuery3.SQL.clear;
     SQLQuery3.SQL.Add('INSERT INTO pit_zm ( data_zm) VALUES (
''2010-01-01'');');
     SQLTransaction3.StartTransaction;
     SQLQuery3.ExecSQL;
     SQLTransaction3.Commit;
    END;
end;

---------------------------

Dzia�a :-)

Koriolan

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads