Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SELECT Bug?
Message
De
18/08/1997 18:22:06
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00045304
Message ID:
00045417
Vues:
30
>>Richard,
>>
>>Just a suggestion. You'll get better performance with either
>>
>>SELECT MAX(cIssue_Pk);
>> FROM Issue;
>> INTO CURSOR CurIssue
>>
>>or
>>
>>CALCULATE MAX(Issue.cIssue_Pk) TO lcCurIssue
>>
>>than from the correct sample above.
>>
>>Given the complexities of SQL syntax, it's not surprising that this got by the compiler. But that's why we test these things, isn't it?
>>
>>George
>
>Thanks for the reply, George. Can't use CALCULATE, this is a character field (cIssue_Pk, "c" means character), *have* to use MAX(VAL(etc...
>
>As for the "complexity" of the SQL syntax - no joins, unions, etc. this is a single field select...And, guess what, I just ran the exact same statements using VFP 3.0b - IT TRAPS THE BAD ONES AND RETURNS AN ERROR! This is CLEARLY a bug! It is NOT my video driver, or my system's memory, or my motherboard, or , as others would have you believe. Where's that copy of PowerBuilder...
>
>I was able to catch this bug because the result set was so obviously wrong, but what about more complex queries that return multiple records, maybe hundreds or thousands? Would you bet your life on the accuracy of this product's SQL implementation? I would not.
>
>Late breaking update: I tried your suggestion and SELECTed the MAX(cIssue_Pk) and it returned the MAX alright, of a DELETED record (00010)!! Whereas the MAX(VAL(cIssue_Pk)) incorrectly returns 9.00 It completely ignored the status of SET DELETED, which is what it's supposed to do, when using just MAX(), but respected it when using MAX(VAL()). So, if you combine functions, you ain't got a clue if this stuff is right or not. BOGUS, TOTALLY BOGUS!! Where's that copy of PowerBuilder...
>
>-RW-

Just out of idle curiosity, if this is a single user system why are you using a sledgehammer to drive a finishing nail? If all you want is the next number in line, why not
Select Issue
set order to tag issue_pk
go bott
nextval = str(val(issue_pk)+1) ??

If deleted records are a problem, include logic to skip over those numbers.

And please, don't bother to grade this reply. I'm a programmer, not a professional writer or an English teacher (although I have worked as a tutor in both)
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform