Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2010

    Unanswered: Altering a Primary key

    There is a Table : Person. name(VARCHAR2(50 BYTE)) and email(VARCHAR2(50 BYTE)) are the primary keys in this table.
    This Primary Key is used as a Foreign Key in another table Address as name(VARCHAR2(50 BYTE)) and email(VARCHAR2(50 BYTE)), and delete on CASCADE in enabled

    Now i want to alter the length of Name column in the Person table to 256 BYTE.

    If i dont atler the length of name in the Address table - will CASCADE still work?

  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    >If i dont atler the length of name in the Address table - will CASCADE still work?
    It depends upon your definition of "work".
    What happens when you actually do it?
    Would not it be faster to test results yourself rather than ask here?
    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
    Jun 2004
    Liverpool, NY USA
    Why don't you want to alter the length in the address file. The first time you have a name longer then 50 characters, your address file will fail.
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  4. #4
    Join Date
    Sep 2010

    Altering a Primary key

    This is because ...if i alter in the other table lot of changes have to be done to the i was looking for a minimal changes.

    I tried myself, cascade works fine since it does not matter if the length is different


  5. #5
    Join Date
    Nov 2003
    Provided Answers: 8
    But beilstwh is right:

    What happens if you insert a row into the table PERSON that has a PK longer than 50 byte?

    You will not be able to insert an address for that person!

    Is that really what you want?

Posting Permissions

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