Registriert seit: 26. Sep 2003
14 Beiträge
|
Re: SQL Anweisung an Button senden
13. Okt 2003, 09:53
Hier auch noch eine kleine Hilfe.....
Dieser Code ist für Oracle ausgelegt und verwendet Parameter. Dies kann aber auch sonst eingesetzt werden
Delphi-Quellcode:
PUBLIC
PROCEDURE Select1(Text1_param,Text2_param,Text3_param,Text4_param,Text5_param,Text6_param,Text7_param,Text8_param,Text9_param:String);
.....
PROCEDURE TForm1.Select1(Text1_param,Text2_param,Text3_param,Text4_param,Text5_param,Text6_param,Text7_param,Text8_param,Text9_param:String);
BEGIN
Datamodule1.Query1.close;
Datamodule1.Query1.SQL.clear;
Datamodule1.Query1.SQL.add(Text1_param);
IF NOT (Text2_param = '') THEN Datamodule1.Query1.Params[0].AsString := Text2_param;
IF NOT (Text3_param = '') THEN Datamodule1.Query1.Params[1].AsString := Text3_param;
IF NOT (Text4_param = '') THEN Datamodule1.Query1.Params[2].AsString := Text4_param;
IF NOT (Text5_param = '') THEN Datamodule1.Query1.Params[3].AsString := Text5_param;
IF NOT (Text6_param = '') THEN Datamodule1.Query1.Params[4].AsString := Text6_param;
IF NOT (Text7_param = '') THEN Datamodule1.Query1.Params[5].AsString := Text7_param;
IF NOT (Text8_param = '') THEN Datamodule1.Query1.Params[6].AsString := Text8_param;
IF NOT (Text9_param = '') THEN Datamodule1.Query1.Params[7].AsString := Text9_param;
Datamodule1.Query1.Open;
END;
PROCEDURE TForm1.Button64Click(Sender: TObject);
BEGIN
Select1('select * FROM XXXXXX WHERE YYYY = :Variable',Variable,'','','','','','','');
END;
|
|
Zitat
|