This discussion is archived
2 Replies Latest reply: Nov 4, 2013 5:53 PM by tiplip RSS

How to perform nosql fuzzy query over Berkeley DB?

tiplip Newbie
Currently Being Moderated

hi,

 

In SQL statement, it's easy using keyword LIKE, but I just want to use BDB C API directly, how to do that?

I have googled, but no answers come, thanks any feedback here.

  • 1. Re: How to perform nosql fuzzy query over Berkeley DB?
    userBDBDMS Guru Moderator
    Currently Being Moderated

    The native C API for Berkeley DB is a key/value pair interface.      The basic operations are puts/gets.     'LIKE' is a SQL construct that is used in predicate comparisons.    To create an equivalent using the C API, then create a cursor that iterates over all of your records,  for each record returned from the cursor you would need to do a string compare and select out the ones that match.     A C string compare would be the equivalent of doing the 'LIKE' in SQL.  We have lots of good information on cursors in our programmers reference guide. 

     

    thanks

    mike

  • 2. Re: How to perform nosql fuzzy query over Berkeley DB?
    tiplip Newbie
    Currently Being Moderated

    hi, thanks for your kind response. I noticed that BDB also provided SQL function, but it was done like your description when SQL parser come across LIKE keyword? It would be higher overhead if travers all records?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points