Sign Up

Hey, Dev!
Are you looking for a forum full of active developers to help you?
So if you want to:
➡️ Get answers for your development issues
➡️ Help others
➡️ Write an article
➡️ Get rewarded for your active participation
Then this place is just for you and it is 100% FREE.

Have an account? Sign In


Have an account? Sign In Now

Sign In

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

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

OrclQA.Com

OrclQA.Com Logo OrclQA.Com Logo
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Blog
  • New Questions
  • Tutorials
    • Oracle
    • Oracle Apex
    • Python
  • Tags
  • Users
  • Badges & Points
  • About
Home/foreign-key

Discy Latest Questions

Ana
Ana

Ana

  • 12 Questions
  • 17 Answers
  • 0 Best Answers
  • 91 Points
View Profile
  • 0
AnaProfessional
Asked: April 6, 2021

Inserting Foreign Key into table with trigger

  • 0

Hello 🙂 I have created forms in which the user can enter data. With collections the information is saved and will be inserted in the corresponding tables after the forms are submitted. Now one column in the table has remained empty and I am not sure how to solve it in APEX. Namely, the table has a foreign key to another table. But the ID of this table is generated only after submitting the forms. Can I solve it, for example, with a trigger that then enters the foreign key into the table after the forms are submitted? Would it be an after insert trigger like this: CREATE OR REPLACE TRIGGER INSERT_FK AFTER INSERT ON TBL1 FOR EACH ROW begin INSERT INTO TBL2 VALUES (:NEW.ID); EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.put_line (TO_CHAR (SQLERRM (-20299))); WHEN OTHERS THEN DBMS_OUTPUT.put_line (TO_CHAR (SQLERRM (-20298))); end; or is there another better solution for this?  

foreign-keyoracle apextrigger
  • 3
  • 66
  • 0
Answer

Sidebar

Ask Question
Write a Post

Recent Blog Posts

  • Vinish

    Oracle Apex - Display External File in Region

  • Vinish

    Oracle PL/SQL Download BLOB File to Disk

  • Vinish

    Oracle Convert External File to BLOB

  • Vinish

    Oracle Apex Calendar Example

  • Vinish

    Oracle Apex - Open Modal Dialog Page Using JavaScript

Explore

  • Home
  • Blog
  • New Questions
  • Tutorials
    • Oracle
    • Oracle Apex
    • Python
  • Tags
  • Users
  • Badges & Points
  • About

© 2021 OrclQA.Com. All Rights Reserved. Privacy Policy