Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Code to MySQL
Message
From
03/10/2006 15:35:00
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01158996
Message ID:
01159081
Views:
23
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform