I would like to have a script like that:
drop table IF EXISTS `reserve_maj` ;
create table reserve_maj select reference , cc.depot , sum(qte_vendu-qte_valide) as reste from cde_cli cc , ligne_cc lc where (cc.prep_ok < 10 ) and (cc.depot=:depot) and (cc.record=lc.record) and (qte_vendu > qte_valide) group by reference ;
alter table `reserve_maj` add index `reference` ( `reference`, `depot` );
and i want to pass depot as parameter like that :
myscript.Params.ParamByName('depot').AsString:='AZERTY';
it don't work
Thanks
Parameter in Myscript
Re: Parameter in Myscript
TMyScript is not designed for work with parameters. However, if you need to use them, then the parameters should be placed before execution of each SQL statement. This must be done in the BeforeExecute event handler. For example:
Code: Select all
procedure TForm1.MyScriptBeforeExecute(Sender: TObject; var SQL: string; var Omit: Boolean);
begin
if Pos(':depot', SQL) > 0 then
MyScript.Params.CreateParam(ftString, 'depot', ptInput).AsString :='AZERTY';
end;