Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query from memo
Message
De
13/02/2007 11:53:06
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 5
Divers
Thread ID:
01194981
Message ID:
01195216
Vues:
13
Right you are
_________
>Hi Zakaria,
>
>If you're using textmerge, write your query as you normally would do, e.g.
>
>text to lcSQLVar textmerge noshow pretext 7
>  select <<lcFields>> ;
>  from <<lcTable1>> ;
>  inner join <<lcTable2>>  ;
>  ...
>endtext
>
>? RunSQL(m.lcSQLVar)
>
>RunSQL can chrtran CHR(13)+CHR(10) to " " and ; to a space, so you would be able to do &lcNewSQL You may build try/catch and saving select to file /clipboard, etc.
>
>>Hi Gregory,
>>
>>The strtran worked as
m.Velden = strtran(tblQueries.Velden,chr(13) + chr(10),"")
. But that puts everything on one line, which makes the debugging more difficult. Moreover I get some problems because I'm using at some moment textmerge, so I have to write the query to a textfile.
>>There seems to be a limit on how many characters a textfile can put in one line,at one moment it breaks the line to the next line. The query then becomes misformed. I don't have any idea how to solve this....
>>
>>
>>>>Hi All,
>>>>
>>>>I'm rewriting some inherited code which has a lot of queries and within these queries many fields selection (sometimes more than 100 fields). So the code is very unreadable. I want to store the fields in a table memo field (velden) and rewrite the queries with macro substition, for example
>>>>
>>>>
>>>>locate for tabel.kind = "mutbdrg"
>>>>cQuery = cQuery = "select " + alltrim(Velden) + "from mutbdrg_verloop"
>>>>&cQuery
>>>>
>>>>
>>>>But I get an error which I don't understand (command contains unrecognized phrase/keyword). For testing I have stored one field in the memo :"estkst;". When I assign cQuery to _cliptext and paste the result in the command window, it works but with a macro it fails. Am I doing something wrong?
>>>>
>>>>_cliptext gives the following:
>>>>
>>>>select estkst;
>>>>from mutbdrg_verloop
>>>>
>>>>
>>>>Thanks beforehand
>>>
>>>Zakaria,
>>>
>>>Take out the semicolon
>>>_cliptext should give you
>>>
>>>select estkst from mutbdrg_verloop
>>>
>>>
>>>Also do a strtran on cQuery to replace CRLF with space or tab
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform