<$BlogRSDUrl$>

Monday, May 23, 2005

Searching SQL scripts on Windows XP 

If you are anything like me you generate a lot of sql scripts. Then when you come to reuse them you vaguely remember that you had a script that did this but can't remember what it was called or where it was located. In my case I wanted to find the wrapper for DBMS_METADATA to generate schema ddl that I wrote earlier last year. One of the enhancements that Windows XP Search brings is that it no longer seems to be able to find anything! This is due to a change in behaviour from previous versions of windows that treated all files as plain text, unless it knew that is was of a different type. XP now does not search files unless it has a handler that knows about that file type. .sql is not a file type that has a handler associated with it and so, by default, all your scripts become unsearchable.

It turns out that this is fixable. What is needed is to add a handler into the registry so that the free text filter will process .sql files. This is done as follows.
  • Open the registry

  • Navigate to HKEY_CLASSES_ROOT\.sql

  • Add a new key PersistentHandler

  • Set the value of the default string to {5e941d80-bf96-11cd-b579-08002b30bfeb} which is the classid of the text filter


  • This can be seen in the screenshot below



    Having done this of course and found my script I ran into bug 3208903 which meant that my script doesn't work.

    Bug 3208903 is an interesting bug. If you run a query documented in the DBMS_METADATA documentation you run across an ORA-31608 error. This is closed as not a bug. It seems to me that at the very least its a doc bug.

    2 Comments
    2 Comments:
    Thats cool that you made XP work.

    Install Google desktop search. its faster and efficient. You won't be sorry!
     
    I gave up on Windows XP's search and went to the freeware Agent Ransack
    (www.mythicsoftware.com/agentransack)
    It allows regular expression searchs and can preview the matching lines.
    I also use Google Desktop, but that isn't really suitable for removable media (flash drives, CD/DVD etc)
     
    Post a Comment