Create Trigger to insert records from one table to another

I created the below trigger to move data from one table to another after records have been inserted from another table to that table. What I need done is that each time records have been inserted into TEST_TBL, one of these actions codes should be implimented: U-update, N-insert, D-delete and inserted into TEST_TBL1. But each time I run the script, I get bunch of errors. Please see the script below: - Your help will be appreciated.
create or replace
trigger POWER_tr
after update or insert or delete ON test_tbl
for each row
begin
if updating then
insert into test_tbl1
(idx, mke, ctl, ori, nam, sex, rac, pob, dob, hgt, action_code, date_added
VALUES
(idx, mke, ctl, ori, nam, sex, rac, pob, dob, hgt, 'U', sysdate);
ELSif INSERTING then
insert insert into test_tbl1
(idx, mke, ctl, ori, nam, sex, rac, pob, dob, hgt, action_code, date_added
VALUES
(idx, mke, ctl, ori, nam, sex, rac, pob, dob, hgt, 'N', sysdate);
ELSIF deleting then
insert into test_tbl1
(idx, mke, ctl, ori, nam, sex, rac, pob, dob, hgt, action_code, date_added
VALUES
(idx, mke, ctl, ori, nam, sex, rac, pob, dob, hgt, 'D', sysdate);
END IF;
END POWER_tr;
Thank you,
Albert Zaza
Edited by: azaza on Mar 1, 2009 4:14 PM

Hello
At the end of trigger show errors / and post what errors are you getting exactly?
Here is a simple example for your reference, this will save old values in history table; you can replace it with new values if that's what do you want.
CREATE OR REPLACE TRIGGER TRG_DU
   AFTER DELETE OR UPDATE
   ON EMPLOYEE    REFERENCING NEW AS New OLD AS Old
   FOR EACH ROW
DECLARE
BEGIN
   IF UPDATING
   THEN
      INSERT INTO employee_hist
        VALUES   ('UPDATE',
                  :OLD.empid,
                  :OLD.name,
                  :OLD.deptid);
   ELSIF DELETING
   THEN
      INSERT INTO employee_hist
        VALUES   ('UPDATE',
                  :OLD.empid,
                  :OLD.name,
                  :OLD.deptid);
   END IF;
EXCEPTION
   WHEN OTHERS
   THEN
      -- Consider logging the error and then re-raise
      RAISE;
END TRG_DU;
/Regards
Edited by: OrionNet on Mar 1, 2009 7:27 PM

Similar Messages

  • Trigger to copy records from one table to another;  ORA-04091:

    Hello,
    I'm trying to create a trigger that will move data from one table to another.
    I have two tables (Trial1, Trial2) Both of them contains the same attributes (code, c_index)
    I want to move each new record inserted in (code in Trial1) to (code in Trial2)
    This is my trigger:
    Create or replace trigger trg_move_to_trial2
    After insert on Trial1
    for each row
    begin
    insert into Trial2 (code)
    select :new.code from Trial1;
    end;It compiled, but when I insert new (code) record into (Trial1) it display this error:
    Error report:
    SQL Error: ORA-04091: table STU101.TRIAL1 is mutating, trigger/function may not see it
    ORA-06512: at "STU101.TRG_MOVE_TO_TRIAL2", line 3
    ORA-04088: error during execution of trigger 'STU101.TRG_MOVE_TO_TRIAL2'
    04091. 00000 - "table %s.%s is mutating, trigger/function may not see it"
    *Cause:    A trigger (or a user defined plsql function that is referenced in
    this statement) attempted to look at (or modify) a table that was
    in the middle of being modified by the statement which fired it.
    *Action:   Rewrite the trigger (or function) so it does not read that table.I know what does this error mean, but I don't how to fix the error.
    I tried to change the (After insert on Trial1) to be (Before insert on Trial1); that worked, but not in the right way. When I insert new value into (code in Trial1) and refreshed Trial2 table, as much as records I have in Trial 2 they will be duplicated. E.g.
    Trial2
    code
    111
    222
    333when I insert in Trial1
    Trial1
    code
    444
    Trial2 will be:
    code
    111
    222
    333
    444
    444
    444Can you please tell me how to solve this issue?
    Regards,
    Edited by: 1002059 on Apr 23, 2013 5:36 PM

    You should not select from Trial1 - you have the data already. Just insert that value.
    Create or replace trigger trg_move_to_trial2
    After insert on Trial1
    for each row
    begin
    insert into Trial2 (code)
    values (:new.code);
    end; regards,
    David

  • Insert record from one table to another with help of cursor

    Plz help!!!
    tables are - 1. country( country_id pk, country_name, region_id)
    2. a( country_id , country_name, region_id)
    table a data are
    1 a 1
    2 b 2
    3 c 3
    null d 4
    5 e 5
    6 f 6
    7 g 7
    insert record from table a to country table with help of cursor, insert all not null records.
    this procedure does not give correct result
    create or replace
    procedure amit as
    cursor c1 is select * from a;
    rw a%rowtype;
    begin
    open c1;
    fetch c1 into rw;
    while(c1%found)
    loop
    insert into countries values(rw.country_id,rw.country_name,rw.region_id);
    commit;
    fetch c1 into rw;
    if rw.country_id is null then
    fetch c1 into rw;
    end if;
    end loop;
    close c1;
    exception
    when others then
    dbms_output.put_line('exception name= '||rw.country_name);
    end;

    bluefrog wrote:
    You don't need cursor at all;
    create or replace procedure amit as
    begin
    insert into countries (Country_ID, Country_Name, Region_ID)
    (select a.Country_ID
    ,a.Country_Name
    ,a.Region_ID
    from a
    dbms_output.put_line('Rows inserted : ' || sql%rowcount);
    commit;
    end;
    Bluefrog you missed where clause. :)
       insert into countries (Country_ID, Country_Name, Region_ID)
       (select a.Country_ID
              ,a.Country_Name
              ,a.Region_ID
        from a
        where country_id is not null
    );

  • Inserting data from one table into another table using PL/SQL

    HI,
    I am trying to insert values from one table into another using PL procedure, the values I want to retrieve from the table riverside1 are charac_id and charac_type and insert these values into another table called riverside2 , the stored procedure zorgs_gorfs(x,y) accepts two parameters which are 2 charac_id's of d characters in riverside1 then using insert statements inserts these characters from riverside1 into riverside2.
    CREATE OR REPLACE PROCEDURE zorgs_gorfs(x IN NUMBER, y IN NUMBER) AS
         BEGIN
              INSERT INTO riverside2
                   (charac_id)
              VALUES
                   (x);
    INSERT INTO riverside2
                   (charac_id)
              VALUES
                   (y);
          END zorgs_gorfs;
    /This works but the problem im having is that when I also try to insert the charac_type as well as the charac_id it doesnt work below is the code:
    CREATE OR REPLACE PROCEDURE zorgs_gorfs(x IN NUMBER, y IN NUMBER) AS
         BEGIN
              INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id = x);
          END zorgs_gorfs;
    /can someone kindly sort me out

    modify this sql
    INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id = x);as
    INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id in ( x,y));But my suggestion would be consider revising your approach. It does not look that good.
    Thanks,
    karthick.

  • How to move records from one table to another?

    Is there a way to copy data and column names from one table to another table?
    I am trying to copy one production database table onto the development database. we are using Oracle 10g. I tried exporting to an xls file and importing to the other table but this needs to create destination table with the column names. Is there any better approach to achieve this?

    Hello,
    You can create dblink between production and dev and from dev just
    *1. create table mytable as select * from mytable@dblink;**2. Use of export/import or datapump*
    Example
       On prod
       exp username/password tables=mytable1,mytable2 file=mytableexport.dmp log=mytableexport.log
       On dev
       imp username/password tables=mytable1,mytable2 file=mytableexport.dmp log=mytableimport.log*3. Datapump*
    http://www.oracle-base.com/articles/10g/OracleDataPump10g.php
    *4. Generate csv formatted file and use sqlldr or external*
    External Table: http://www.adp-gmbh.ch/ora/misc/ext_table.html
    Sqlldr: http://www.psoug.org/reference/sqlloader.html
    Regards
    Edited by: OrionNet on Feb 13, 2009 6:52 PM

  • Insert data from one table to another.

    I have two tables - T1 & T2.
    T1 has columns A1,A2,A3,A4 (A1 & A2 are the primary keys)
    T2 has columns B1,B2,B3,B4 (B1 & B2 are the primary keys)
    I need to insert records from T1 to T2 with the conditions,
    - A1,A2,A3 will have the same record for the multiple records of A4.
    This is what I tried and got the error:-
    SQL> INSERT INTO nego_prop_supp (nps_supp_cd, nps_enq_no, nps_supp_resp, nps_cs_rank)
    2 SELECT DISTINCT tos_supp_code, tos_enq_no, tos_bid_seal_condn, csr_set_rank
    3 FROM tender_opening_supp, cs_rate
    4 WHERE tos_enq_no = '7211233E' AND
    5 tos_supp_code = csr_scd AND
    6 (tos_nature_of_bid = 'P' or tos_nature_of_bid = 'N') AND
    7 csr_set_rank IS NOT NULL;
    INSERT INTO nego_prop_supp (nps_supp_cd, nps_enq_no, nps_supp_resp, nps_cs_rank)
    ERROR at line 1:
    ORA-00001: unique constraint (DPURC.NEGO_PROP_SUPP_PK) violated
    You could understand that T1 consists (data from 'tender_opening_supp' & cs_rate), while T2 is nego_prop_supp.
    Pls. get me the soution for thi problem!!

    then this query
    SELECT DISTINCT tos_supp_code, tos_enq_no, tos_bid_seal_condn, csr_set_rank
    3 FROM tender_opening_supp, cs_rate
    4 WHERE tos_enq_no = '7211233E' AND
    5 tos_supp_code = csr_scd AND
    6 (tos_nature_of_bid = 'P' or tos_nature_of_bid = 'N') AND
    7 csr_set_rank IS NOT NULL
    8 and not exists (select nps_supp_cd from nego_prop_supp,tender_opening_supp where tos_supp_code
    = nps_supp_cd) ;
    have more than one tos_supp_code (the same any times) with any different value from tos_enq_no, tos_bid_seal_condn, csr_set_rank
    then anything is wrong or your key(on nego_prop_supp ) or the query retrieve rows that you not want
    the join is ok?
    why this join retrieve more than one value with the key of the other table? Do you need to filter any more? are you missing a filter?

  • How to pass selected records from one table to another ?

    Hi,
    In my view i have designed a table with certain records.  I need to pass only specific records of this table to another table which been designed in another view. Can anybody please give sum idea for this.
    Rgds
    Sudhanshu

    hi,
    Refer the below  code:
    1. I have selected some data from the table.
    2. The selected data is moved to some other internal table.
    3. Internal table is further binded to the node in which data is to be shown.
    data : lo_nd type ref to if_wd_context_node,
      lo_nd1 type ref to if_wd_context_node,
      lt_temp type wdr_context_element_set,
      wa_temp type ref to if_wd_context_element,
      ls_node1 type sflight,
      lt_node1 type STANDARD TABLE OF sflight.
    lo_nd = wd_context->get_child_node('CN_MAIN').  <CN_MAIN is my node>
      CALL METHOD lo_nd->get_selected_elements  <here selected data is moved to lt_temp>
       RECEIVING
           set = lt_temp.
      loop at lt_temp INTO wa_temp.
          CALL METHOD wa_temp->get_static_attributes
          IMPORTING
            static_attributes = ls_node1.       <Selected data in work area.>
        APPEND ls_node1 TO lt_node1.  < Data moved to internal Table>
        CLEAR ls_node1.
      ENDLOOP.
    Finally Internal table is binded to the node required.
      lo_nd1 = wd_context->get_child_node('CN_MAIN2').
      lo_nd1->bind_table( lt_node1 ).
    In your case , map this CN_MAIN2 with the Component Controller and from component controller you can access data in your second view also.
    I hope it helps.
    Thanx.
    Saurav.

  • Insert records from one table to other table

    Hi,
    I want to insert all the records from table 1 which are not in table 2 into table2
    o/p
    insert into table2
    select * from table1
    where a.id!=b.id;
    Please let me know is there any way that I can populate the records

    insert
      into table2
      select  *
        from  table1
        where id not in (
                         select  id
                           from  table2
                        );SY.

  • Inserting data from one table to another in different format

    Hello,
    I would like to know what I am doing wrong with the following code when I write a data from one another to another table in a different format. I am now learning PL/SQL and am using this as
    a test problem.
    I have a table called students which has the following columns:
    SQL> desc student
    Name Null? Type
    ----------- ----------------STUDENT_ID NUMBER(10)
    COURSE VARCHAR2(10)
    CREDITS NUMBER(10)
    I have created another table called new_student which has the following structure:
    SQL> desc new_student
    Name Null? Type
    ----------------------------------------- -------- ------------- STUDENT_ID NUMBER(10)
    COURSE VARCHAR2(30)
    CREDITS VARCHAR2(10)
    The data in the student table is:
    SQL> select * from student;
    STUDENT_ID COURSE CREDITS
    1 Science 4
    1 History 3
    2 Science 4
    2 History 3
    2 Math 4
    3 Sociology 3
    3 Psycology 3
    I want to store the STUDENT table data in NEW_STUDENT table as:
    STUDENT ID COURSES CREDITS
    1 Science/History 4/3
    2 Science/History/Math 4/3/4
    3 Sociology/Psycology 3/3
    This is my code:
    DECLARE
    -- Get all the student IDs
    CURSOR studentlist_cursor IS select distinct student_id from student ORDER BY student_id;
    -- Get the information for each student ID
    CURSOR courses_cursor(nstudentid number) is select course, credits from student where student_id=nstudentid;
    nIndex     INTEGER;
    pltcourses     DBMS_SQL.VARCHAR2_TABLE;
    pltcredits     DBMS_SQL.NUMBER_TABLE;
    newcourses varchar2(50);
    newcredits varchar2(10);
    BEGIN
    FOR student_rec IN studentlist_cursor
    LOOP
    nIndex:=0;
    -- Loop through each student ID from student_rec to get the
    --courses and creditsstudent ID
    FOR courses_rec in courses_cursor(student_rec.student_id)
         LOOP
         nIndex:=nIndex+1;
         pltcourses(nIndex):=courses_rec.course;
    -- Store the course data for each student ID in newcourses
    -- while doing so check if it is null or put a '/' between each course
    loop
    if newcourses is null then
    newcourses:=pltcourses(nIndex);
    else
    newcourses:=newcourses||'/'||pltcourses(nIndex);
    end if;
    end loop;
         pltcredits(nIndex):=courses_rec.credits;
    --Store credits data in variable newcredits
    --If the newcredits is not null then put a '/' between each credits
    loop
    if newcredits is null then
    newcredits:=pltcredits(nIndex);
    else
    newcredits:=newcredits||'/'||pltcredits(nIndex);
    end if;
    end loop;
    -- Insert student id, newcourses, newcredits into NEW_STUDENT
    INSERT INTO NEW_STUDENT
    (student_id ,
    course,
    credits
    ) VALUES
    (student_rec.student_id,
    newcourses,
    newcredits
    COMMIT;
    -- come out of the student id record and go to the next student --id record
    END LOOP;
    -- come out of the loop
    END LOOP;
    END;
    While doing so I get an error message:
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at line 23.
    The error is at the line:
    newcourses:=newcourses||'/'||pltcourses(nIndex);
    Can anyone help me by pointing out where the mistake is?
    Thank you for reading this long mail.
    Thank you.
    Rama.

    Hi dude
    there is lot of error in ur pl/sql.
    and u have created table new_student with columns
    student_id number(10),
    courses varchar2(30),
    credits number(10).
    first u need to modify ur table.
    student_id number(10),
    courses varchar2(30),
    credits varchar2(10).
    Now i am writing whole pl/sql block for u. it will work fine.
    DECLARE
    CURSOR studentlist_cursor IS select distinct student_id from student ORDER BY student_id;
    CURSOR courses_cursor(nstudentid number) is select course, credits from student
    where student_id = nstudentid;
    nIndex INTEGER;
    pltcourses DBMS_SQL.VARCHAR2_TABLE;
    pltcredits DBMS_SQL.NUMBER_TABLE;
    newcourses varchar2(50);
    newcredits varchar2(10);
    BEGIN
    FOR student_rec IN studentlist_cursor
    LOOP
    nIndex:=0;
    newcourses := null;
    newcredits := null;
    FOR courses_rec in courses_cursor(student_rec.student_id)
    LOOP
    nIndex:=nIndex+1;
    pltcourses(nIndex):=courses_rec.course;
    if newcourses is null then
    newcourses:=pltcourses(nIndex);
    else
    newcourses:=newcourses||'/'||pltcourses(nIndex);
    end if;
    pltcredits(nIndex):=courses_rec.credits;
    if newcredits is null then
    newcredits:=pltcredits(nIndex);
    else
    newcredits:=newcredits||'/'||pltcredits(nIndex);
    end if;
    end loop;
    INSERT INTO NEW_STUDENT
    (student_id,
    course) VALUES
    (student_rec.student_id,
    newcourses);
    END LOOP;
    END;
    and please revert back
    Regards
    Anil

  • Inserting Data from one table to another.

    I running a procedure that loops through a cursor which is about 80,000 records(tableA) and I am trying to insert into another table(tableX) based on the data from tableA. I have error trapped the hell out of this and made sure I am covering any holes. When looping through the cursor, it insert only about 28,000 records and then exits the loop. I have debugged this problem 100 different ways and for the life of me I can not figure why it just craps out at about this many records. I actually located where the looping stops and took the next 5 records from tableA, and inserted them manually and they went through normally, which tells me that there should have been no reason why the executable statements exited the loop. I checked my space and I have more than enough. I have debugged the code many different ways, but still no luck. It always exits the procedure after inserting about 28,000 records. When I was debugging the code, I noticed that it would exit because one of my select into...statements was returning a NO_DATA_FOUND error, but I trapped that error, and assigned a value to that variable if it was null.
    I am really getting frustrated with this. Can anyone offer some suggestions or advice as to what I can do to acheive my goal?

    post the cursor , loop , definition.
    while you fire the cursor, on table A for
    insert in table X, what happens on A and X ?
    it tries to make a commit every 100/1000 time,
    until close the cursor.
    table definition X, is similar to A ?
    alert_$SID.log what says ?
    pasquale rago

  • Inserting data from one table to another table....

    Hi DB Gurus,
    I have two table like table A in instance X and table B in instance Y. I want to insert data into table A from table B.If data in table B already exist in table A then that should not insert .if data In table B is not present in table A then that data should insert into table A.
    please help me to how insert this kind of data.I am trying to insert data by using "insert into" statement.Is it correct way or not. please let me know...
    Thanks in advance
    Best regards
    kumar

    Hey There,
    "I have two table like table A in instance X and table B in instance Y"
    Are these 2 instances sitting in the same db/rac.
    if so
    insert into x.a
    select * from y.b
    If the 2 instances are in different databases/racs then i think you can add a linked db into your script.- not 100% about that though.
    Dob

  • How to move record from one table to another one within same DB

    Hi, All
    What I'm trying to do here is move a specific record in table A to a history table called A_HIS. The only differece between these two tables are A_HIS has two extra fields that record the insertion time and user. All the rest of fields are the same.
    Since table A has more than 40 fields and it would be very time consuming to set every field and run an insert. Can anyone give me a suggestion please? Thanks a lot!
    kiki

    You could try something like this:
    INSERT INTO t1 (t1c1,t1c2, t1c3 ...) SELECT t2c1, t2c2, t2c3 ... FROM t2;Not sure how portable that is.

  • How to convert data when transferring from one table to another

    I have two tables and these are the structure of the tables
    create table E1(
    ID NUMBER
    ,NAME VARCHAR2(30)
    , DESIGNATION VARCHAR2(30)
    ,GENDER VARCHAR2(10));
    create table E2(
    ID NUMBER
    ,NAME VARCHAR2(30)
    , DESIGNATION VARCHAR2(3)
    ,GENDER NUMBER); Now I want to transfer records from one table to another using a master tables where data are compared because the datatypes in tables are different
    The first one is a gender table to match the gender and convert
    create table Gender(
    E1 varchar2(10),
    E2 number);The second is for the designation
    create table Designation(
    E1 varchar2(30),
    E2 varchar2(3);How to match and convert the data so that it can be transfered.

    Peeyush wrote:
    Can we do it with the help of a cursor.
    All SQL executed by the database are parsed as cursors and executed as cursors.
    I mean I have to insert data in bulk and I want to use cursor for it.The read and write (select and insert) are done by the SQL engine. The read part reads data and passes it to the write part that inserts the data.
    Now why would using PL/SQL and bulk processing make this faster? It will reside in-between the read part and the write part being done by the SQL engine.
    So the SQL engine reads the data. This then travels all the way to the PL/SQL engine as a bulk collect. PL./SQL then issues an insert (the write part to be done by the SQL engine). And now this very same data travels all the way from the PL/SQL engine to the SQL engine for insertion.
    So just how is this approach, where you add extra travel time to data, faster?
    and i want to commit the transaction after every 50 recordsWhy? What makes you think this is better? What makes you think you have a problem with not committing every 50 rows?

  • Insert old missing data from one table to another(databaase trigger)

    Hello,
    i want to do two things
    1)I want to insert old missing data from one table to another through a database trigger but it can't be executed that way i don't know what should i do in case of replacing old data in table_1 into table_2
    2)what should i use :NEW. OR :OLD. instead.
    3) what should i do if i have records exising between the two dates
    i want to surpress the existing records.
    the following code is what i have but no effect occured.
    CREATE OR REPLACE TRIGGER ATTENDANCEE_FOLLOWS
    AFTER INSERT ON ACCESSLOG
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    V_COUNT       NUMBER(2);
    V_TIME_OUT    DATE;
    V_DATE_IN     DATE;
    V_DATE_OUT    DATE;
    V_TIME_IN     DATE;
    V_ATT_FLAG    VARCHAR2(3);
    V_EMP_ID      NUMBER(11);
    CURSOR EMP_FOLLOWS IS
    SELECT   EMPLOYEEID , LOGDATE , LOGTIME , INOUT
    FROM     ACCESSLOG
    WHERE    LOGDATE
    BETWEEN  TO_DATE('18/12/2008','dd/mm/rrrr') 
    AND      TO_DATE('19/12/2008','dd/mm/rrrr');
    BEGIN
    FOR EMP IN EMP_FOLLOWS LOOP
    SELECT COUNT(*)
    INTO  V_COUNT
    FROM  EMP_ATTENDANCEE
    WHERE EMP_ID    =  EMP.EMPLOYEEID
    AND    DATE_IN   =  EMP.LOGDATE
    AND    ATT_FLAG = 'I';
    IF V_COUNT = 0  THEN
    INSERT INTO EMP_ATTENDANCEE (EMP_ID, DATE_IN ,DATE_OUT
                                ,TIME_IN ,TIME_OUT,ATT_FLAG)
         VALUES (TO_NUMBER(TO_CHAR(:NEW.employeeid,99999)),
                 TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'),       -- DATE_IN
                 NULL,
                 TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'),      -- TIME_IN
                 NULL ,'I');
    ELSIF   V_COUNT > 0 THEN
    UPDATE  EMP_ATTENDANCEE
        SET DATE_OUT       =  TO_DATE(:NEW.LOGDATE,'dd/mm/rrrr'), -- DATE_OUT,
            TIME_OUT       =   TO_DATE(:NEW.LOGTIME,'HH24:MI:SS'), -- TIME_OUT
            ATT_FLAG       =   'O'
            WHERE EMP_ID   =   TO_NUMBER(TO_CHAR(:NEW.employeeid,99999))
            AND   DATE_IN <=  (SELECT MAX (DATE_IN )
                               FROM EMP_ATTENDANCEE
                               WHERE EMP_ID = TO_NUMBER(TO_CHAR(:NEW.employeeid,99999))
                               AND   DATE_OUT IS NULL
                               AND   TIME_OUT IS NULL )
    AND   DATE_OUT  IS NULL
    AND   TIME_OUT IS NULL  ;
    END IF;
    END LOOP;
    EXCEPTION
    WHEN OTHERS THEN RAISE;
    END ATTENDANCEE_FOLLOWS ;
                            Regards,
    Abdetu..

    INSERT INTO SALES_MASTER
       ( NO
       , Name
       , PINCODE )
       SELECT SALESMANNO
            , SALESMANNAME
            , PINCODE
         FROM SALESMAN_MASTER;Regards,
    Christian Balz

  • How to insert records with LONG RAW columns from one table to another

    Does anybody know how to use subquery to insert records with columns of LONG RAW datatype from one table to another? Can I add a WHERE clause in the subquery statement? Thanks.

    Insert into ... Select statements are not supported for long or long raw. You will have to either use PL/SQL or convert your long raw to blobs.

Maybe you are looking for

  • Ipod touch second gen not charging or connecting to ITunes / Computer?

    I have an Ipod Touch second generation about two or three years old that has not been charged for a few eeks - tried to charge and reconnect to Computer / Itunes and it will not charge or be recognised on the Computer / ITunes - can anyone help?

  • Problems with icloud syncing contacts on 2 iphones

    I have 2 iphone4's (ios 5.0.1) registered to the same Apple ID email account, both obviously with different contacts lists. As I understand it, the only way to add new contacts to your list now is to turn on icloud for contacts but when the iphones s

  • Help!! I don't know how to fix this.

    My Mail account seems to have gone cooky. I tried to send an e-mail with a 14mb attachment and it spent 5min trying to send it. I then quit mail, and relaunched and now it is in my outbox, but I can't get it to delete or send it. What should I do? I

  • AR Reconciliation report

    Hi all I have submitted AR reconciliation report and it shows an Difference of around 6000 . How to trouble shoot to make the difference to Zero ?

  • Sending Purchase order outbound thro IDoc

    We have a scenario to send Purchase order in Idoc format. I have created a Distribution model, Partner profile and change pointer for msg type ORDERS and Global change pointer are activated. When I execute the program RBDMIDOC for msg type ORDERS, I