Reg. dateblock Insertion

Hello Everyone ,
My form is having EMP block.That is database data block.
EMP - Multirecord Block - Database Block.
Whenever i inserted records into EMP block , the records are commited into EMP table.
For the below condition , i dont want to insert records into EMP.
IF ctrl.check = 'Y' THEN
Insert Into EMP
ELSE
Null;
END IF;
How can i handle this?
If i entered 3 records in the multirecord block means , i need to insert only 2 records into EMP table.The remaining 1 records shd not be inserted.

Also you posted the partial description. This is the complete one...
INSERT_RECORD built-in
Description
When called from an On-Insert trigger, inserts the current record into the database during Post and
Commit Transactions processing. This built-in is included primarily for applications that will run against
a non-ORACLE datasource.
Syntax
PROCEDURE INSERT_RECORD;
Built-in Type restricted procedure
Enter Query Mode no
Parameters
none
INSERT_RECORD restrictions
Valid only in an On-Insert trigger.
INSERT_RECORD examples
** Built-in: INSERT_RECORD
** Example : Perform Form Builder standard insert processing
** based on a global flag setup at startup by the
** form, perhaps based on a parameter.
** trigger: On-Insert
BEGIN
** Check the global flag we setup at form startup
IF :Global.Using_Transactional_Triggers = ’TRUE’ THEN
User_Exit(’my_insrec block=EMP’);
** Otherwise, do the right thing.
ELSE
Insert_Record;
END IF;
END;-Ammad

