Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7506865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:22:17+00:00 2026-05-29T22:22:17+00:00

I am working on a simple database where I would want to have a

  • 0

I am working on a simple database where I would want to have a one is to many relationship, I’ve created a foreign key which has on an ON UPDATE CASCADE, based from my understanding of ON UPDATE CASCADE, if my Primary gets incremented the Foreign key in the other table that references it will also get incremented/ have the value of the Primary in the other table . but the problem is as I insert data in my Parent table, the foreign Key in the other table did not get the value of the Primary on my parent table why is it like that? How would my foreign key have the value of the key that is related to it? here’s a screenshot for you guys to easiy understand enter image description here

As you can see the P_ID in the orders table doesn’t have a value even though it is linked to the P_ID in the People table

The Expected Result will be that in the Orders table the value of P_ID would be equivalent to P_ID of people table, where I inserted my data.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:22:23+00:00Added an answer on May 29, 2026 at 10:22 pm

    but the problem is as I insert data in my Parent table.

    You wont get any action on insert, only on update.

    If you have people number 1 and an order to people number one, if you change it to number 2, the order will be changed to 2.

    You may want a trigger. tell us more what’s the expected result

    EDIT:

    trigger example:

    create trigger InsertRecordOnOrder
    on People
    after insert
    as
    begin
        insert into Orders
        select * from INSERTED
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am working on a simple web app which has a user model and
I'm writing a semi-simple database wrapper class and want to have a fetching method
I'm working on a simple multiplayer game in which 2-4 players are placed at
I'm working on a simple javascript login for a site, and have come up
I am working on a simple CAD program which uses OpenGL to handle on-screen
I am working on a site which displays products from a database in a
I have a relatively simple case. I basically want to store data about links
I have a decent working web application (Java/Servlet/Jsp) that I would like to improve
I have wrote a few simple Rails application, accessing the database via the ActiveRecord
I have a substantial database... not a very large one - around 1gb of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.