Null value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nairdeepthi2000
    New Member
    • Apr 2007
    • 12

    Null value

    Hi

    I have a database for a credit society which gives loans in that there are 2 fields for a Member table , loan amount taken and guarantor alongwith the other fields like age,address etc .
    A person may just be a member and may have not taken any loan yet , so i have kept loan amount as NULL , but when a person takes a loan he must have a guarantor . But if I dont keep the guarantor field as NULL it will cause problem when a person becomes fresh member and has not yet taken loan

    Can I keep the guarantor field NULL? Pleez clear out my vague concept about NULLS and help me out
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    Originally posted by nairdeepthi2000
    Hi

    I have a database for a credit society which gives loans in that there are 2 fields for a Member table , loan amount taken and guarantor alongwith the other fields like age,address etc .
    A person may just be a member and may have not taken any loan yet , so i have kept loan amount as NULL , but when a person takes a loan he must have a guarantor . But if I dont keep the guarantor field as NULL it will cause problem when a person becomes fresh member and has not yet taken loan

    Can I keep the guarantor field NULL? Pleez clear out my vague concept about NULLS and help me out
    Yes you can have 2 null columns.
    But it is better not to for search purposes.
    If you don't want to allow nulls you can put 0 in loan column and '' string in guarantor column as default. This way when new record is inserted and these two columns were not mentioned they will insert defaults instead.

    But still you have to make sure in your trigger when record is inserted\update d and if loan number is > 0 then guarantor should be not null and > ''

    Good Luck.

    Comment

    • nairdeepthi2000
      New Member
      • Apr 2007
      • 12

      #3
      Hi

      Thank u so much, u were a great help


      Originally posted by iburyak
      Yes you can have 2 null columns.
      But it is better not to for search purposes.
      If you don't want to allow nulls you can put 0 in loan column and '' string in guarantor column as default. This way when new record is inserted and these two columns were not mentioned they will insert defaults instead.

      But still you have to make sure in your trigger when record is inserted\update d and if loan number is > 0 then guarantor should be not null and > ''

      Good Luck.

      Comment

      Working...