Let's say you have an delphi interface that has a TEdit where an user types and SQL Query
SELECT * FROM X WHERE X.A = :A and X.B = :B and X.C= :C
Is there a way to get the types of the :A,:B,:C Params? I managed to get the name of the Params. using this code
procedure TfrmA.Button1Click(Sender: TObject);
var
queryInput, queryOutput , aux : string;
pozitie : Integer;
param : string;
Ch,Chx : Char;
begin
queryInput := TEdit.Text;
queryOutput := StringReplace(queryInput,':','@',[rfReplaceAll, rfIgnoreCase]);
aux := Copy(queryOutput,AnsiPos('@',queryOutput),200);
while Length(aux ) > 0 do begin
if AnsiPos('@',aux ) = 0 then break;
for Ch in aux do
begin
if Ch = ' ' then begin
param := param + ' ';
break
end else param := param + Ch;
end;
ShowMessage(param);
test := Copy(test,2,200);
test := Copy(test,AnsiPos('@',test),200);
end;
end;
Param string will containt now : @A @B @C
Is there anyway I can find out the datatype of the params?