in reply to Search a text and output to different text files

A sample of the text that you're attempting to match (preferably multiple occurances, so we can see how they're saved within the file, as there may be clues for seperators. etc.)

I mean, when I think 'bind variables', I think of having the parameters seperate from the SQL statement, but it's possible that you're using the term to suggest that there are values embedded in the SQL statement.

  • Comment on Re: Search a text and output to different text files

Replies are listed 'Best First'.
Re^2: Search a text and output to different text files
by Anonymous Monk on Jul 22, 2005 at 12:46 UTC
    Sample output is shown as code for only SELECT SQL but there would be many SQL's like SELECT, UPDATE, DELETE AND INSERT. Also is it possible to get only the unique SQL's. The output should contain only the SQL with Bind Variable. It should display the junk values as shown below.
    ***** SQL Statement ***** SELECT T0.ROW_ID C0, T0.MODIFICATION_NUM C1 FROM siebel.S_SEC_OBJECT T +0 WHERE ((T0.OBJ_TYPE_CD = ?) AND (T0.NAME = ?)) FETCH FIRST 1 ROWS O +NLY OPTIMIZE FOR 1 ROW ***** Bind Variables ***** Bind variable 0: User Bind variable 1: sadmin [7/14/05 23:19:56:108 MDT] 00000072 SystemOut O 2005-07-14 23:19:5 +6,108 TRACE_HIGH DBAxsSql sadmin 69f1985c-b880-4c52-af59- +e12add06c461.35 uuid:ba3bbb25-e0d9-55b0-7d71-5d60253944cc uuid: +d5f09b24-6116-4f9b-8825-d6d136c66098 ***** SQL Statement Execute T +ime: 0 ms *****

      Yes, it's possible, but it might be a little more work, as given the earlier requirements, you need to keep track of which sql statement is in which file.

      It's almost easier to just write the code, than to try to explain the logic in english.

        Thanks a ton dude. It most gave the exact output i required. Only minute changes are required.