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 8787573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:55:27+00:00 2026-06-13T21:55:27+00:00

I have a trigger like this CREATE TRIGGER `hrm_to_odm_user` AFTER INSERT ON `ohrm_user` FOR

  • 0

I have a trigger like this

 CREATE
 TRIGGER `hrm_to_odm_user` AFTER INSERT
 ON `ohrm_user`
 FOR EACH ROW BEGIN
  DECLARE _dep_id INTEGER;
        SELECT eeo_cat_code INTO _dep_id FROM hs_hr_employee WHERE emp_number = NEW.id;
  INSERT INTO zodm_user (id, username, password, department) VALUES (NEW.id, NEW.user_name, NEW.user_password, _dep_id);
    END

After inserting data to ohrm_user i fire the trigger to insert values to zodm_user

It works fine for everything else other than this field _dep_id which i select from another table named hs_hr_employee

I have gone thru this post

MySQL Trigger Update with select from another table

but it is not working for me

Thanks

  • 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-06-13T21:55:28+00:00Added an answer on June 13, 2026 at 9:55 pm

    Try something like this

    _dep_id = ID hs_hr_employee WHERE emp_number = NEW.id;

    Also use profiler to see what query its firing up

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one question regarding trigger. The scenario is like this Create Procedure begin
I have a trigger that looks something like this: create or replace TRIGGER cluster_check
I have a pg table like this: CREATE TABLE order_status_history ( order_id integer NOT
I have a trigger statement like this: CREATE TRIGGER update_customer_address UPDATE OF address ON
I have this piece of logic I would like to implement as a trigger,
I have a table trigger like below: CREATE OR REPLACE TRIGGER PAT_BUR_DOB_TRG BEFORE UPDATE
I'm new to triggers . I have table like this CREATE TABLE [dbo].[Positions]( [Id]
I have an INSERT statement that looks like this: INSERT INTO officer (officer_number, name,
hi i have a database with many tables and foreign keys like this CREATE
I have a table that simplified looks like this: create table Test ( ValidFrom

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.