Delete records from a table of forms

Oracle forms6i
Hai All

I use forms6i and my need is I have generated a forms and the output is displayed through tables and I need to delete all the records from the table of my forms when executing next time pls tell me

Concerning

Srikkanth.M

Hello

Please try something like that.

Begin
Delete From Master_Tbl Cascade;
forms_ddl('Commit');
End;

Sarah

Tags: Oracle Development

Similar Questions

  • Delete query to delete records from multiple tables

    All,

    I need a delete query that will delete the records from the tables. Please see the structure of the table & below
    CREATE TABLE TEMP1 (ID NUMBER(10),NAME VARCHAR2(40),CLASS VARCHAR2(40),COLLEGE VARCHAR2(40));
    CREATE TABLE TEMP2 (ID NUMBER(10),CITY VARCHAR2(40),STATE(40));
    
    INSERT INTO TEMP1 (ID, NAME,CLASS,COLLEGE) VALUES (1000,'SAM','CS','UNIV_1');
    INSERT INTO TEMP1 (ID, NAME,CLASS,COLLEGE) VALUES (2000,'RIO','CS','UNIV_1');
    INSERT INTO TEMP1 (ID, NAME,CLASS,COLLEGE) VALUES (3000,'CHRIS','CS','UNIV_1');
    INSERT INTO TEMP1 (ID, NAME,CLASS,COLLEGE) VALUES (4000,'ALEX','CS','UNIV_1');
    
    INSERT INTO TEMP2 (ID, CITY,STATE) VALUES (1000,'Auburn','NY');
    INSERT INTO TEMP2 (ID, CITY,STATE) VALUES (2000,'Ithaca','NY');
    INSERT INTO TEMP2 (ID, CITY,STATE) VALUES (3000,'Mount Vernon','NY');
    INSERT INTO TEMP2 (ID, CITY,STATE) VALUES (4000,'Port Jervis','NY');
    Now, I need to delete the records in these tables where the ID is '2000' by using a single delete query. Is this possible? This may be a newbie question. Help, please.

    "using a single request deletion. Is this possible?

    Nope.
    You can insert into multiple tables by using a single query, INSERT ALL job, but you cannot delete more than one table using a single query.

  • How to delete records from a table?

    It comes to my table structure:
    create table BILLS
    (
      bill_id    VARCHAR2(20),
      trx_no     VARCHAR2(20),
      item_code  VARCHAR2(3),
      amount     NUMBER,
      item_id    NUMBER,
      invoice_dt DATE
    )
    Here are some insert statements to populate the table. *(About a 100 of them, please Bear with me) *.
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104173960', '910873', '002', 432, 351, to_date('04-03-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104209800', '910873', '002', 432, 351, to_date('04-04-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104212747', '263156', '039', 230, 351, to_date('01-04-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104269414', '263156', '039', 230, 351, to_date('01-06-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104360446', '263156', '039', 230, 351, to_date('01-09-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104577673', '910873', '002', 432, 351, to_date('04-04-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104608668', '910873', '002', 432, 351, to_date('04-05-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104611586', '263156', '039', 230, 351, to_date('01-05-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104642560', '910873', '002', 432, 351, to_date('04-06-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104699154', '910873', '002', 432, 351, to_date('04-08-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104820820', '263156', '039', 230, 351, to_date('01-12-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104826028', '910873', '002', 432, 351, to_date('04-12-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104850631', '910873', '002', 432, 351, to_date('04-01-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104885554', '263156', '039', 230, 351, to_date('01-02-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104926901', '910873', '002', 432, 351, to_date('04-03-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104936656', '263156', '', 15, 247, null);
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104996320', '263156', '039', 230, 351, to_date('01-05-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105030104', '263156', '039', 230, 351, to_date('01-06-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105176803', '910873', '002', 432, 351, to_date('04-10-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105217998', '910873', '002', 432, 351, to_date('04-11-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105253306', '263156', '039', 230, 351, to_date('01-12-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105280152', '263156', '039', 230, 351, to_date('01-01-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105318072', '910873', '002', 432, 351, to_date('04-02-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105449712', '910873', '002', 432, 351, to_date('04-06-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105579048', '910873', '002', 432, 351, to_date('04-10-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105611201', '263156', '039', 230, 351, to_date('01-11-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105679991', '263156', '011', 196.56, 351, to_date('06-01-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105686749', '910873', '002', 432, 351, to_date('04-01-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105816473', '910873', '002', 432, 351, to_date('04-05-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105846525', '263156', '011', 230, 351, to_date('01-06-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105778111', '910873', '002', 432, 351, to_date('04-04-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104958496', '910873', '002', 432, 351, to_date('04-04-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105143695', '910873', '002', 432, 351, to_date('04-09-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104176755', '263156', '039', 230, 351, to_date('01-03-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104365552', '910873', '002', 432, 351, to_date('04-09-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104646837', '263156', '039', 230, 351, to_date('01-06-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104763596', '910873', '002', 432, 351, to_date('04-10-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104936656', '263156', '', 15, 247, null);
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105510930', '263156', '039', 230, 351, to_date('01-08-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104302780', '263156', '039', 230, 351, to_date('01-07-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104793590', '263156', '039', 230, 351, to_date('01-11-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104238583', '910873', '002', 432, 351, to_date('04-05-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105779115', '263156', '011', 230, 351, to_date('01-04-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104394481', '263156', '039', 230, 351, to_date('01-10-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105144934', '263156', '039', 230, 351, to_date('01-09-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105342823', '263156', '039', 230, 351, to_date('01-03-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105747780', '910873', '002', 432, 351, to_date('04-03-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105517258', '910873', '002', 432, 351, to_date('04-08-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105617909', '910873', '002', 432, 351, to_date('04-11-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104480711', '910873', '002', 432, 351, to_date('04-01-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105845480', '910873', '002', 432, 351, to_date('04-06-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105349031', '910873', '002', 432, 351, to_date('04-03-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105382599', '263156', '039', 230, 351, to_date('01-04-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104423263', '263156', '039', 230, 351, to_date('01-11-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104482370', '263156', '039', 230, 351, to_date('01-01-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104892872', '910873', '002', 432, 351, to_date('04-02-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105071771', '263156', '039', 230, 351, to_date('01-07-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105716829', '910873', '002', 432, 351, to_date('04-02-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105251149', '910873', '002', 432, 351, to_date('04-12-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105420465', '910873', '002', 432, 351, to_date('04-05-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105547036', '910873', '002', 432, 351, to_date('04-09-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105450806', '263156', '039', 230, 351, to_date('01-06-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105178143', '263156', '039', 230, 351, to_date('01-10-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105648407', '910873', '002', 432, 351, to_date('04-12-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105718070', '263156', '011', 230, 351, to_date('01-02-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104735083', '910873', '002', 432, 351, to_date('04-09-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105748707', '263156', '011', 230, 351, to_date('01-03-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104570555', '263156', '039', 230, 351, to_date('01-04-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105480249', '910873', '002', 432, 351, to_date('04-07-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104799512', '910873', '002', 432, 351, to_date('04-11-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105036878', '910873', '002', 432, 351, to_date('04-06-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105413781', '263156', '039', 230, 351, to_date('01-05-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105548204', '263156', '039', 230, 351, to_date('01-09-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104510445', '910873', '002', 432, 351, to_date('04-02-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104545120', '263156', '039', 230, 351, to_date('01-03-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104700608', '263156', '039', 230, 351, to_date('01-08-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104765006', '263156', '039', 230, 351, to_date('01-10-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105111984', '910873', '002', 432, 351, to_date('04-08-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105310993', '263156', '039', 230, 351, to_date('01-02-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105481415', '263156', '039', 230, 351, to_date('01-07-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105210719', '263156', '039', 230, 351, to_date('01-11-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105809981', '263156', '011', 230, 351, to_date('01-05-2011', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104328833', '910873', '002', 432, 351, to_date('04-08-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104511904', '263156', '039', 230, 351, to_date('01-02-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105278905', '910873', '002', 432, 351, to_date('04-01-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104421567', '910873', '002', 432, 351, to_date('04-11-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104851866', '263156', '039', 230, 351, to_date('01-01-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105649424', '263156', '039', 230, 351, to_date('01-12-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104729022', '263156', '039', 230, 351, to_date('01-09-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105070358', '910873', '002', 432, 351, to_date('04-07-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104299829', '910873', '002', 432, 351, to_date('04-07-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104920099', '263156', '039', 230, 351, to_date('01-03-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104266551', '910873', '002', 432, 351, to_date('04-06-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104994904', '910873', '002', 432, 351, to_date('04-05-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104910999', '263156', '', 15, 247, null);
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104241418', '263156', '039', 230, 351, to_date('01-05-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104960203', '263156', '039', 230, 351, to_date('01-04-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105381371', '910873', '002', 432, 351, to_date('04-04-2010', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104542458', '910873', '002', 432, 351, to_date('04-03-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104670160', '910873', '002', 432, 351, to_date('04-07-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105105026', '263156', '039', 230, 351, to_date('01-08-2009', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104392347', '910873', '002', 432, 351, to_date('04-10-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104451005', '910873', '002', 432, 351, to_date('04-12-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104453960', '263156', '039', 230, 351, to_date('01-12-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104671563', '263156', '039', 230, 351, to_date('01-07-2008', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('104331181', '263156', '039', 230, 351, to_date('01-08-2007', 'dd-mm-yyyy'));
    
    insert into BILLS (BILL_ID, TRX_NO, ITEM_CODE, AMOUNT, ITEM_ID, INVOICE_DT)
    values ('105580192', '263156', '039', 230, 351, to_date('01-10-2010', 'dd-mm-yyyy'));
    It comes to my select statement.
    SELECT 
           Trx_No,
           Item_Code,
           Amount,
           Item_Id,
           MAX(Invoice_Dt)
      FROM Bills
     GROUP BY 
              Trx_No,
              Item_Code,
              Amount,
              Item_Id
    I want to remove the lines that are extracted from my select statement. What is the best way to achieve this?

    SELECT query sets.

    She literally takes

    delete from bills
     where (Trx_No,Item_Code,Amount,Item_Id,Invoice_Dt) in (select Trx_No,Item_Code,Amount,Item_Id,MAX(Invoice_Dt)
                                                              FROM Bills
                                                             GROUP BY Trx_No,Item_Code,Amount,Item_Id
                                                           )
    

    Concerning

    Etbin

  • How to delete records from a table that has a composite unique key duplicate

    Hello
    I get the customer data from various sources in the staging of the table where I insert in the database table where the combination of two columns is considered as a unique key. But there is a possibility of duplicates. How to find duplicates in a SQL or pl/sql

    Thank you
    Manoi.

    Kassa,

    You can see the duplicates by using the following query...

    sql> select * from temp_rajesh;
    
          COL1       COL2 MESSAGE
    ---------- ---------- ------------------
           100        200 message
           100        200 message2
           300        400 message3
           400        500 message 4
    
    sql> select col1, col2, count(*)
      2     from temp_rajesh
      3       group by col1, col2
      4         having count(*) > 1;
    
          COL1       COL2   COUNT(*)
    ---------- ---------- ----------
           100        200          2
    

    -If in the case of duplicate records, you should see only the duplicates (according to some timestamp etc., you can use the functinon row_number analytic..)

      1  select col1, col2 from (
      2  select col1, col2,
      3         row_number() over (partition by col1, col2
      4                            order by message) rn
      5    from temp_rajesh)
      6*   where rn > 1
    sql> /
    
          COL1       COL2
    ---------- ----------
           100        200
    

    In the above example, I use message to order, you can replace it with activity_timestamp or the insertd_date according to your logic... when there are two records... one that you choose to duplicate.

    Thank you
    Rajesh.

    Published by: Rajesh Chamarthi on November 20, 2009 12:05 AM (added for example)

  • Deleting records from a table and trying to retrieve those

    Hello
    is it possible to recover the table deleted after validation of the track file, if so how? Once again I have to synchronize back to the database once the table is retrieved.

    Reverse GoldenGate utility.

    details on this forum.
    Reverse GoldenGate utility
    Golden Gate can be a lever to make point in time recovery for MySql?

  • Delete records from sys.aud$ stored procedure

    We have a stored procedure that attempts to move the records from the table of sys.aud$ to a history table (in order to keep sys.aud$ to a more reasonable size, I guess - full disclosure, I have not written this proc). Base flow is:
    Select count (*) in the number of lines of sys.aud$
    If {(rowcount > 1000)
    copy all rows in sys.aud$ in the history table
    remove from sys.aud$
    }

    I says this proc used to work perfectly in a troubled past (I'm new on the client) but now has not worked for a while. When we try to compile the proc, we get the error
    "table or view does not exist", and the line is the "deletion of sys.aud$. The line "select count (*) from sys.aud$ ' seems to cause no problems, but the proc does not compile as is. If I comment out the line "remove from sys.aud$", however, the proc compiles very well.

    Confusingly, if I log in as the same account that owns this proc, I can run both the count (*) select from sys.aud$ AND remove clauses sys.aud$ with no complaint at all (by modifying slightly to work with 1 single record at a time, of course), but I can't seem the same to compile in a stored proc.

    I guess that it is related permissions? Can someone point me to the permissions of the owner needs to be able to remove from sys.aud$ in a stored procedure? Or is there something else that needs to be done here? Pointers much appreciated.

    Thank you.

    956928 wrote:
    We have a stored procedure that attempts to move the records from the table of sys.aud$ to a history table (in order to keep sys.aud$ to a more reasonable size, I guess - full disclosure, I have not written this proc). Base flow is:
    Select count (*) in the number of lines of sys.aud$
    If (rowcount 1000 >) {}
    copy all rows in sys.aud$ in the history table
    remove from sys.aud$
    }

    I says this proc used to work perfectly in a troubled past (I'm new on the client) but now has not worked for a while. When we try to compile the proc, we get the error
    "table or view does not exist", and the line is the "deletion of sys.aud$. The line "select count (*) from sys.aud$ ' seems to cause no problems, but the proc does not compile as is. If I comment out the line "remove from sys.aud$", however, the proc compiles very well.

    Confusingly, if I log in as the same account that owns this proc, I can run both the count (*) select from sys.aud$ AND remove clauses sys.aud$ with no complaint at all (by modifying slightly to work with 1 single record at a time, of course), but I can't seem the same to compile in a stored proc.

    I guess that it is related permissions? Can someone point me to the permissions of the owner needs to be able to remove from sys.aud$ in a stored procedure? Or is there something else that needs to be done here? Pointers much appreciated.

    Thank you.

    acquired through ROLE privileges are NOT applicable within the named PL/SQL procedures.

    GRANT DELETE ON SYS. AUD$ ;

  • help in registration of the records from two tables

    HI: I have two tables joined the first field. The field is the primary key in the first table. Need help listing records from both tables with each a line/record results.
    create table EVENTS (
    event_key varchar2(64) primary key,
    event_description varchar2(64),
    create_time int
    );
    
    
    create table EVENT_UPDATES (
    event_key varchar2(64) NOT NULL ,
    update_description varchar2(64),
    update_time int
    );
    
    
    insert into EVENTS values('Event1', 'This is event1', 1);
    insert into EVENT_UPDATES values('Event1', 'Ticket created', 3);
    insert into EVENT_UPDATES values('Event1', 'Event cleared', 10);
    insert into EVENTS values('Event2', 'This is event2', 4);
    insert into EVENT_UPDATES values('Event2', 'Ticket created', 6);
    insert into EVENT_UPDATES values('Event2', 'Event cleared', 8);
    I want to print each record in the table of EVENTS such as a line and the corresponding records in EVENT_UPDATES as a line like this record
    Event1   1     This is event1
                3     Ticket created
                10   Event cleared
    Event2   4     This is event2
                6     Ticket created
                8     Event cleared
    TIA
    Ravi
    select  case weight
              when 1 then event_key
            end key,
            time_val,
            description
      from  (
              select  event_key,
                      create_time time_val,
                      event_description description,
                      1 weight
                from  events
             union all
              select  event_key,
                      update_time,
                      update_description,
                      2 weight
                from  event_updates
            )
      order by event_key,
               weight
    /
    
    KEY          TIME_VAL DESCRIPTION
    ---------- ---------- -------------------------
    Event1              1 This is event1
                        3 Ticket created
                       10 Event cleared
    Event2              4 This is event2
                        6 Ticket created
                        8 Event cleared
    
    6 rows selected.
    
    SQL> 
    

    SY.

  • Impossible to delete the record from the table using the form

    I have a stored procedure (function, actually) that allows an administrator to manually delete a record in a table.

    When I call my form there will be no effect. The record remains in the table.

    In both cases, I connect to the database to the same user.

    I am able to call a test function in the database which returns a field in the record, so I think I can at least communicate with and retrieve results from the database using a stored function. As soon as I approach him "select" "delete from", no luck.

    If I try to run the SQL in my form with a statement of FORMS_DDL, it seems to run smoothly when I not in the code in the debugger, but it had no effect. FORMS_SUCCESS reports TRUE if DBMS_ERROR_TEXT has the following: ORA-01403: no data found. I don't know how the DBMS_ERROR_TEXT is that FORMS_SUCCESS is not set to FALSE.

    Any ideas as to why I am unable to remove using my form but can when you call the function registered directly/manually?

    Using Oracle Forms & DB 10.0.2.0.1.

    Patrick,

    After each Insert / Update / Delete statement, you have to COMMIT . Then only it will be in select statements.

    Kind regards

    Manu.

  • Form check synchronize on Popup to the selected record from the table

    I'm trying to recreate what I did on the portals of the OAS in Weblogic/ADF. I have JDeveloper 11.1.1.2.0. What I do seems to be a little different than the tutorials: I need something like the tutorial master-detail, but instead the details appearing on the same page, it should appear in a popup. I managed to build the part table/popup. But when the popup appears, it displays the wrong record. Here are the steps I used to create this page:

    After you create the ADF Fusion Middleware project:

    1 create templates for the tables I need.
    2. create the JSF Page.
    3 drop panelCollection on the page.
    4. remove my data to see in panelCollection control and choose the Table read-only ADF. Select the sorting and selection options.
    5 change table properties: selected = DisplayRow, EditingMode = clickToEdit
    6 drag the Popup on the page.
    7. remove my data from view in popup control and choose the form of the ADF. Select the send option.
    8 drop showPopupBehavior on the page. Name of the popup. The value triggerType to the 'selection '. (triggerType "click" works, too)
    9 deploy.

    The table is displayed. I click on a line. The pop-up window appears. The form of popup displays the first record in the table. I click on any line.

    I just bought the merger Oracle 11g Developer Guide, but were not able to answer this question yet.

    Any ideas?

    Thank you.

    See this video for how it works for me:
    http://www.ScreenToaster.com/watch/stWUtcRkVLQ1BcSV1aX15Q

  • How to restore deleted records in another table in the oracle 10g database...

    Hi all

    I want to restore deleted records in a particular table in the other table

    Suppose that:

    I make a request

    delete from emp

    where deptno = 30;

    now, I won't restore deptno = 30 records in the other table, let's say table emp1

    can someone let me know how to do it?

    Thank you...

    This is what flashback query is for:

    orclz > conn scott/tiger

    Connected.

    orclz > select count (*) emp;

    COUNT (*)

    ----------

    14

    orclz > delete from emp where deptno = 30;

    6 deleted rows.

    orclz > commit;

    Validation complete.

    orclz > create table deleted30 in select * from emp to the timestamp (systimestamp - 5/1440) where deptno = 30;

    Table created.

    orclz > select count (*) in the deleted30;

    COUNT (*)

    ----------

    6

    orclz >

  • Delete rows from the table

    Hello

    10G

    A custom table is to have 5000 documents, I need to have everything 100 records in the table and delete the rest of them.
    could you suggest...

    Thank you
    Tim
    delete table_name where rowid not in (select rowid from table_name where rownum <101);
    
  • Use with need to collect in bulk to insert records from multiple tables

    Hello

    I plsql record type with several tables with multiple columns. so when I used bulk collect with education for ALL. I want to insert records in multiple tables.

    Please give me suggestions.

    ForAll is designed to be used with a single DML statement, which may include dynamic SQL statements. However, I do not know what advantage this will give you your list iteration save several times, one for each table - especially since there is an air show with SQL dynamic.

    Example 1 (dynamic SQL):

    begin

      ...

      forall i in vRecList.First..vRecList.Last
        execute immediate '
        begin
          insert into Table1 (Col1, Col2, Col3) values (:1, :2, :3);
          insert into Table2 (Col1, Col2, Col3) values (:1, :2, :3);
        end;' using vRecList(i).Col1, vRecList(i).Col2, vRecList(i).Col3;
    end;

    Another approach that I should work (but not tested) is using to insert all the Scriptures and based record inserts, but you need to try on your version of Oracle forall has changed between the versions.  In this case vRecList must be compatible with the Table % ROWTYPE and Table2% ROWTYPE type.


    Example 2 (insert all):

    begin

      ...

      forall i in vRecList.First..vRecList.Last

        insert all

          into Table1 values vRecList(i)
          into Table2 values vRecList(i)
        select 1 from dual;

    end;

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

    Hello

    I am trying to create a trigger that will move data from one table to the other.

    I have two tables (Trial1, Trial2) two of them contains the same attributes (code, c_index)

    I want to spend each new record inserted in (code Trial1) (code in Trial2)

    It's my trigger:
    Create or replace trigger trg_move_to_trial2
    After Insert on Trial1
    for each row
    Start
    insert into Trial2 (code)
    Select: new.code of Trial1;
    end;
    He compiled, but when I insert a new record (the code) in (Trial1), it shows this error:
    Error report:
    SQL error: ORA-04091: table STU101. TRIAL1 is changing, function of triggering/can not see
    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 changing, function of triggering/can not see.
    * Cause: A trigger (or plsql user-defined function that is referenced in)
    This statement) attempted to watch (or modify) a table that has been
    in the Middle being modified by the statement that shot.
    * Action: Rewrite the trigger (or function) so it does not read this table.
    I know matter what it means error, but I did not how to fix the error.

    ..................................................................................................

    I tried to change the (insert after on Trial1) before (insert on Trial1); It worked, but not in a good way. When I insert value in (code Trial1) new and refreshed Trial2 table, just as much as the records I have 2 test they will be duplicated. For example
    Trial2
    code
    111
    222
    333
    when I insert in Trial1
    Trial1
    code
    444
    Trial2 will be:
    code
    111
    222
    333
    444
    444
    444
    can you please tell me how to fix this?

    Kind regards

    Published by: 1002059 on April 23, 2013 17:36

    You should not select Trial1 - you already have data. Simply insert this 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; 
    

    Kind regards
    David

  • How to count records in a Table or form

    I have a Table that went to my context in the form of ADOBE.  I need to be able to count the number of records in this table.  I didn't see the actual table in this case on the shape, I just need than the number of records.  And, I need to do this using JavaScript and I don't know anything about Java (although if FormCalc works I can use this as well).     My Tablename is a customer and in my form, it's in the hierarchy data .main .customerbody .customerline.  If I have to have these data in the table on the form, then I can just put it on the form and invisiible.  I really need to count the number of records well and return this # to a text field in the form.

    Does anyone know how to do this and can you give me an example is Java for FormCalc?  The more specific you can be with the example script best for this beginner.  THX!

    I was no longer complicate things, and I found a simple answer to my problem.  I do this on SAP with Livecyle form so here's what I did

    In the Interface, I created a global variable called gv_count.  I then added, during the initialization of form Interface, copy the following code:

    describe the table reservations LINES gv_count.

    And then, in the form, I had just to add gv_count to the context and how link this to the field I want to do the count

  • How to read/select only the records from a table with non-English characters

    Hello
    I need to find all records in a table with non-English (mainly Chinese) characters in at least one of the varchar2 columns. Let me kow if someone knows a way by which it can be done using SQL/PLSQL.

    Best regards
    Imran
    select * from your table
    where your_column != convert(your_column, 'UTF8', 'US7ASCII)
    

    Replace UTF8 with your database character set

    Published by: thtsang on October 15, 2009 03:53 - unequal sign change of! =

Maybe you are looking for