Source language: Translate to:

Partial search

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Partial search

Postby carlos torres » Fri Jun 06, 2008 3:34 pm

Hi everybody

Thanks in Advance - TIA - I will appreciate your help.

I'm trying to make a search (using dbp) on a specific field it could be on partial or complete words. The field has a few words separated by commas. i.e: music, software, bands

I want to select only those records that match for example "software".

Any of the following statements that I used doesn't work.
Code: Select all
1 -
dbpFind "Fladem" "Registry" "KEYWORDS" "[BuscaX]" "ExactMatch=No;CaseSensitive=No"

2 -
dbpExecSQL "Fladem" "SELECT * FROM Registry WHERE KEYWORDS LIKE [#34][BuscaX][#34]" "[tblResult]"

3 -
dbpQuery "Fladem" "Registry" "KEYWORDS =[BuscaX]"


What I'm doing wrong?
I'm missing something?

regards

carlost
User avatar
carlos torres
 
Posts: 289
Joined: Mon May 02, 2005 8:14 am
Location: Pamplona, Colombia

Postby Gaev » Fri Jun 06, 2008 4:39 pm

carlost:

a) Try using a hard coded text string ... e.g. music ... instead of variable [BuscaX] ... just to make sure nothing is being lost in translation .. or assumption.

b) Try using ! before the word SELECT ... to make sure NeoBook passes the parameter values unchanged.

c) When using dbpFind, remember that when a match is found only the first record is returned ... you have to Use dbpFindNext to display additional matching records.

d) When using dbpExecSQL, try ...
Code: Select all
dbpExecSQL "Fladem" "!SELECT * FROM Registry WHERE KEYWORDS LIKE [#34]%music%[#34]" "[tblResult]"
... since LIKE does pattern matching, the % will ask to match any number of characters, even zero characters ... if i was a betting man, I would say this is your problem.

e) Instead of LIKE, you can also try using ...

INSTR(str,substr)
LOCATE(substr,str),

... and select rows where result is > 0

f) If you still can't get the expected results ... try using a different table and/or field name ... Registry and Keywords are not on the official "Reserved Words List" ... but are too close for comfort.
User avatar
Gaev
 
Posts: 3718
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest