Dear Everybody,
the following sql statement works with MySql-Control-Center on 4.1 server perfectly
[syntax="sql"]
set @Platz = 0;
SELECT @Platz:= (@Platz + 1) as Platz, RegV, RV, VR, Znr, Züchter, sum(Preise) as Preise, sum(Aspkt) AS Aspkt, sum(Km) AS KM FROM ms_championat_ergebnis
GROUP BY Züchter
ORDER BY Preise DESC, Aspkt DESC ...
[/syntax]
this Delphi7 Procedure doesn`t work
[syntax="DELPHI"]
procedure TForm5.championat_ie_dr();
var i : integer;
begin
with Z_Championat do
begin
close;
sql.Clear;
sql.Add('set @Platz = 0; '+
'SELECT @Platz:= (@Platz + 1) as Platz, RegV, RV, VR, Znr, Züchter, '+
'sum(Preise) as Preise, sum(Aspkt) AS Aspkt, sum(Km) AS KM '+
'FROM ms_championat_ergebnis '+
'GROUP BY Züchter '+
'ORDER BY Preise DESC, Aspkt DESC ');
open;
end;
end;
[/syntax]
The EDatabaseError event wrote:
Incorrect Token followed by ":"
I Think, the problem are the chars :=
Please excuse my bad Englisch
For your help many thanks in advance
.
Delphi7 - mysql 4.1 user variable
Moderators: gto, cipto_kh, EgonHugeist