Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why doesn't this work?
Message
From
20/07/2006 19:37:45
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Database:
MySQL
Miscellaneous
Thread ID:
01138247
Message ID:
01138273
Views:
10
>>When I try to build this code (that someone else wrote, I might add),
>>VFP 9 SP1 comes back with: "Error in line 30: Command contains unrecognized
>>phrase/keyword."
>>
>>Here's the code...
>See corrected code:
>
>USE (m.lcTableName)
>
>SELECT cmpid, ts, IsUpdated FROM m.lcTableName ;
>WHERE IsUpdated > 0 INTO CURSOR local_cursor
>
>**! Form retrieve from server list
>SQLEXEC(this.connhandle, ;
>"select cmpid, ts, IdDeleted from companies where ts < "+TTOC(settings.lastupdate,1), "remote_cursor")
This would need either single quotes around the datetime that's been converted to text:
SQLEXEC(this.connhandle, ;
[select cmpid, ts, IdDeleted from companies where ts < ']+TTOC(settings.lastupdate,1)+['], "remote_cursor")
or better yet, just pass it as a parameter:
SQLEXEC(this.connhandle, ;
"select cmpid, ts, IdDeleted from companies where ts < ?settings.lastupdate", "remote_cursor")
>*** Should here we use {} ??
>
>**! Compare the two tables & eliminiate depreciate matches
>
>SELECT x.cmpid, x.ts AS ts_local, y.ts AS ts_remote ;
>FROM local_cursor x ;
>LEFT JOIN remote_cursor y ON x.cmpid = y.cmpid ;
>INTO CURSOR matches_cursor
>
>**! The SELECT command above is the line that nukes :^).
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform