1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How To Insert Request Id into custom table?

Discussion in 'Oracle Apps Technical' started by jagadekara, Apr 7, 2014.

  1. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Hi Viewers,
    I am running Journal Entry Reserve Ledger Report Many times a day in Fixed Assets.

    So what I need is, I have a custom table xx_tab which have request_id column. After running that report I need to insert request_id of that program into xx_tab table. I don't want to modify that standard report, Need to handle with Trigger. So kindly expose your ideas.
     
  2. sambuduk

    sambuduk Forum Advisor

    Messages:
    242
    Likes Received:
    73
    Trophy Points:
    455
    Location:
    Hyderabad , Telangana
    Hi Jagadekar ,

    you can use fnd_global.conc_request_id in the trigger.

    Regards
    Sambasiva Reddy.K
     
  3. krasnoslobodtsev_si

    krasnoslobodtsev_si Forum Genius

    Messages:
    626
    Likes Received:
    129
    Trophy Points:
    810
    Location:
    Russian Federation
    Hi.
    To use the trigger...
    Simple example :

    Code (SQL):

    DROP SEQUENCE s_xx_tst;
    DROP TABLE xx_tst purge;
    DROP TABLE test1 purge;
    CREATE TABLE test1
    (id INT PRIMARY KEY,
     report varchar2(100)
    );
    CREATE SEQUENCE s_xx_tst;
    CREATE TABLE xx_tst
    (
      id INT,
      request_id INT CONSTRAINT fk_test1_id  REFERENCES test1(id)
    );
    CREATE TRIGGER trg_test1
    after INSERT ON test1
    FOR each ROW
    BEGIN
        INSERT INTO xx_tst VALUES(s_xx_tst.NEXTVAL,:NEW.id);
    END;        
    /

    INSERT INTO test1 VALUES(1,'Test-1');
    INSERT INTO test1 VALUES(2,'Test-2');
    INSERT INTO test1 VALUES(3,'Test-3');
    commit;
    SELECT * FROM xx_tst;
     
     
  4. jagadekara

    jagadekara Forum Guru

    Messages:
    1,126
    Likes Received:
    145
    Trophy Points:
    1,805
    Location:
    Pulivendula
    Thanks Sambasiva Reddy.K I got it.

    And

    Hi Sergey ,
    I know how to create trigger. I just want to know how to insert request_id.

    Any how thanks for reply.