We help IT Professionals succeed at work.

I can't filter the data I want

ali şahin
ali şahin asked
on
Medium Priority
110 Views
Last Modified: 2019-05-23
rocedure TForm1.Button2Click(Sender: TObject);
var
yazi : string;
begin
yazi:=Edit1.Text;
dmcd.OraQuery1.Close;
dmcd.OraQuery1.SQL.Clear;
//dmcd.OraQuery1.SQL.Add('SELECT * FROM KIMLIK WHERE dosya_no= '+Edit1.Text ) ;
//dmcd.OraQuery1.SQL.add('SELECT * FROM KIMLIK WHERE ADI Like "'+Edit1.Text+'%"');

//dmcd.Oraquery1.SQL.Text:='SELECT * FROM KIMLIK WHERE lower(adi)='+ yazi;
//dmcd.Oraquery1.SQL.Text:='SELECT * FROM KIMLIK WHERE dosya_no='+ yazi; this is work

dmcd.Oraquery1.SQL.Text:='select * from KIMLIK where (name)=' +yazi;//this is not work
dmcd.OraQuery1.Open;
dmcd.OraQuery1.Active;
end;
Top

Open in new window

Comment
Watch Question

Senior Consultant
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2013
Commented:
Try this

dmcd.Oraquery1.SQL.Text:='select * from KIMLIK where (name)=''' +yazi  + '''';

If that doesn't work try

dmcd.Oraquery1.SQL.Text:='select * from KIMLIK where (name)='  + chr(84) + yazi + chr(84);

mlmcc

Author

Commented:
thank you so much.It is work :)