Similar Messages

  • REG : Date insertion in RFC

    HI All,
    I am facing problem in inserting the date into RFC from webdynpro java.
    Actually BAPI can accept teh date only in sql format and i have taken it as sql only and i am sending it direct as 2009-08-31 ,but its not going into backend.
    When i tried to excute rfc then ,i came to know that it can accept only 31082009 format.
    i tried to fromat and tehn send it but it would be string format so bapi is not acceptiong in webdynpro itself.
    Kindly,Advise me how to pass date .
    Regards,
    Anu

    hi
    please check the code you are using to insert  the data to the bapi  , as there should not be
    any problem when the date format is of sql.date type  , but in the webdynpro when you use the date it should
    also be of same data type , else there will be data type compatability problem ,
    check the code you are using to insert the data to the rfc ,

  • Reg Table Insertion

    Hi Friends,
    I developed badi in me59 which updates po in ztable given statement like this
      but in  ztable updating with empt line item  first  then second line item value filling.
    so please rectify code.
    FUNCTION Z_INSERTPO.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(IM_EKKO) TYPE  EKKO
    *"  EXPORTING
    *"     REFERENCE(EBELN) TYPE  EKKO-EBELN
    *Tables: zlogtpo.
    zlogtpo-ebeln = IM_EKKO-ebeln.
    INSERT zlogtpo.
    ENDFUNCTION.
    Thanks

    Hello,
    Change the code like this:
    *"*"Local Interface:
    *" IMPORTING
    *" REFERENCE(IM_EKKO) TYPE EKKO
    *" EXPORTING
    *" REFERENCE(EBELN) TYPE EKKO-EBELN
    *Tables: zlogtpo.
    data: wa_logtpo like zlogtpo.  " Check Here
    wa_logtpo-ebeln = IM_EKKO-ebeln.  " Check Here
    modify  zlogtpo from wa_logtpo.         " Check Here
    ENDFUNCTION.
    REgards,
    Vasanth

  • Reg : first inserted record in a table

    Hello all,
    Could any of you help me in writing a query to get the first
    inserted record into a table.
    Suppose I've the following table :
    my_table : structure
    Name Null? Type
    ID NOT NULL NUMBER
    Ive inserted value 20 into the table first, and then inserted
    value 10. I want to retrieve the first inserted record with
    value 20. How do I write the query for that ??????
    Awaiting for the reply,
    Thanks in Advance...
    Srini

    One small disagreement with Andrew's posting, but
    rownum is assigned to rows after they have been identified
    as part of the result set, but before the ORDER BY is
    applied. Hence the two queries ...
    select * from my_table
    where rownum = 1
    order by id ASC
    ... and ...
    select * from my_table
    where rownum = 1
    order by id DESC
    ... will probably return the same result.
    However in neither case is the result guaranteed to be the
    first inserted row.
    If you had created a table very recently, and it had only a
    single extent, you could get the first row of the first block of
    that extent with ...
    select * from my_table where rowid =
    (select min(rowid) from my_table)
    ... but as Andrew says, the only way to do the job properly is
    to timestamp the rows as they are inserted. Anything else
    would only be of theoretical interest.

  • Add checkboxes

    Hi,
    (Forms 6i, Database 10g)
    I have a database block say Employees, having fields emp_name,job_id and salary.
    Now i want add checkboxes corresponding to each row of the employees table.
    and then i need to update the records in employees table for all the records with checkbox checked property true.
    Pls help

    Check the below thread.
    Reg. dateblock Insertion
    The procedure is same just you have to use ON-UPDATE and instead of INSERT_RECORD built-in you will use UPDATE_RECORD in ON-UPDATE trigger.
    -Ammad

  • How can i insert new updated values in a table??

    Hi ,
    Can any one suggest me is there any way to insert the recently added data from one table to another table where both the tables have the same structure.
    Suppose i have 10 rows in both table T1 and T2 and now if we add another 4 new rows in the table T2 .Can i update my table T2 w.r.t. T1 with these new row values.
    Remember both the 10 rows in the tables T1 and T2 are the same and the strucuture of the tables are also the same.
    please advice the way to achieve this and if then explain me how to achieve it?Looking forward for the response
    B.r
    debashis

    Hi shailendra and all experts,
    I thought of a more simple approach instead of going to the concept of stored procedure.But i am unable to do it on a scheduled basis like if i want this query to be run on a periodic basis i need to implement this sql query using a job.
    can u suggest how to do it..As far as i know we can include the sql query inside a job to be scheduled on a weekly basis.
    And also have a look at the sql i have written below it will insert all the extra row values of t2 into t1.please help me in scheduling it on a periodic basis .
    Looking forward for ur response .I am almost near the goal i need ur help ..
    reg
    debashis
    insert into t1 select distinct t2.apinumber,t2.wellname from t1,t2 where t2.apinumber NOT IN (select t1.apinumber from t1);

  • Issue in production

    1)WHEN EVER I DELETE A RECORD FROM MUL_TEST TABLE IT SHOULD RAISE A TRIGGER AND CALL A PROCEDURE THAT IS GIVEN BY ME .
    2 )FOR THAT DELETED RECORD IN THAT PROCEDURE FIRST IT SHOULD HAVE TO CHECK FOR ACCOUNTNO IN MUL_TEST TABLE WITH ACCOUNTNO IN REG TABLE (THE DELETED RECORD ONLY) IF IT IS THERE THEN NO ISSUE IF IT IS NOT THERE THEN IT HAS TO CHECK FOR MOBILE NUMBER IN MUL_TEST WITH REG TABLE IF IT IS ALSO NOT THERE THEN THAT PARTICULAR deleted RECORD HAVE TO BE INSERTED IN EMAILINFO TABLE(MESSAGE COLUMN) GIVEN BELOW
    Mul_test: TABLE
    SET DEFINE OFF;
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7369, 'SMITH', 'CLERK', 7902, TO_DATE('12/17/1980 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    800, NULL, 20, '123456', '8897136043');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7499, 'ALLEN', 'SALESMAN', 7698, TO_DATE('02/20/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1600, 300, 30, '123457', '8897136044');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7521, 'WARD', 'SALESMAN', 7698, TO_DATE('02/22/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1250, 500, 30, '123458', '8897136045');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7566, 'JONES', 'MANAGER', 7839, TO_DATE('04/02/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2975, NULL, 20, '123460', '8897136046');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7654, 'MARTIN', 'SALESMAN', 7698, TO_DATE('09/28/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1250, 1400, 30, '123461', '8897136047');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7698, 'BLAKE', 'MANAGER', 7839, TO_DATE('05/01/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2850, NULL, 30, '123462', '8897136048');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7782, 'CLARK', 'MANAGER', 7839, TO_DATE('06/09/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2450, NULL, 10, '123463', '8897136049');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7788, 'SCOTT', 'ANALYST', 7566, TO_DATE('12/09/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    3000, NULL, 20, '123464', '8897136050');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7839, 'KING', 'PRESIDENT', NULL, TO_DATE('11/17/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    5000, NULL, 10, '123465', '8897136051');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7844, 'TURNER', 'SALESMAN', 7698, TO_DATE('09/08/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1500, 0, 30, '123466', '8897136052');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7876, 'ADAMS', 'CLERK', 7788, TO_DATE('01/12/1983 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1100, NULL, 20, '123467', '8897136053');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7900, 'CLERK', 'CLERK', 7698, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    950, NULL, 30, '123468', '8897136054');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7902, 'FORD', 'ANALYST', 7566, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    3000, NULL, 20, '123469', '8897136055');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7934, 'MILLER', 'CLERK', 7782, TO_DATE('01/23/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1300, NULL, 10, '123470', '8897136056');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7369, 'SMITH', 'CLERK', 7902, TO_DATE('12/17/1980 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    800, NULL, 20, '654321', '8897136043');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7499, 'ALLEN', 'SALESMAN', 7698, TO_DATE('02/20/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1600, 300, 30, '654322', '8897136044');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7521, 'WARD', 'SALESMAN', 7698, TO_DATE('02/22/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1250, 500, 30, '654323', '8897136045');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7566, 'JONES', 'MANAGER', 7839, TO_DATE('04/02/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2975, NULL, 20, '654324', '8897136046');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7654, 'MARTIN', 'SALESMAN', 7698, TO_DATE('09/28/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1250, 1400, 30, '654325', '8897136047');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7698, 'BLAKE', 'MANAGER', 7839, TO_DATE('05/01/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2850, NULL, 30, '654326', '8897136048');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7782, 'CLARK', 'MANAGER', 7839, TO_DATE('06/09/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2450, NULL, 10, '654327', '8897136049');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7788, 'SCOTT', 'ANALYST', 7566, TO_DATE('12/09/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    3000, NULL, 20, '654328', '8897136050');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7839, 'KING', 'PRESIDENT', NULL, TO_DATE('11/17/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    5000, NULL, 10, '654329', '8897136051');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7844, 'TURNER', 'SALESMAN', 7698, TO_DATE('09/08/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1500, 0, 30, '654330', '8897136052');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7876, 'ADAMS', 'CLERK', 7788, TO_DATE('01/12/1983 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1100, NULL, 20, '654331', '8897136053');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7900, 'CLERK', 'CLERK', 7698, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    950, NULL, 30, '654332', '8897136054');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7902, 'FORD', 'ANALYST', 7566, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    3000, NULL, 20, '654333', '8897136055');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7934, 'MILLER', 'CLERK', 7782, TO_DATE('01/23/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1300, NULL, 10, '654334', '8897136056');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7499, 'ALLEN', 'SALESMAN', 7698, TO_DATE('02/20/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1600, 300, 30, '123457', '8897136044');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7521, 'WARD', 'SALESMAN', 7698, TO_DATE('02/22/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1250, 500, 30, '123458', '8897136045');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7654, 'MARTIN', 'SALESMAN', 7698, TO_DATE('09/28/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1250, 1400, 30, '1', '9440320402');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7698, 'BLAKE', 'MANAGER', 7839, TO_DATE('05/01/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2850, NULL, 30, '2', '9440320403');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7844, 'TURNER', 'SALESMAN', 7698, TO_DATE('09/08/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1500, 0, 30, '3', '9440320404');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7900, 'CLERK', 'CLERK', 7698, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    950, NULL, 30, '4', '9440320405');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7499, 'ALLEN', 'SALESMAN', 7698, TO_DATE('02/20/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1600, 300, 30, '5', '9440320406');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7521, 'WARD', 'SALESMAN', 7698, TO_DATE('02/22/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1250, 500, 30, '6', '9440320407');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7654, 'MARTIN', 'SALESMAN', 7698, TO_DATE('09/28/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1250, 1400, 30, '7', '9440320408');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7698, 'BLAKE', 'MANAGER', 7839, TO_DATE('05/01/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2850, NULL, 30, '8', '9440320409');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7844, 'TURNER', 'SALESMAN', 7698, TO_DATE('09/08/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1500, 0, 30, '8', '9440320410');
    Insert into TEST.MUL_TEST
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7900, 'CLERK', 'CLERK', 7698, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    950, NULL, 30, '9', '9440320411');
    COMMIT;
    REG TABLE:
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7369, 'SMITH', 'CLERK', 7902, TO_DATE('12/17/1980 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    800, NULL, 20, '123456', '8897136043');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7499, 'ALLEN', 'SALESMAN', 7698, TO_DATE('02/20/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1600, 300, 30, '123457', '8897136044');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7521, 'WARD', 'SALESMAN', 7698, TO_DATE('02/22/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1250, 500, 30, '123458', '8897136045');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7566, 'JONES', 'MANAGER', 7839, TO_DATE('04/02/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2975, NULL, 20, '123460', '8897136046');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7654, 'MARTIN', 'SALESMAN', 7698, TO_DATE('09/28/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1250, 1400, 30, '123461', '8897136047');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7698, 'BLAKE', 'MANAGER', 7839, TO_DATE('05/01/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2850, NULL, 30, '123462', '8897136048');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7782, 'CLARK', 'MANAGER', 7839, TO_DATE('06/09/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2450, NULL, 10, '123463', '8897136049');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7788, 'SCOTT', 'ANALYST', 7566, TO_DATE('12/09/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    3000, NULL, 20, '123464', '8897136050');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7839, 'KING', 'PRESIDENT', NULL, TO_DATE('11/17/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    5000, NULL, 10, '123465', '8897136051');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7844, 'TURNER', 'SALESMAN', 7698, TO_DATE('09/08/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1500, 0, 30, '123466', '8897136052');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7876, 'ADAMS', 'CLERK', 7788, TO_DATE('01/12/1983 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1100, NULL, 20, '123467', '8897136053');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7900, 'CLERK', 'CLERK', 7698, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    950, NULL, 30, '123468', '8897136054');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7902, 'FORD', 'ANALYST', 7566, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    3000, NULL, 20, '123469', '8897136055');
    Insert into TEST.REG
    (EMPNO, ENAME, JOB, MGR, HIREDATE,
    SAL, COMM, DEPTNO, ACCOUNTNUMBER, MOBILENUMBER)
    Values
    (7934, 'MILLER', 'CLERK', 7782, TO_DATE('01/23/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1300, NULL, 10, '123470', '8897136056');
    COMMIT;
    TRIGGER CREATED BY ME:
    CREATE OR REPLACE TRIGGER TEST AFTER DELETE ON MUL_TEST
    CALL Test_Nagendra
    CREATE TABLE TEST.MUL_TEST
    EMPNO NUMBER(4),
    ENAME VARCHAR2(10 BYTE),
    JOB VARCHAR2(9 BYTE),
    MGR NUMBER(4),
    HIREDATE DATE,
    SAL NUMBER(7,2),
    COMM NUMBER(7,2),
    DEPTNO NUMBER(2),
    ACCOUNTNUMBER VARCHAR2(20 BYTE),
    MOBILENUMBER VARCHAR2(20 BYTE)
    CREATE TABLE TEST.REG
    EMPNO NUMBER(4) NOT NULL,
    ENAME VARCHAR2(10 BYTE),
    JOB VARCHAR2(9 BYTE),
    MGR NUMBER(4),
    HIREDATE DATE,
    SAL NUMBER(7,2),
    COMM NUMBER(7,2),
    DEPTNO NUMBER(2),
    ACCOUNTNUMBER VARCHAR2(20 BYTE),
    MOBILENUMBER VARCHAR2(20 BYTE)
    CREATE TABLE TEST.EMAILINFO
    MESSAGE VARCHAR2(1000 BYTE)
    );

    914547 wrote:
    2 )FOR THAT DELETED RECORD IN THAT PROCEDURE FIRST IT SHOULD HAVE TO CHECK FOR ACCOUNTNO IN MUL_TEST TABLE WITH ACCOUNTNO IN REG TABLE (THE DELETED RECORD ONLY) IF IT IS THERE THEN NO ISSUE IF IT IS NOT THERE THEN IT HAS TO CHECK FOR MOBILE NUMBER IN MUL_TEST WITH REG TABLE IF IT IS ALSO NOT THERE THEN THAT PARTICULAR deleted RECORD HAVE TO BE INSERTED IN EMAILINFO TABLE(MESSAGE COLUMN) GIVEN BELOW Isn't that just an "on delete cascade" ?

  • How can i set "new identity profile" in a new tab?

    I need to configure the browser to accept "new ientity profile" when I open a new tab.

    Hi shailendra and all experts,
    I thought of a more simple approach instead of going to the concept of stored procedure.But i am unable to do it on a scheduled basis like if i want this query to be run on a periodic basis i need to implement this sql query using a job.
    can u suggest how to do it..As far as i know we can include the sql query inside a job to be scheduled on a weekly basis.
    And also have a look at the sql i have written below it will insert all the extra row values of t2 into t1.please help me in scheduling it on a periodic basis .
    Looking forward for ur response .I am almost near the goal i need ur help ..
    reg
    debashis
    insert into t1 select distinct t2.apinumber,t2.wellname from t1,t2 where t2.apinumber NOT IN (select t1.apinumber from t1);

  • Convert letters into numbers

    I need to write a method that converts letters from a word into a number according to the telephone buttons.
    I figured I was at a good start by putting the string of the word into a character array, but how would I assign each of those letters to its corresponding number?
    Thanks in advance.

    changes to code that fills the hashmap. more concise (less interpretable)
    import java.util.HashMap;
    import java.util.Map;
    class HashMapTester2
        private Map<Character, Integer> phoneHash;
        // constructor
        // for converting alphabetical characters to numbers based on the
        // phone dialing pad.
        public HashMapTester2()
            phoneHash = new HashMap<Character, Integer>();
            fillMap();
        private void fillMap()
            for (char myChar = 'a'; myChar <= 'z'; myChar++)
                int distanceFrom_a = (int)(myChar - 'a');
                if (myChar > 'r') // 's' hangs back w/ the pqr group.
                    distanceFrom_a -= 1;
                if (myChar > 'y')  // 'z' hangs back w/ the wyz group.
                    distanceFrom_a -= 1;
                // 2 is due to the numbers starting at 2
                // 3 is due to the letters being grouped in 3's, all sharing
                // the same number.
                int number = (int)(2 + (distanceFrom_a) / 3);
                phoneHash.put(myChar, number);  // insert reg char
                // insert uppercase version, same number
                phoneHash.put(Character.toUpperCase(myChar), number);
        // convert string to a long number based on results of
        // the string's characters run through the hashmap
        public long convertStr(String s) throws IndexOutOfBoundsException
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < s.length(); i++)
                char myChar = s.charAt(i);
                if ((myChar >= 'a' && myChar <= 'z') || (myChar >= 'A' && myChar <= 'Z'))
                    sb.append(phoneHash.get(myChar));   
                else
                    throw new IndexOutOfBoundsException();
            return Long.valueOf(sb.toString());
        public static void main(String[] args)
            HashMapTester2 hmt = new HashMapTester2();
            System.out.println(hmt.convertStr("aaa"));
            System.out.println(hmt.convertStr("What"));
            System.out.println(hmt.convertStr("the"));
            System.out.println(hmt.convertStr("heck"));
            System.out.println(hmt.convertStr("Fubar"));
            System.out.println(hmt.convertStr("Snafu"));
            System.out.println(hmt.convertStr("abcdefghijklm"));
            System.out.println(hmt.convertStr("nopqrstuvwxyz"));
            System.out.println();
            System.out.println(hmt.convertStr("abc"));
            System.out.println(hmt.convertStr("def"));
            System.out.println(hmt.convertStr("ghi"));
            System.out.println(hmt.convertStr("jkl"));
            System.out.println(hmt.convertStr("mno"));
            System.out.println(hmt.convertStr("pqrs"));
            System.out.println(hmt.convertStr("tuv"));
            System.out.println(hmt.convertStr("wxyz"));
    }

  • Replacing all word occurances in JEditorPane

    Hello,
    I need to replace all the word occurances in a JEditorPane.
    I am doing it the following way
    say for example the doc has the following text.
    "The doument is having and was having the follwing text and will have more text ";
    String s1= "having";
    String replaceTxt "having having";
    int index1 = 0;
    try
    HTMLDocument doc = ( HTMLDocument )jeditorPane.getDocument();
    String source = doc.getText( index, doc.getLength() );
    catch( BadLocationException bl )
    for( int i=0; i<source.length(); i++ )
    int index = source.indexOf( s1, index1 );
    index1 = index + s1.length();
    jeditorPane1.select( index, index1 );
    jeditorPane1.replaceSelection( replaceText );
    jeditorPane1.revalidate();
    My problem is when i am inserting the same string twice i.e having having then it is going intoa loop.
    Anybody any ideas.
    Thanks.
    REg,
    suri

    start inserting from the end of string.
    First create an array of word offsets then start inserting from the end of this array.
    best regards
    Stas

  • Hi all--reg insert statement

    hi all ,
    i have a z table which consisits of 13 fields. i have to insert field from 4 internal tables. but the fields in z table is is not in order  as that of internal tables.
    when i try insert , it is showing error,,,, is there  any option to insert   into corresponding fields,,,,,,,
    regards
    karthi

    Hi,
    if the field names are same you can use the MOVE-CORRESPONDING, but instead of MOVE-CORRESPONDING, you can use the MOVE statment ..
    Here is the example:
    Read First table
    ZTABLE-FIELD3 = ITAB1-field3 .
    ZTABLE-FIELD4 = ITAB1-field4 .
    Read second internal table
    ZTABLE-FIELD2 = ITAB2-field2 .
    ZTABLE-FIELD5 = ITAB2-field5 .
    Read Third internal table
    ZTABLE-FIELD1 = ITAB3-field1 .
    ZTABLE-FIELD6 = ITAB3-field6 .
    INSERT ZTABLE.
    Regards
    Sudheer

  • How to Insert the Text in Selected Text Frame-Reg.

    Dear all,
    I am using the SnipperRunner - SDK, and create the TextFrame, but I can't insert the Text in the Particular Frame. so please give me the soultions,
    (*) Create TextFrame is ok,
    (*) Select TextFrame is also ok,
    (*) now, my Query ->
    How to Insert the Text in the Selected Frame?. (or)
    How to Link the Selectable Frame and my Text.? (or)
    How come to know the TextFrame is select?.
    Please any one can suggest me through the Coding....I will appreciate you...
    Thanks & Regards,
    T.R.Harihara SudhaN

    Hi,
    you have to get the TextModel associated with the textframe. Once you got that, ITextModel has an Insert()-method. You could also process kInsertTextCmdBoss - there are quite a few examples around. I believe WriteFishPrice also inserts text into a frame, just as an example. Good luck ...
    Bernt

  • Reg-inserting Values to blob column

    Dear Gurus,
    I need clarification for this code.
    create table demo
    ( id        int primary key,
      theBlob    blob
    create or replace directory my_files as '/export/home/tkyte/public_html';
    declare
        l_blob    blob;
        l_bfile    bfile;
    begin
        insert into demo values ( 1, empty_blob() )
        returning theBlob into l_blob;
        l_bfile := bfilename( 'MY_FILES', 'aria.gif' );
        dbms_lob.fileopen( l_bfile );
        dbms_lob.loadfromfile( l_blob, l_bfile,
                                   dbms_lob.getlength( l_bfile ) );
        dbms_lob.fileclose( l_bfile );
    end;
    / 1) What value the l_blob variable will contain after returning clause
    2)If we load value to l_blob variable using dbms_lob.loadfromfile() procedure,will it automatically load that value in the demo table.
    Cheers,
    Jey

    The BLOB is store inside the database if that's what you mean.
    For outside storage (ie in the OS file system), you need a BFILE.
    Some precisions about the internal storage though.
    Each LOB is associated with a segment of type "LOBSEGMENT" that resides in the same tablespace as the table (at creation time).
    - LOB data can be stored "in-line" if its size is less than 4000 bytes and if the clause ENABLE STORAGE IN ROW is specified when creating table (that's the default).
    - Otherwise, data is stored in the lob segment ("out-of-line" storage).

  • Reg:Insert the record in another ztable

    Hi Experts,
                      My scenerio is that when a record is inserted from a program to a table i need to added the same values to another table which is on different server(ex: BW). Is it necessary to create events to do that because i don't need table maintainance generator or any other way.
    Regards,
    Vinoth

    Hi,
    In your case, you can do either of the following:
    1) Create RFC FM in other system (say, B) to update the Z table. (as suggested by Klaus)
    In SM59, maintain connection between your current system (say, system A) and the other system (B).
    In current system (A) program, call the RFC using destination keyword to update other system's (B) table.
    OR
    2) You can send IDOc to the other system and update the Z table (this may involve a lot of mapping and ALE configuration). Generally in SAP XI system, we map the fields with the sender system and update the records at the receiving end.
    Do let us know how you solved your problem.
    Regards,
    Saba

  • Reg: read excel column and insert into table.

    hi Friends,
          i wanted to read the data from Excel and insert into in my oracle tables.
          can you provide the link or example script.
        how to read the column value from excel and insert into table.
      please help.

    < unnecessary reference to personal blog removed by moderator >
    Here are the steps:
    1) First create a directory and grant read , write , execute to the user from where you want to access the flat files and load it.
    2) Write a generic function to load PIPE delimited flat files:
    CREATE OR REPLACE FUNCTION TABLE_LOAD ( p_table in varchar2,
    p_dir in varchar2 DEFAULT ‘YOUR_DIRECTORY_NAME’,
    P_FILENAME in varchar2,
    p_ignore_headerlines IN INTEGER DEFAULT 1,
    p_delimiter in varchar2 default ‘|’,
    p_optional_enclosed in varchar2 default ‘”‘ )
    return number
    is
    – FUNCTION TABLE_LOAD
    – PURPOSE: Load the flat files i.e. only text files to Oracle
    – tables.
    – This is a generic function which can be used for
    – importing any text flat files to oracle database.
    – PARAMETERS:
    – P_TABLE
    – Pass name of the table for which import has to be done.
    – P_DIR
    – Name of the directory where the file is been placed.
    – Note: The grant has to be given for the user to the directory
    – before executing the function
    – P_FILENAME
    – The name of the flat file(a text file)
    – P_IGNORE_HEADERLINES
    – By default we are passing 1 to skip the first line of the file
    – which are headers on the Flat files.
    – P_DELIMITER
    – Dafault “|” pipe is been passed.
    – P_OPTIONAL_ENCLOSED
    – Optionally enclosed by ‘ ” ‘ are been ignored.
    – AUTHOR:
    – Slobaray
    l_input utl_file.file_type;
    l_theCursor integer default dbms_sql.open_cursor;
    l_lastLine varchar2(4000);
    l_cnames varchar2(4000);
    l_bindvars varchar2(4000);
    l_status integer;
    l_cnt number default 0;
    l_rowCount number default 0;
    l_sep char(1) default NULL;
    L_ERRMSG varchar2(4000);
    V_EOF BOOLEAN := false;
    begin
    l_cnt := 1;
    for TAB_COLUMNS in (
    select column_name, data_type from user_tab_columns where table_name=p_table order by column_id
    ) loop
    l_cnames := l_cnames || tab_columns.column_name || ‘,’;
    l_bindvars := l_bindvars || case when tab_columns.data_type in (‘DATE’, ‘TIMESTAMP(6)’) then ‘to_date(:b’ || l_cnt || ‘,”YYYY-MM-DD HH24:MI:SS”),’ else ‘:b’|| l_cnt || ‘,’ end;
    l_cnt := l_cnt + 1;
    end loop;
    l_cnames := rtrim(l_cnames,’,');
    L_BINDVARS := RTRIM(L_BINDVARS,’,');
    L_INPUT := UTL_FILE.FOPEN( P_DIR, P_FILENAME, ‘r’ );
    IF p_ignore_headerlines > 0
    THEN
    BEGIN
    FOR i IN 1 .. p_ignore_headerlines
    LOOP
    UTL_FILE.get_line(l_input, l_lastLine);
    END LOOP;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    v_eof := TRUE;
    end;
    END IF;
    if not v_eof then
    dbms_sql.parse( l_theCursor, ‘insert into ‘ || p_table || ‘(‘ || l_cnames || ‘) values (‘ || l_bindvars || ‘)’, dbms_sql.native );
    loop
    begin
    utl_file.get_line( l_input, l_lastLine );
    exception
    when NO_DATA_FOUND then
    exit;
    end;
    if length(l_lastLine) > 0 then
    for i in 1 .. l_cnt-1
    LOOP
    dbms_sql.bind_variable( l_theCursor, ‘:b’||i,
    ltrim(rtrim(rtrim(
    regexp_substr(l_lastLine,’([^|]*)(\||$)’,1,i),p_delimiter),p_optional_enclosed),p_optional_enclosed));
    end loop;
    begin
    l_status := dbms_sql.execute(l_theCursor);
    l_rowCount := l_rowCount + 1;
    exception
    when OTHERS then
    L_ERRMSG := SQLERRM;
    insert into BADLOG ( TABLE_NAME, ERRM, data, ERROR_DATE )
    values ( P_TABLE,l_errmsg, l_lastLine ,systimestamp );
    end;
    end if;
    end loop;
    dbms_sql.close_cursor(l_theCursor);
    utl_file.fclose( l_input );
    commit;
    end if;
    insert into IMPORT_HIST (FILENAME,TABLE_NAME,NUM_OF_REC,IMPORT_DATE)
    values ( P_FILENAME, P_TABLE,l_rowCount,sysdate );
    UTL_FILE.FRENAME(
    P_DIR,
    P_FILENAME,
    P_DIR,
    REPLACE(P_FILENAME,
    ‘.txt’,
    ‘_’ || TO_CHAR(SYSDATE, ‘DD_MON_RRRR_HH24_MI_SS_AM’) || ‘.txt’
    commit;
    RETURN L_ROWCOUNT;
    end TABLE_LOAD;
    Note: when you run the function then it will also modify the source flat file with timestamp , so that we can have the track like which file was loaded .
    3) Check if the user is having UTL_FILE privileges or not :
    SQL> SELECT OWNER,
    OBJECT_TYPE
    FROM ALL_OBJECTS
    WHERE OBJECT_NAME = ‘UTL_FILE’
    AND OWNER =<>;
    If the user is not having the privileges then grant “UTL_FILE” to user from SYS user:
    SQL> GRANT EXECUTE ON UTL_FILE TO <>;
    4) In the function I have used two tables like:
    import_hist table and badlog table to track the history of the load and another to check the bad log if it occurs while doing the load .
    Under the same user create an error log table to log the error out records while doing the import:
    SQL> CREATE TABLE badlog
    errm VARCHAR2(4000),
    data VARCHAR2(4000) ,
    error_date TIMESTAMP
    Under the same user create Load history table to log the details of the file and tables that are imported with a track of records loaded:
    SQL> create table IMPORT_HIST
    FILENAME varchar2(200),
    TABLE_NAME varchar2(200),
    NUM_OF_REC number,
    IMPORT_DATE DATE
    5) Finally run the PLSQL block and check if it is loading properly or not if not then check the badlog:
    Execute the PLSQL block to import the data from the USER:
    SQL> declare
    P_TABLE varchar2(200):=<>;
    P_DIR varchar2(200):=<>;
    P_FILENAME VARCHAR2(200):=<>;
    v_Return NUMBER;
    BEGIN
    v_Return := TABLE_LOAD(
    P_TABLE => P_TABLE,
    P_DIR => P_DIR,
    P_FILENAME => P_FILENAME,
    P_IGNORE_HEADERLINES => P_IGNORE_HEADERLINES,
    P_DELIMITER => P_DELIMITER,
    P_OPTIONAL_ENCLOSED => P_OPTIONAL_ENCLOSED
    DBMS_OUTPUT.PUT_LINE(‘v_Return = ‘ || v_Return);
    end;
    6) Once the PLSQL block is been executed then check for any error log table and also the target table if the records are been successfully imported or not.

Maybe you are looking for

  • Refcursor return set in plsql in oracle 10.2.0.4.0 db -

    I am writing a function which returns the result set to front end application. it all works fine for existing rec but it returs bad/awkward message when non exiting rec is given... declare user_cur SYS_REFCURSOR; BEGIN OPEN user_cur FOR SELECT pwd, f

  • White Lines in SWF in firefox only

    *** LINK REMOVED *** It's easier to show than to describe. I've got this SIMPLE flash movie that I'm supposed to put on a site. it looks fine in IE. when I look at it in firefox, I get lines above/below the text...but only, apparently, on some backgr

  • Leaving room on Hard Disc for downloading Rental Movies.

    Using the Sync mode vs Streaming. How do you Sync music and playlists to the AppleTV and leave enough room for Rental Movie Downloans...need to save about 10 GB for HD movies. SUGGESTION: Seems like we need a selection on the Apple TV Summary page in

  • Sales value in credit mangement

    HI, i am working in Support project. The issue user raised was caluculating sales value in FD32 screen. I have ivistigated and found that there was no configuration maintanied for this customer in Automatic credit controal based on given credit contr

  • How to change domain name on Windows 2003 running Exchange 2007

    Hi all, I have a windows 2003 server running Exchange 2007.  I am wanting to rename the domain, however when I search the web for the process to perform a rename of the domain I see "The domain rename operation is not supported in Microsoft Exchange