Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SELECT Bug?
Message
From
18/08/1997 12:43:35
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, United States
 
 
To
18/08/1997 12:27:26
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00045304
Message ID:
00045307
Views:
27
>Hi folks, I just stumbled across what I consider to be a *major* bug in the SQL SELECT parser. I have a table with a character primary key - cIssue_Pk, 5 bytes long. I want to increment this key under program control so I use the following statement to obtain the current "highest" key - SELE FROM Issue MAX(VAL(cIssue_Pk)) AS pk INTO CURSOR CurIssue - I get back a cursor conatining ALL the primary keys found, as numerics. If, however, I use this statement - SELE MAX(VAL(cIssue_Pk)) AS pk FROM Issue INTO CURSOR CurIssue - OR - SELE MAX(VAL(cIssue_Pk)) FROM Issue AS pk INTO CURSOR CurIssue - I get the "correct" single record cursor with the highest value... BTW, the second "correct" statement above is also illegal since the AS clause follows the "FROM Issue" and is not after the field statement as it should be. Not too cool.
>
>This gives me a ton of confidence as to the veracity of the result sets I get back from VFP when doing SQL SELECTs. This is a SIMPLE, one field, no joins or unions, SELECT and yet VFP 5.0a cannot give me accurate, repeatable results. Great product.
>
>If this has been documented previously, please excuse this post, otherwise just another screw-up by the boys at MS - where is 5.5 when you really need it?
>
>Oh, yeah, Lewis just called me over to his machine to see where VFP would allow him to key local variables into his method code, and when he saved it (using Ctrl+S), they disappeared right before our eyes!!! He had to exit the form and pull it back up before he was allowed to save his changes. This form was NOT in Read Only mode. Yeah, one rock solid product we got here...
>
>Bummed in DC,
>
>-RW-

Richard,

Forgive me, but, what the hell are you talking about?

I've pretty much accepted that syntax IS important and that ANYONE can force VFP into an error condition, or returning an *unexpected* result. If all your SQL statments are set up like this:
SELECT {fields} ;
FROM {tables} ;
WHERE {joinconditions} AND {filter conditions} ;
GROUP BY {expression} ;
ORDER BY {columns} ;
etc. and blah, blah, blah
(which all of mine are anyway) then you'll get the right answer, everytime.

So I don't even understand this flame at all.

As far as losing locals.. All a Method is, is a text file. Are you sure that Lewis isn't macro-happy and that ctrl+s tried to do something other than save? What about the old FPD standby, Ctrl+W. It works for me.

Rich, I'm sorry to sound so sarcastic, but it really sounds like you woke up on the wrong side of the bed today...like underneath it.

Smile, only 4 days until Friday...lol.. ;-)
Matt McDonnell
...building a better mousetrap with moldy cheese...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform