I make sure my SQL is broken up so everything is on its own line, such as
this ...
SELECT Something.*, ;
SomethingElse.* ;
FROM Something ;
LEFT OUTER JOIN Something ELSE ;
ON SomethingElse.Field = Something.Field ;
ORDER BY xyz
If I have a problem with the SQL .. I cut and paste the code into a
JUNK.PRG
file and run it. FoxPro will highlight the line where the error occurs,
although sometimes the error is the line above what is highlighted. But at
least it helps me get close to where the error is.
"Gene Wirchenko" <genew@[EMAIL PROTECTED]
> wrote in message
news:o1nrm3dfulbe7g56mj01d9j5uml3vd8mdp@[EMAIL PROTECTED]
> 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.


|