Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When is not equal - equal
Message
De
02/12/1997 17:14:58
 
 
À
02/12/1997 16:18:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00063383
Message ID:
00063419
Vues:
60
>>>>I am forming a SQL select for a report on two tables which are in a multiple to multiple
>>>>relationship (thru a third, cross reference table). (In VFP 5.0a).
>>>>
>>>>One list contains equipment and the other (engineering) drawings for the equipment.
>>>>Each piece of equipment can have more than one drawing and each drawing can be for more than one
>>>>piece of equipment.
>>>>
>>>>When I run the SQL I get drawings assigned to more pieces of equipment than they should.
>>>>
>>>>The drawing key is of a form "dr00000v" were "dr" is for drawing and the remaining characters
>>>>can be any number, upper case or lower case character. Keys are assigned in sequence
>>>>from a common table as needed.
>>>>
>>>>That is "dr000001" , "dr000002" etc.
>>>>
>>>>The problem extra drawings occur becuase VFP seems to believe that "dr00000v" and "dr00000V"
>>>>are equal as well as others where the last character is different only in being a different
>>>>case.
>>>>
>>>>Please try it. When I run the following from the command window I get .T. as a response to
>>>>? ctemp1 = ctemp2.
>>>>
>>>>ctemp1 = "dr00000v"
>>>>ctemp2 = "dr00000V"
>>>>? ctemp1 = ctemp2
>>>>
>>>>Please, what is happening?
>>>>
>>>>It does not help to place "set exact on"
>>>>
>>>>It has only happended since yesterday when I loaded version VFP 5.0a. It did not seem to happen
>>>>under version 5.0.
>>>>
>>>>Am I missing something?
>>>>
>>>>Best Regards Don
>>>
>>>
>>>Please show SQL select statement with any pertinent code.
>>
>>SQL is below :
>>
>>SELECT DISTINCT Commlist.commno, Commlist.grp_no, Commlist.co_sort,;
>> Commlist.co_eqno, Commlist.co_desc, Commlist.commlis_id,;
>> Dwgxcomm.drawing_id, Drawings.drawing_id, Drawings.dwg_by,;
>> Drawings.dwg_no, Drawings.sht_no, Drawings.dwg_title,;
>> Drawings.issue_cust, Drawings.tabs_id, Binders.binder_no, Tabs.tab_no;
>> FROM commlist LEFT OUTER JOIN dwgxcomm;
>> INNER JOIN drawings;
>> LEFT OUTER JOIN tabs;
>> LEFT OUTER JOIN binders ;
>> ON Tabs.binders_id = Binders.binders_id ;
>> ON Drawings.tabs_id = Tabs.tabs_id ;
>> ON Dwgxcomm.drawing_id = Drawings.drawing_id ;
>> ON Commlist.commlis_id = Dwgxcomm.commlis_id;
>> ORDER BY Commlist.commno, Commlist.grp_no, Commlist.co_sort,;
>> Commlist.co_eqno, Drawings.dwg_by, Drawings.dwg_no, Drawings.sht_no;
>> INTO TABLE cmlxdwg.dbf
>>
>>Commlist is the equipment list. dwgxcomm is the cross reference file for the multiple to
>>multiple relation, ie it contains only the commlis_id and drawing_id fields.
>>
>>Binders and tabs only show were the drawings are located.
>
>Sorry for interruption, I have two questions.
>1. Do you have problem with SQL only, or even simple string comparison still doesn't work properly?
>2. In regard to this SQL-Select. Maybe it will work Ok, but, honestly, when I look at so complicated SQL, my first reflection is to break it to chain of simpler Selects.

Edward,

your 1.) the simple string comparsion does not work. That is going back to :

ctemp1 = "dr00000v"
ctemp2 = "dr00000V"
? ctemp1 = ctemp2 -- returns .t. on my computer
? ctemp1 == ctemp2 -- returns .f. on my computer

It might be interesting to note that in a relation

set relation to drawing_id into drawings

I get the proper result, no lower case problem.

your 2.) I agree with you, this is the SQL out of the Query file I use.
Best Regards
Don Simpson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform