Insert multiple column data into Another table using Trigger

  • create table test1 (col1 varchar2(10), col2 number)

    create table test2 (col3 number, time date)

    create table test2_audit (col4 number, col5 number)

    insert into test1 values(’test’,1)

    I have 3 tables :

    I have a data in test2 table

    during insertion of test1 table , col1 value of test1 table should be insert into col4 value of test_audit table and

    col3 value of test2 table should be insert into col5 value of test_audit table using triggers

    select * from test1_audit

    Thanks in Advance.

    Regards,

    Geetha.

  • That seems clear enough. So where do you need help, other than us doing all the work for you, free?

  • during insertion of test1 table, automatically insert the values into test_audit table using trigger.

    Thanks

  • What code have you written and were are getting stuck.

    I mean no offense but this seems like homework or exam question... way too basic for anyone with experience.

  • also, your example tables are all in Oracle syntax....a trigger in Oracle looks and behaves differently than SQL.

    Oracle is all row based, where SQL is set based.

    show us what you've done so far, and clarify what DBMS you are writing for.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply