Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replacing Null Fields
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01467343
Message ID:
01468251
Vues:
47
Hi Boris

I generally tend to prefix all field names with the first 3 characters of the table so there usuaully is not a clash of field names.
The reason I dont want to have to nominate the fieldlist, is that the resulting cursor becomes the source for a Grid, and
the fields to be displayed on the grid are taken from a user specified file. So I want to have all the possible fields available so I dont have to reompile each time a user will request a field. Also, there could be 50 fields in easch table so its a bit of a pain going through each one...... but if that's what I have to do

Regards,
Gerard


>I doubt you need ALL fields from ALL >tables involved in SELECT.
>What if you have fields with the same name in ALL tables?
>One rule:
>ALWAYS use Field list in SELECT clause.
>
>
>
>>Hi Thanks for your replies.
>>My Sql select lloks like:
>>Select * from TableA Left Outer Join Tableb on Key=Keyb.......
>>I was trying to avoid having to get into inserting specific Filed names into the Select statement.
>>If there was a Global setting like Set Nulls to Zero/Blank, it would mean I would not have to identify each field separately.
>>regards,
>>Gerard
>>
>>
>>
>>>>If I do a select Left Outer join, I end up with Nulls in the fields where no match exists in the Joined Table.
>>>>Is there any VFP setting where I can default these to zero (if numeric) or spaces(if Character) rather then Null.
>>>>I know I can post process the table and do an if Isnull() , but my prererence is to avoid having to do this if it can be done.
>>>>Thanks in advance
>>>>
>>>>Gerard
>>>
>>>You could do this in your select:
>>>
>>>SELECT MainTable.SomeField,;
>>>       NVL(LeftJoinedTable.NumericField, 0000000.00) AS NumericField,;
>>>       NVL(LeftJoinedTable.CharField, SPACE(??))            AS CharField;
>>>FROM ....
>>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform