Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT-SQL syntax error...
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00161237
Message ID:
00161321
Views:
24
This is a compelling argument for simplifying your SQL SELECTs - they're easier to debug *and* they run faster.

I would guess that it probably has to do with the number of parentheses in your field expressions. VFP is more critical than FPW was. You're just going to have to take one out at a time and/or analyze things to figure out where.

>Hi all,
>
>The following SELECT-SQL statement runs and compiles fine in FPW2.6, but generates a syntax error at compile and runtime in VFP5.0...any thoughts?
>
>*
>* Hard to read here, I know...I lost all of the formatting when I
>* pasted it in here...
>*
>SELECT insp_no, start_dt AS start_dt, start_hr, start_mn, end_dt AS end_dt, end_hr, end_mn, PADR(spGetDesc(activity, laActivities), 50) AS task, 'S' AS type FROM schedule UNION ;
> (SELECT insp_no, insp_dt AS start_dt, start_hr, start_mn, insp_dt AS end_dt, end_hr, end_mn, PADR(GetTask(insp_tp), 50) AS task, 'A' AS type FROM mvi_actv UNION ;
> (SELECT insp_no, insp_dt AS start_dt, start_hr, start_mn, insp_dt AS end_dt, end_hr, end_mn, PADR('MVI Inspection', 50) AS task, 'A' as type FROM mvi_insp UNION ;
> (SELECT insp_no, insp_dt AS start_dt, start_hr, start_mn, insp_dt AS end_dt, end_hr, end_mn, PADR('CVSA Inspection', 50) AS task, 'A' as type FROM cvsainsp UNION ;
> (SELECT insp_no, insp_dt AS start_dt, start_hr, start_mn, insp_dt AS end_dt, end_hr, end_mn, PADR('Premise Inspection', 50) AS task, 'A' as type FROM preminsp UNION ;
> (SELECT insp_no, insp_dt AS start_dt, start_hr, start_mn, insp_dt AS end_dt, end_hr, end_mn, PADR('Dealer Premise Inspection', 50) AS task, 'A' as type FROM dealprem UNION ;
> (SELECT insp_no, insp_dt AS start_dt, insp_hr AS start_hr, insp_mn AS start_mn, end_dt, end_hr, end_mn, PADR('Mobile Inspection', 50) AS task, 'A' as type FROM mob_main UNION ;
> (SELECT insp_no, insp_dt AS start_dt, insp_hr AS start_hr, insp_mn AS start_mn, end_dt, end_hr, end_mn, PADR('VCS Inspection', 50) AS task, 'A' as type FROM vcs_main))))))) ;
>WHERE BETWEEN(start_dt, ldstart_dt, ldend_dt) ;
>ORDER BY 9, 1, 2, 3, 4, 5, 6, 7, 8 ;
>INTO CURSOR curtemp
>
>TIA,
>Phil
-cjh
Previous
Reply
Map
View

Click here to load this message in the networking platform