Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    5

    Unanswered: SSN data type question

    I am working on a project where the my customer has defined the SSN (Social Security Number) as String. The specs call for the SSN to be numeric. I would prefer that the field be NUMBER(9) but the customer is arguing that it should be CHAR(9).

    Are there negitive performance hit with CHAR vs NUMBER???

    Should I really care about this issue... It just seem that the data is numeric so the column type should be NUMBER...

    Any thoughts...

  2. #2
    Join Date
    Jan 2004
    Location
    North Haven, CT
    Posts
    110

    Re: SSN data type question

    Originally posted by taa_sarge
    I am working on a project where the my customer has defined the SSN (Social Security Number) as String. The specs call for the SSN to be numeric. I would prefer that the field be NUMBER(9) but the customer is arguing that it should be CHAR(9).

    Are there negitive performance hit with CHAR vs NUMBER???

    Should I really care about this issue... It just seem that the data is numeric so the column type should be NUMBER...

    Any thoughts...
    There are some SSN numbers start with leading 0. So i think it will be easier to treat it as a string.

  3. #3
    Join Date
    Jan 2004
    Posts
    492

    Re: SSN data type question

    Originally posted by lynden.zhang
    There are some SSN numbers start with leading 0. So i think it will be easier to treat it as a string.
    I agree - just another note - using char(9) although perfectly acceptable, is not very common anymore. You hardly see any string datatypes that arent varchar2.

    Just something to think about....Maybe you are fully aware of this and just are writing CHAR for the sake of shorthand

  4. #4
    Join Date
    Feb 2004
    Posts
    5

    Re: SSN data type question

    No, I was not aware that CHAR was not used much anymore. My backgound is from the mainframe COBOL where CHAR is used heavily.

    I was under the impression that if the length was known then CHAR was the slightly better because it did not carry the extra 2 bytes from a VARCHAR2.

  5. #5
    Join Date
    Jan 2004
    Posts
    492

    Re: SSN data type question

    Originally posted by taa_sarge
    No, I was not aware that CHAR was not used much anymore. My backgound is from the mainframe COBOL where CHAR is used heavily.

    I was under the impression that if the length was known then CHAR was the slightly better because it did not carry the extra 2 bytes from a VARCHAR2.
    You're right that CHAR has more of an exact length - if you have a varchar2(20) column, it will always hold 20 spaces regardless of actual size.

    Even this being true, VARCHAR2 is definitely the preferred method. You will see almost all string datatypes of this datatype used in Oracle development work. Just my 2 cents

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •