Dan Freeman wrote:
> That's been a bugbear in using SQL from day one since VFP sees the query
as
> one command. There's not a lot you can do about it.
>
> Careful and consistent formatting can help you spot places where there's
a
> missing comma or semicolon because they just won't look right.
Sometimes.
> <g>
>
> I've been known to set a breakpoint on the line immediately preceding
the
> errant query so the environment is set up for it, and while suspended I
copy
> the query to the command window and start pruning until I get something
that
> runs. Often, just the act of looking at the query outside the program
> environment makes the error jump out at me.
>
> I share your pain.
>
> Dan
>
> Gene Wirchenko wrote:
>> I have just finished -- I hope I have finished -- some changes to
>> one program of mine that has some hairy SQL. One of the SQL statments
>> is 40 lines long. Granted it could be shorter vertically, but it is
>> still 852 characters long.
>>
>> Occasionally -- read "All too often" -- while wrestling with this
>> program, there would be an error in my SQL syntax. VFP is not
>> terribly helpful with such error messages as
>> Syntax error.
>> Command is missing required clause.
>> These are not terribly useful. Sometimes, I have hunted for minutes
>> before realising that, say, a comma was missing.
>>
>> What do you do to quickly find errors in long SQL statements?
>>
>> Sincerely,
>>
>> Gene Wirchenko
>>
>> Computerese Irregular Verb Conjugation:
>> I have preferences.
>> You have biases.
>> He/She has prejudices.
>
>
If you think VFP's handling is bad, try SQL Server with it's "Error near
keyword 'WHERE'" type stuff. I find it almost never is actually
anywhere near where the error actually is.
--
Cy Welch
Senior Programmer
MetSYS Inc
http://www.metsysinc.com


|