Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Urgently needed! SQL Syntax in retrieving records...
Message
De
07/02/2002 04:08:52
 
 
À
07/02/2002 03:45:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00616376
Message ID:
00616461
Vues:
25
Ed,

>Actually, there's a completely trivial solution; simply parse the string cDesc and generate a unique WHERE clause at runtime. Using a regular expression parser such as VBScript.RegExp, you could create a regular expression which, when applied, would return a collection of tokens which could then be used to construct LIKE expressions immediately prior to invoking the SELECT statement; it might be worthwhile implementing it as an SP on each platform and taking advantage of platform-specific behaviors implementing the SELECT on each discrete platform.<

That's exaclty what I meant when I said 'build the WHERE clause'. It doesn't really matter how you parse cDesc.

A more important point is what you mentioned in your second paragraph - design. I don't know if this is an option for Jess, but I would certainly go the way you describe if I had to provide this kind of functionality.

>>Jess,
>>I cannot think of an easy solution. The only thing that comes to mind is to convert cDesc into an array and then build the WHERE clause using the syntax Sergey has suggested for each word. In any case, the query won't be optimized with these kind of operators.
>>Since you mentioned SQL Server, you may consider Full-Text Search, although I have no personal experience with this feature. If you were looking for a pure VFP solution, then phdBase would be an alternative.
>
>Actually, there's a completely trivial solution; simply parse the string cDesc and generate a unique WHERE clause at runtime. Using a regular expression parser such as VBScript.RegExp, you could create a regular expression which, when applied, would return a collection of tokens which could then be used to construct LIKE expressions immediately prior to invoking the SELECT statement; it might be worthwhile implementing it as an SP on each platform and taking advantage of platform-specific behaviors implementing the SELECT on each discrete platform.
>
>Honestly, it's a broadly boring problem; the table could easily be restructured to parse the description field into a supernormal set of attributes describing the record, and the query is then posed against the attribute set for each record. At that point, the query becomes optimizable...
Daniel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform