Deleting records from a table and trying to retrieve those
Hellois 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?
Tags: Business Intelligence
Similar Questions
-
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.MHello
Please try something like that.
Begin Delete From Master_Tbl Cascade; forms_ddl('Commit'); End;
Sarah
-
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
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.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');
"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:
Here are some insert statements to populate the table. *(About a 100 of them, please Bear with me) *.create table BILLS ( bill_id VARCHAR2(20), trx_no VARCHAR2(20), item_code VARCHAR2(3), amount NUMBER, item_id NUMBER, invoice_dt DATE )
It comes to my select statement.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'));
I want to remove the lines that are extracted from my select statement. What is the best way to achieve this?SELECT Trx_No, Item_Code, Amount, Item_Id, MAX(Invoice_Dt) FROM Bills GROUP BY Trx_No, Item_Code, Amount, Item_Id
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)
-
I can not download the latest version of the app. Then, I deleted revel from my iPad and tried to download it from the cloud. I can not download from the cloud. What can I do to fix this?
Please see the post below updates on the issue of the revel facilities:
-
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$
; -
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
Timdelete table_name where rowid not in (select rowid from table_name where rownum <101);
-
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.
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 recordcreate 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);
TIAEvent1 1 This is event1 3 Ticket created 10 Event cleared Event2 4 This is event2 6 Ticket created 8 Event cleared
Raviselect 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.
-
I have a R710 with a PERC 6 / i, Win 2008 R2 running. I have a small disk for the operating system, the other 5 bays are filled with 1 TB disks in a RAID array-5.
I need to add more storage, so I want to buy three discs of 3 TB. I plan on the withdrawal of old readers, and then put it in the new, bigger. I assume that it will take 1 of the 3 TB and repair. Leaving free 2 TB disk. Repeat this step twice more, which will result in three discs of 3TO with 6 TB of disk space not used in the RAID.
Is it possible to have the controller expand storage in my table of RAID-5 existing free space, and then delete the two remaining 1 TB disks in the array?
Who is? Is it still possible? Or do I have to backup the data on another storage device and delete the table and simply start a new one with the three discs of 3 TB and copy the data back?
This will not work:
(1) the PERC 6 won't take 3 TB drives; the maximum size is 2 TB.
(2) you cannot delete records in a table - your RAID 5 5x1TB must always have records of 5 or more (you can add without deleting). Even when using the same number of disks, isn't it possible to do the smaller table/VD.
(3) even if you used 2 TB disks, there is no way to expand the RAID 5 using the extra space on the disks - with 5 disks in RAID 5, it will remain the same size. The only thing you can do with the new space is to create a second RAID array on the disks (called "slice"). This new VD is handled by the operating system as another "drive."
Keep in mind if backup and restore in a larger painting, as if the VD ('disc') is greater than 2 TB, the disc "" MUST be converted to GPT and active UEFI bootmode (instead of BIOS). Make sure that your backup software is capable of restoring one using the BIOS install on a system UEFI (and the 'disc' TPG 'disc' MBR).
-
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.
-
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 rowStart
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:
I know matter what it means error, but I did not how to fix the error.
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 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
when I insert in Trial1
code
111
222
333
Trial1
code
444Trial2 will be:
can you please tell me how to fix this?
code
111
222
333
444
444
444
Kind regards
Published by: 1002059 on April 23, 2013 17:36You 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 -
Delete data from a table with joins
Hey guys,.
IV struggled for a while with a sql now.
I'm trying to remove some data from urole based on the www.lesormes.com in the select part.
The selection is correct, but the part delete Deletes all data in the table urole and not only those found in the select.
How can I delete all data by using a join?
DELETE FROM urole
WHEN THERE IS)
SELECT *.
User JOIN urole
ON user.userid = urole.userid
AND user.audit_version = urole.audit_version
JOIN secrole
ON urole.roleid = secrole.roleid
WHERE user.audit_current = 'Y '.
AND secrole.audit_current = 'Y '.
AND IN secrole.rolename
('X',
« Y »,
« Z »,
));
Thanks for your help in advance!Hello
Welcome to the forum!
Chances are, you don't want to join in the subquery EXISTS of EPM; It is more likely you want just like this correlated subqueries:
DELETE FROM urole WHERE EXISTS ( SELECT 0 FROM user WHERE user.userid = urole.userid AND user.audit_version = urole.audit_version AND user.audit_current = 'Y' ) AND EXISTS ( SELECT 0 FROM secrole WHERE secrole.roleid = urole.roleid AND secrole.audit_current = 'Y' AND secrole.rolename IN ( 'X', 'Y', 'Z' -- No comma here ) ) ;
or maybe an IN subquery:
DELETE FROM urole WHERE p_key IN ( SELECT urole.p_key FROM user JOIN urole ON user.userid = urole.userid AND user.audit_version = urole.audit_version JOIN secrole ON urole.roleid = secrole.roleid WHERE user.audit_current = 'Y' AND secrole.audit_current = 'Y' AND secrole.rolename IN ( 'X', 'Y', 'Z' ) ) ;
where p_key is a unique key (not necessarily a single column) of urole.
It's just a guess; That's all I can do with the information you have posted. Test this carefully before to try it on your actual data.
Whenever you have a problem, it allows to post a small example of data (CREATE TABLE and INSERT statements) and the results desired from these data.
In the case of a DML (such as DEL) problem, the sample data must re - create the tables as they are to the DML, and the results will be the content of the modified table (urole) after the DML.Furthermore, there is a built-in function called user, the user is not a good name for a table.
-
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 -
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;
Maybe you are looking for
-
The bookmarks bar below shows the address bar but there is no icon of the any of the bookmarks.
-
Satellite A300D-13Y - cannot restart OS as usual
Hello the problem is whenever I go to restart Windows. Windows shut down and the screen is off.The brightness of the LED power for about 1 second - and who he was. You can push the Powerbutton as often as you want - no action. Motherboard is changed.
-
try to upgrade silverlight. will not allow the download.
the system is windows xp 3pack. 32 IE 8. Since it does not accept my attempts to download, it has been suggested that I have uninstall older versions of silverlight. I found 23 files and delete all but six. They refuse to go. My computer is rare
-
I get the following message appears when you try to open Photoshop... "Could not initialize Photoshop because an of.file - unexpected end has been detected. Help! You can use my Photoshop!
-
Kinkos scaned 16 of my granddaughters on a USB designs. They were placed in a single file in the drive. I tried to save the drawings separately so that I can convert them to JPEG format. I can't get the first of the 16 to register. How can I save the