Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you hide NULL from the UI?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01462853
Message ID:
01463095
Vues:
44
>>>
>>>BTW If the NULL values are NOT needed at all I prefer to set default value to empty field (depends of its type). Only type that allow NULLs is datetime :-)
>>>Of course this is dependong the application, sometimes NULLs are mandatory.
>>
>>Borislav, I came across an issue with the NULLs and may have to adapt the same approach you have - setting default value instead of NULL. If you don't mind, I would like to ask you how you hide the record/row in the parent table with the empty/default field from the user? TIA.
>
>You can't have more than one record in Parent table with DEFAULT value. Otherwise a PK constrain will raise an error.
>How to hide it: Just use WHERE in your SELECT statement.
>
>But I'm still wondering why you need child records w/o parent ones?

Maybe I didn't explain myself right. I want the child table FK to have an option of empty string. In order to do it and maintain RI the parent table must have a row with an empty string value in the field. And of course I don't want the user to change the value in this Parent table for row intentionally or by accident. So I will need to have this row but not to allow user to make a change (therefore) to hid it. One way I though it to have a column/field that identifies this record (e.g. REC_ID) but was hoping for a less-maintenance type approach.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform