Page 1 of 1

Can the SQL search the file names?

Posted: Sat Apr 01, 2017 5:21 pm
by Dellu
I was trying to find the files which are not properly renamed.
user19 REGEX 'Anonymous'
doesn't get them. I want collect all the references which have attachments containing the name 'anonymous'.

Any way?

Re: Can the SQL search the file names?

Posted: Sat Apr 01, 2017 5:27 pm
by Dellu
OK, this one worked:

Code: Select all

Locate('Anonymous', varCharField) >0
based on the clue viewtopic.php?f=2&t=1984&p=9014&hilit=S ... name#p9014. I will leave it for reference.

Re: Can the SQL search the file names?

Posted: Sat Apr 01, 2017 6:13 pm
by Jon
Correct. Note that the next Bookends update (12.8.1) will introduce an updated database engine and some refactoring of the database schema -- your search will no longer work. When using 12.8.1 and later you can use a similar search to the one you have, like this

Locate('Anonymous', attachments) > 0

This is fine, but it will match substrings as well (e.g. it will match this (fake) word 'Nonanonymous')

If you want a search that is case insensitive (like locate) and only matches full pdf names, you can use this (this is how you'd do it in our SQL search box):

attachments REGEX '(?im)^Anonymous.pdf$'

Jon
Sonny Software

Re: Can the SQL search the file names?

Posted: Sun Apr 02, 2017 6:19 am
by Dellu
Ok, thank you. We will see when the new version comes out. I will ask if I couldn't find it right.