Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2008

    Unanswered: Autopopulate PK from another PK

    I have tables A and B.
    A consists of Sales, their ID and other stuff. Table B has a foreign key the PK from A and also foreign key the PK of the product sold, quantity, price and other.
    So the PK of B is made of PK of A and PK of Product.

    Table A's PK is populated with a trigger from a sequence. What I want is when a new sale occurs, the FK which is from the side of A, to be autopopulated from the value of the PK of A. The Product ID will be manually entered.
    Is there any way to do this, like with triggers or anything else?
    help is apreciated

  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    >Is there any way to do this, like with triggers or anything else?
    Only if you have the ability to modify the application code to do what you have described.

    Code running inside of Oracle RDBMS has to easy/direct way to interact with user.
    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.

Posting Permissions

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