Opened 21 years ago
Closed 18 years ago
#49 closed enhancement (later)
LIKE function
Reported by: | Víctor de Buen Remiro | Owned by: | Víctor de Buen Remiro |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Text | Version: | head |
Severity: | minor | Keywords: | |
Cc: | fdelamuela |
Description
Hello
I think that some implementation of a text comparison function of the style of SQL
function LIKE should be a useful feature in TOL. I don't know if exist an standard
description of the behaviour of LIKE, or each SQL has a different prototype, but
I'm sure most analysts around the world are familiar with it. Inside BText class
there is a member function Match that should be used for this purpose.
Change History (4)
comment:1 Changed 21 years ago by
Status: | new → assigned |
---|
comment:2 Changed 18 years ago by
Cc: | fdelamuela added |
---|
comment:3 Changed 18 years ago by
Owner: | changed from danirus to Víctor de Buen Remiro |
---|---|
Status: | assigned → new |
comment:4 Changed 18 years ago by
Resolution: | → later |
---|---|
Status: | new → closed |
I propose a temporary solution available when a database is open.
Real SqlLike(Text txt, Text pattern)
{
Text qry = "select '"+txt+"' LIKE '"+pattern+"' from dual";
WriteLn(qry);
};
PutDescription(I2(
"Calls to the currently open database LIKE function.",
"Llama a la función LIKE de la base de datos abierta."),SqlLike);
Real SqlLike("farola","%o%a");
With a AMD64 with local MySQL server the total time for 10000 iterations of SqlLike calls was 3.328 seconds. Calling TextMatch total 1000 times ends in 0.578 seconds.
A better solution needs to link to something regular expression library as Boost or perl-regexp that is a very hard work.
* Bug 297 has been marked as a duplicate of this bug. *