SQLExpress - Xb2.NET     ot4xb  
xfree.public
Text serch in postgree
Thread Starter: Jose Valle Started: 6/3/2008 3:38 PM UTC
Replies: 2
Text serch in postgree
Hello.

I need to search for 2 strings of text in 'descripcion' column. With this it almost works

oCursor := oConn:Cursor("SELECT cuenta,descripcion,importe  FROM apuntes WHERE descripcion ILIKE '%" + MCAD +"%" + MCAD2 +"% ' ")  //

Only a problem with the order.

If I have in 'descripcion'  "pago correspondiente al recibo 2332"

   ->it works if I search for 'pago' and 'recibo'
   ->doesn´t work if search for  'recibo' and 'pago'

(I am still suprised with the speed, this in xbase++ will spend minutes with 76000 records and here less than a second)
Re: Text serch in postgree
Dear Jose Valle


If you put this


 oCursor := oConn:Cursor("SELECT cuenta,descripcion,importe  FROM apuntes
 WHERE descripcion ILIKE '%" + MCAD +"%" + MCAD2 +"% ' '%" + MCAD2 +"%" + MCAD +"% ' "  )

Maybe it work

Regards
Osvaldo Ramirez


-----------

Y si lo pones al revez, ?
Re: Text serch in postgree
Hola Osvaldo:

This works, I will look for a better (cleaner) solution.
oCursor := oConn:Cursor("SELECT cuenta,descripcion,importe  FROM apuntes WHERE descripcion ILIKE '%" + MCAD +"%" + MCAD2 +"% ' OR descripcion ILIKE '%" + MCAD2 +"%" + MCAD +"% ' ")  //