tags:

views:

222

answers:

1

I'm trying to add this p4sql query as a Custom Tool in P4V (Windows) by adding p4sql.exe as the application and

-s "select * from changes where lcase(description) like '$%$D$%' and p4options='longdesc';"

as Arguments.

When I execute the command and enter '123' as input, the following error comes back:

p4sql error:
    Usage: p4sql -h for usage.
    Option: 12 is undefined.

What escape mechanism am I missing?

+1  A: 

I recently updated the question you referenced and, as I stated, there is a bug in P4V, and P4SQL seems pretty flaky as well. You can get it to work some of the time if you put spaces between the "$%" and the "$D". Change this:

...like '$%$D$%' and...

to this:

...like '$% $D $%' and...

It will work some of the time after making this change, but some searches will still fail as those spaces become part of the search string. I've also noticed some searches fail for reasons I can't explain. I reported this to Perforce last October, and they confirmed it was a bug, but have yet to fix it.

You're better off using one of the solutions mentioned in the other question. Use P4Win or dump the change lists to a file and then search the file.

raven