How do I access the full sql+params in a TSQLQuery?
There are several (good) reasons for using TParams for a SQL query.
So why do you want the full SQL? And what do you mean by full SQL?
For example, you could use Params to insert BLOB, images, RTF, binary, Integers etc. Not all these things could just be inserted into one SQL string.
TSQLQuery.GetExpandedSQL sounds nice but isn't always possible.
If it's just for debugging you could do something like this;
S := IBQuery1.SQL.Text + #13;
for I := 0 to IBQuery1.Params.Count -1 do
S := S + #13 + Format('%s: %s', [IBQuery1.Params[I].Name, IBQuery1.Params[I].Text]);
ShowMessage(S);
It'll output your SQL followed by all the params (IF they can be converted to a string).
You can also expand this into some form of TSQLQuery.GetExpandedSQL yourself by replacing all ':'+IBQuery1.Params[I].Name with IBQuery1.Params[I].Text.
S := IBQuery1.SQL.Text;
for I := 0 to IBQuery1.Params.Count -1 do
S := StringReplace(S, ':' + IBQuery1.Params[I].Name, QuotedStr(IBQuery1.Params[I].Text), [rfReplaceAll, rfIgnoreCase]);
Note: I used QuotedStr here but for integer you shouldn't quote. So if you wanted to use this SQL in a sql manager it would need to be perfected somewhat.
This was just a very simple example.