SQL Query Text 
Author Message
 SQL Query Text

Hi, Jimmy.

Try this:

procedure GetQueryString(aQuery :TQuery; aList :TStrings);
var
  FindPos   :LongInt;
  LenParam  :LongInt;
  LoopParam :LongInt;
  LoopLine  :LongInt;
  StrParam  :String;
  StrLine   :String;
  ValParam  :String;
begin
  aList.Clear;
  aList.Assign(aQuery.SQL);
  if (aQuery.Params.Count <> 0) then
     begin
       for LoopParam:= 0 to (aQuery.Params.Count- 1) do
         begin
           StrParam:= ':'+ aQuery.Params.Items[LoopParam].Name;
           ValParam:= aQuery.Params.Items[LoopParam].AsString;
           LenParam:= Length(StrParam);

           for LoopLine:= 0 to (aList.Count- 1) do
             begin
               StrLine:= aList.Strings[LoopLine];

               repeat
                 FindPos:= Pos(StrParam, StrLine);

                 if (FindPos <> 0) then
                   StrLine:= copy(StrLine, 1, (FindPos- 1))+ ValParam+
copy(StrLine, (FindPos+ LenParam), 255);

               until (FindPos = 0);
               aList.Strings[LoopLine]:= StrLine;
             end;
         end;
     end;
end;

Regards.
--
Petio Tonev

www.i.am/ptonev , www.w3.to/tonevsoft



Wed, 18 Jun 1902 08:00:00 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. Find SQL query text on Sybase 11 ?

2. Obtaining SQL Query Text via SPID

3. SQL Query problem concat text field from mulitple rows into one text field

4. Replacing text in query output (from a text-column)

5. Delay in Executing a Query in Query Analyzer with option Results in Text

6. SQL 7 Full Text Query Setup; Html Filtering

7. text field queries slower on SQL 7

8. SQL ASP Query support for 2 Languages using Full Text Search

9. Problems querying SQL 7.0 Linked Server using ODBC Text Driver

10. Full text or standard sql query?

11. SQL Query -> Multiple Text Files

12. Text Query Slower on SQL 7, Why?


 
Powered by phpBB® Forum Software