Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sql parser...
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Titre:
Sql parser...
Divers
Thread ID:
00508126
Message ID:
00508126
Vues:
65
Maybe someone has comeup with an elegant way of doing this. who knows.
but here goes a little snip of code, I am really attemping to get more robust.
this is part of a sqlparser, where a sql command is passed into it, and this program, formats it a little better to pass onto a sql server

the m_qry is the query.



m_numberofw=OCCURS("%",m_qry)
If m_numberofw=1
m_qry=STRTRAN(m_qry,"%",'%"')
m_qry=STRTRAN(m_qry,'LIKE','LIKE "')
** added one quote to the back end
ENDIF
IF m_numberofw =2
m_qry=STRTRAN(m_qry,"%",'%"',2,1)
m_qry=STRTRAN(m_qry,"%",'"%',1,1)
&& add one to the back end ( and add one to the front end.
Endif

While this works for very simple querries, its not robust enough to have more than one wildcard seach - parsted out directly.


I know, I have just been at my computer too many hours to see the simplicity as to how to loop this, to allow for more than one or two % to be properly parsed..

Thanks for reading.
Bob Lee
In the beginning, there was a command prompt, and all was well.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform