Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2014

    Unanswered: How to update cust_id from Customer table to order table Cust_id field while insert

    I have two tables 1. Customer_details and 2. Order_details.

    ** 1.Customer_details table -->fields--> Cust_Id(Primary Key) and Customer_Name, 2.Order_details table --> fields-- Ord_Id(Primary Key), Cust_id, (There is no field for Customer name in Order_details table). I am trying to insert customer name to order_details by CSV file through application code. When insert customer name to order_details table it should check the corresponding Customer name- Custid from Customer_details table and insert the relevant customer name Custid to order_details table. Need to implement this in Database level not in application coding level. Searching lot in this and cant figure out. If possible need to implement with trigger. Kindly help with the code.


  2. #2
    Join Date
    Feb 2004
    In front of the computer
    Provided Answers: 54
    Assuming that you need this for query purposes, I would recommend using a JOIN instead of a trigger.

    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

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