Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2013
    Posts
    5

    Question Unanswered: problem understanding alter add

    what does the below code means?

    alter table invoices add balance_due(9,2)

    i understand that its adding a new column. but why is there two numbers used-(9,2)?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    when all else fails, Read The Fine Manual

    Data Types
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Statement you posted is invalid, so it does nothing:
    Code:
    SQL> alter table invoices add balance_due(9,2);
    alter table invoices add balance_due(9,2)
                                        *
    ERROR at line 1:
    ORA-00902: invalid datatype
    
    
    SQL>
    Though, with a valid datatype, it is OK:
    Code:
    SQL> alter table invoices add balance_due number (9,2);
    
    Table altered.
    
    SQL>
    with 9 being precision and 2 scale. Anacedent's link describes both terms.

Posting Permissions

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