this is the code fragment that I have
ZSPCostosCombustible.Params.ParamByName('AUX_DESDE').AsDate:=DateTimePicker1.Date;
ZSPCostosCombustible.Params.ParamByName('AUX_HASTA').AsDate:=DateTimePicker2.Date;
ZSPCostosCombustible.Params.ParamByName('ACTIVO_DESDE').AsString:=MaskEdit1.Text;
ZSPCostosCombustible.Params.ParamByName('ACTIVO_HASTA').AsString:=MaskEdit2.Text;
ZSPCostosCombustible.Open;
this is the exception
Error: El proyecto Gesagric 2018 ha lanzado una excepción de la clase 'External: SIGSEGV'.
En archivo '.\source\parsesql\ZGenericSqlAnalyser.pas' en linea 357:
if (Tokens[i].P^ = '(') and (Tokens[i].L = 1) then
It contains a Mysql stored procedure that is called: RPT_COSTOS_CONSUMOS_COMBUSTIBLE
and the sentence is:
BEGIN
if AUX_TIPO_RPT = 'Hist x Dates' then
select
ecc.date as Date,
dcc.idplaca as 'Id Active',
concat (ifnull (ati.marca, ''), '', ifnull (ati.modelo, ''), '', ifnull (ati.serie, '')) as Descripcion,
concat (dcc.idarticulo, '-', art.descripcion) as 'Articulo',
dcc.litros as Liters,
dcc.horim_kilom as 'Hr / Km'
from enc_consumo_combustible as ecc
inner join det_consumo_combustible as dcc
on ecc.idboleta = dcc.idboleta
inner join activosti as ati
on ati.idplaca = dcc.idplaca
inner join articles as art
on art.idarticulo = dcc.idarticulo
where ecc.date between AUX_DESDE and AUX_HASTA
order by dcc.idarticulo, ecc.fecha, dcc.idplaca;
else
if AUX_TIPO_RPT = 'Hist x Dates x Assets' then
select
ecc.date as Date,
dcc.idplaca as 'Id Active',
concat (ifnull (ati.marca, ''), '', ifnull (ati.modelo, ''), '', ifnull (ati.serie, '')) as Descripcion,
concat (dcc.idarticulo, '-', art.descripcion) as 'Articulo',
dcc.litros as Liters,
dcc.horim_kilom as 'Hr / Km'
from enc_consumo_combustible as ecc
inner join det_consumo_combustible as dcc
on ecc.idboleta = dcc.idboleta
inner join activosti as ati
on ati.idplaca = dcc.idplaca
inner join articles as art
on art.idarticulo = dcc.idarticulo
where ecc.date between AUX_DESDE and AUX_HASTA
and dcc.idplaca between ACTIVO_DEZDE and ACTIVO_HASTA
order by dcc.idplaca, ecc.date, dcc.horim_kilom;
end if;
end if;
END
the exception occurs in these lines of the ZGenericSqlAnalyser.pas
if not FoundSection and (TokenIndex < Tokens.Count) then begin
BracketCount := 0;
repeat
Elements.Add(Tokens[TokenIndex]^);
if (Tokens[i].P^ = '(') and (Tokens[i].L = 1) then
Inc(BracketCount)
else if (Tokens[i].P^ = ')') and (Tokens[i].L = 1) then
Dec(BracketCount);
Inc(TokenIndex);
until (BracketCount <= 0) or (TokenIndex >= Tokens.Count);
end;