Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP Code to MySQL
Message
De
03/10/2006 15:35:00
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01158996
Message ID:
01159081
Vues:
24
>Dudes and Dudettes,
>
>I'm having a bit of a problem translating a VFP SELECT statement to MySQL.
>The following is the code I have so far. The "//" lines are the original
>VFP code, and the lines right underneath the //'s are the MySQL translation.
>Here's what I have so far:
>
>
>//ALLTRIM(dst.ccity)+", "+ALLTRIM(dst.cstate) as dest_city, ;
>concat(TRIM(dst.ccity), ", ",TRIM(dst.cstate) as dest_city,  <-- missing parenthesis here

>//LEFT JOIN c_d!users ue ON ue.uid = x.eby ;
>LEFT JOIN users ue ON ue.uid = x.eby
>
>//WHERE cmp.cname like lcCname ;
>WHERE cmp.cname like lcCname   ***** NOTE: this is a local variable in VFP! *****
// so you'd need to insert a '<<lcCname>>' here in textmerge to get the right
// value in the command. Same goes for other VFP variables.
>
>//AND TTOD(rdt) >= ldDateLow ;
>
>//AND TTOD(rdt) <= ldDateHigh ;

// instead ot ttod you'd simply have to have '<<ldDateLow>>' compared with the 
// rdt field, probably with a ... and rdt between '...' and '...'

>//AND DELETED() = .F. ;

// there are no deleted records. this line goes away.

>//AND x.acc = lcAccID ;
>
>//INTO CURSOR curDnumList READWRITE
>
>[NOTE: Decided to stop here when I saw the "INTO CURSOR" code. Hold all horses! :^)]
>
The "into cursor" part is unnecessary, unless you want to use it for another select while you're connected. There should be something telling MySQL to direct the resultset into a temporary table. I know I saw it somewhere, but I probably have just two days more experience with MySql than you have, so... look it up.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform