TSDBQuery.StringParam

redirigé depuis TSDBQuery.SetStringParam

TSDBQuery = class (TObject)Interface de TSDBQueryExemples de TSDBQuery

Définition d'un paramètre de type String

Syntaxe

property StringParam[name: String]: String write SetStringParam
name: nom du paramètre

Remarques

Les paramètres sont réinitialisés quand on écrit dans la propriété SQL.

Si on définit un paramètre qui n'existe pas dans la requête actuellement définie, il y a une exception.

Exemples

// Affichage des codes articles ERP de la famille 'MaFamille'
uses SDB;
var db:=TSDBQuery.CreateFromDataSource('ERP');
db.Name:='LectureArticlesERPForFamily';
db.SQL:='select CODE, NAME from ARTICLES where FAMILLE=:FAM';
db.StringParam['FAM']:='MaFamille';
db.Open;
while not db.Eof do begin
   PrintLn(db.StringField['CODE']);
   db.Next;
end;
db.Close;

Classification

SDB TSDBQuery