OnCustomParamSyntax


 

Applies to
TAstaClientSocket

TAstaSQLGenerator

 

Unit
AstaParamList

 

Declaration
type TSQLCustomParamsEvent = procedure(Sender: TObject;
  Item: TAstaParamItem;
var TheResult: string; var Handled: Boolean);

 

Description
OnCustomParamSyntax allows you to customize the way that parameters are formatted in the Select statement when using parameterized queries. Remember to set the Handled argument to True when coding this event.

 

procedure TForm1.AstaClientSocket1CustomParamSyntax(Sender: TObject;
  Item: TAstaParamItem;
var TheResult: string; var Handled: Boolean);

begin

  case Item.Datatype of

    ftDate: begin

              Handled := True;

              TheResult := QuotedStr(FormatDateTime('dd/mm/yyyy',
                Item.AsDateTime));

            end;

  end;

end;

 

See SQLGeneration for a full discussion of how ASTA generates SQL for insert, update and deletes.



ASTA Overview TAstaClientSocket.OnCustomConnect TAstaClientSocket.OnCustomSQLSyntax