Working with Nulls


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)Advanced StrataFrame User (866 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I dont particulalrly like working with nulls. I know there is an option in SF for repacing null values with a different value. I am considering goint back a step to the database set up. I notice there is a property on each filed called 'Default Vlaue or Binding' . I have played around with this and noticed that if i insert ' ' (Space within single quotes) for chrarcter and date fields, or 0 (Zero) fro numeric fields, it seems to default to a Non Null when I add a record (In SSMS at any rate) i.e. Spaces for character fields and Zero for numeric fields, which is just what I want (Similar to VFP if you add a record)

I would welcome any suggestions, if this is a good idea or if there are any 'Gotchas' down the line.

Reply
Peter Jones
Peter Jones
Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)Advanced StrataFrame User (718 reputation)
Group: Forum Members
Posts: 386, Visits: 2.1K
Hi Gerard,



Take a look at: http://forum.strataframe.net/Topic10223-6-1.aspx



This has worked very well for us for quite a while now.



Our policy on nulls is not to allow them unless they are really necessary, e.g. the dispatch date on a product can be null if it hasn't been dispatched yet therefore nulls are permitted.



In the BO mapper we set every column's Null Type to "Use Nullable Generic" (in the wizard) then go through and change all string (reference type) fields to: "Return Alternate on Nulls" and set the alternate value to String.Empty. And that's it - everything just works from then on and we can exercise control at the database level.



Cheers, Peter
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search