Delete row number
i have a report generated by a selector. if my record has many rows i can change page and see the oder raws , but if i'm not in the first page, and i use a selector, the report don't show the new rows....how can i do???
No way in Oracle!
You report is made in one moment (SCN) and is showing all the records from that moment.
Nothing what happened after that will not be shown unless you refresh "selector" of your report "generator", probably report cursor.
Even in Windows app this should be hard to implement in a easy way ...if it is possible at all!
What do you want to achieve?
Similar Messages
-
How to count the number of deleted rows processed
Sybase ASE version: 15.7-SP52
Hi all,
I have a delete statement that will potentially delete millions of rows
DELETE from TAB_A where COL_A='Y'
The delete is long, at some point I'd like to know how many rows were deleted.
If I do SELECT COUNT(*) from TAB_A where COL_A='Y', the query should be locked because of the exclusive-lock held by the DELETE in progress.
If this is the case, how can I actually count the number of rows deleted so far?
Thanks all
SimonSimon
For deleting significant number of rows best practice is to delete rows in small batches of known size (e.g. 10 K) inside a while loop.
This keeps transaction log from filling up as well.
Also between two iterations of delete you can give some wait to make sure that you do not monopolize the server. Sleep could be for a fixed number of seconds (e.g. 5) or for randomized number say from 1 to whatever makes sense.
Typically "set rowcount " is used to set up the batch size and "waitfor delay" to sleep between iterations.
Global variable @@rowcount gives yo actual rows deleted. For the last batch this may be lower than the batch size you set up.
HTH
Avinash -
What is the keyboard shortcut for "delete row" in a table?
What is the keyboard shortcut for "delete row" in a table within a pages document?
Click on the row number to select the entire row. Right-click, and select Delete Row from the menu. There is no keyboard shortcut.
-
Word Links not updating when row number changes in excel
Hi,
I have a huge excel file with employee name,code,dob etc as fields.I linked it to word documents using paste special and macros.Everything works fine and word also updates with changes in excel file, but problem arises when in excel , data is added in the
middle rather than at the end of the file. This changes the row numbers of all the employees.Hence when I open corresponding word document, some one else's details open. So now i have to edit links in word...office->prepare->edit links, Here i
have an option called ITEM IN FILES... this is where the problem occurs...It requires mentioning the row no of the corresponding pasted link...but when i change data in excel and row no changes...this should be automatically detected by Word and row number
should be updated there.Please help me find a way to resolve this.This is what it looks like....
Data for VC!R1C2:R2C13
I want R1 and R2 to change automatically if I change rows in excel file.
Thank youInstead of specifying a cell range in the LINK field, name the range in Excel, then use the range name in the LINK field.
For example, instead of:
VC!R1C2:R2C13
you might have:
VC!MyRange
in Word.
That way, the LINK will point to the named range, regardless of how many rows and/or columns are added/deleted before it. Furthermore, if you expand or contract the range (e.g. by adding/deleting columns between the first & last column), the
named range and, hence the linked range, will likewise expand/contract.
Cheers
Paul Edstein
[MS MVP - Word] -
How to delete row by row comparing to first collumn?
Hello!
I have a problem - I need to delete row by row , but the problem is, that I know that first COLUMN of any table is a PK.
To retrieve COLUMN NAME I use:
SELECT column_name, table_name FROM USER_TAB_COLUMNS WHERE column_id = 1 and table_name = c1.tmp_table_name;
But this somehow doesn't work.
Below you can see my script (not worked for now):
declare
xxx varchar2(100);
begin
for c1 in (select table_name, tmp_table_name from tmp_tables) loop
EXECUTE IMMEDIATE
' SELECT column_name into '|| xxx ||' FROM USER_TAB_COLUMNS WHERE column_id = 1 and table_name = ' ||''''||c1.tmp_table_name||'''';
execute immediate
'begin
for c2 in (select * from '|| c1.tmp_table_name || ') loop begin
insert into '|| c1.table_name || ' values c2; delete from '|| c1.tmp_table_name || ' where ' || xxx ||' = c2.'||xxx ||'; exception when others then null; end; end loop; end;';
end loop;
end;
P.S. Inserts work perfect. I have a problem with delete rows that are in c1.table_name, from c1.tmp_table_name (this two tables have the same structure, PK, always), because I have different column names in another tables tables that are PK. (for example: K, ID, NS and so on) please help me to write correct script.
For example for first fetched row it will be like:
begin
for c1 in (select table_name, tmp_table_name from tmp_tables) loop
execute immediate
'begin for c2 in (select * from '|| c1.tmp_table_name || ') loop begin
insert into '|| c1.table_name || ' values c2; delete from '|| c1.tmp_table_name ||' where K = c2.K; exception when others then null; end; end loop; end;';
end loop;
end;
That script works perfect. But I have many others tables with different PK - not K.Solution with error-logging table
-- create the error-logging table
CREATE TABLE tbl_MergeErrors (
Stamp TIMESTAMP(3),
TableName VARCHAR2(30),
KeyColumn VARCHAR2(30),
KeyValue VARCHAR2(4000),
ErrorCode NUMBER(5),
ErrorMsg VARCHAR2(4000),
CONSTRAINT pk_MergeErrors
PRIMARY KEY (TableName, Stamp)
USING INDEX
-- procedure to insert errors
CREATE OR REPLACE
PROCEDURE LogMergeError (pTableName IN VARCHAR2,
pKeyColumn IN VARCHAR2,
pKeyValue IN VARCHAR2)
IS PRAGMA AUTONOMOUS_TRANSACTION;
-- you couldn't insert SQLCODE or SQLERRM directly into a table (ORA-00984)
nSQLCODE NUMBER(5) := SQLCODE;
vcSQLERRM VARCHAR2(4000) := SQLERRM;
BEGIN
INSERT INTO tbl_MergeErrors
(Stamp, TableName, KeyColumn, KeyValue, ErrorCode, ErrorMsg)
VALUES (SYSTIMESTAMP, RTrim( SubStr( pTableName, 1, 30)),
RTrim( SubStr( pKeyColumn, 1, 30)), SubStr( pKeyValue, 1, 4000),
nSQLCODE, vcSQLERRM);
COMMIT WORK;
-- if an error occured here, then just roll back the autonomous transaction
EXCEPTION
WHEN OTHERS THEN ROLLBACK WORK;
END LogMergeError;
-- create the tables and insert test-data
CREATE TABLE TMP_TABLES (
TABLE_NAME VARCHAR2(200),
TMP_TABLE_NAME VARCHAR2(200),
CONSTRAINT TMP_TABLES_X PRIMARY KEY (TABLE_NAME)
CREATE TABLE TMP_KL002 (
K VARCHAR2(40),
N VARCHAR2(200)
CREATE TABLE TMP_TABLE1 (
NS VARCHAR2(40),
N VARCHAR2(200)
CREATE TABLE KL002 (
K VARCHAR2(40),
N VARCHAR2(200),
CONSTRAINT PK_KL002 PRIMARY KEY (K)
CREATE TABLE TABLE1 (
NS VARCHAR2(40),
N VARCHAR2(200),
CONSTRAINT PK_TABLE1 PRIMARY KEY (NS)
INSERT INTO TMP_TABLES (TABLE_NAME, TMP_TABLE_NAME) VALUES ('kl002','tmp_kl002');
INSERT INTO TMP_TABLES (TABLE_NAME, TMP_TABLE_NAME) VALUES ('table1','tmp_table1');
INSERT INTO tmp_KL002 (K, N) VALUES ('00', 'none');
INSERT INTO tmp_KL002 (K, N) VALUES ('07', 'exists');
INSERT INTO tmp_KL002 (K, N) VALUES ('08', 'not assigned');
INSERT INTO tmp_table1 (NS, N) VALUES ('2000', 'basic');
INSERT INTO tmp_table1 (NS, N) VALUES ('3000', 'advanced');
INSERT INTO tmp_table1 (NS, N) VALUES ('4000', 'custom');
COMMIT WORK;
-- to test, if it works correct when primary key values exists before
INSERT INTO KL002 VALUES ('07', 'exists before');
COMMIT WORK;
-- check the data before execution
SELECT * FROM TMP_KL002 ORDER BY K;
SELECT * FROM KL002 ORDER BY K;
SELECT * FROM TMP_TABLE1 ORDER BY NS;
SELECT * FROM TABLE1 ORDER BY NS;
-- empty the error-logging table
TRUNCATE TABLE tbl_MergeErrors DROP STORAGE;
-- a solution
DECLARE
PLSQL_BLOCK CONSTANT VARCHAR2(256) := '
BEGIN
FOR rec IN (SELECT * FROM <0>) LOOP
BEGIN
INSERT INTO <1> VALUES rec;
DELETE FROM <0> t WHERE (t.<2> = rec.<2>);
EXCEPTION
WHEN OTHERS THEN
LogMergeError( ''<1>'', ''<2>'', rec.<2>);
END;
END LOOP;
END;';
BEGIN
FOR tabcol IN (SELECT t.Tmp_Table_Name, t.Table_Name, c.Column_Name
FROM Tmp_Tables t,
User_Tab_Columns c
WHERE (c.Table_Name = Upper( t.Tmp_Table_Name))
AND (c.Column_ID = 1)
) LOOP
EXECUTE IMMEDIATE Replace( Replace( Replace( PLSQL_BLOCK,
'<0>', tabcol.Tmp_Table_Name),
'<1>', tabcol.Table_Name),
'<2>', tabcol.Column_Name);
END LOOP;
END;
-- check the data after execution ...
SELECT * FROM TMP_KL002 ORDER BY K;
SELECT * FROM KL002 ORDER BY K;
SELECT * FROM TMP_TABLE1 ORDER BY NS;
SELECT * FROM TABLE1 ORDER BY NS;
-- ... and also the error-logging table
SELECT * FROM tbl_MergeErrors ORDER BY Stamp, TableName;
-- of couse you must issue an COMMIT (the ROLLBACK is only for testing
ROLLBACK WORK;
-- drop the test-tables
DROP TABLE TABLE1 PURGE;
DROP TABLE KL002 PURGE;
DROP TABLE TMP_TABLE1 PURGE;
DROP TABLE TMP_KL002 PURGE;
DROP TABLE TMP_TABLES PURGE;
-- you shouldn't drop the error-logging table, but I use it to free up my db
DROP TABLE tbl_MergeErrors PURGE;Greetings, Niels -
Deleting row in matrix.
Hello.
I have weird problem.
If I add some rows to matrix, and then delete rows the method with:
m_pMatrix->GetRowCount();
return the number of rows without delete.
For example:
If i have matrix with 5 rows, and I delete 2 rows, method with GetRowCount show me 5
What is wrong ?
I solved this problem with adding new variable, but why does it work wrong ?
Sorry for my english.
Regards
Kamil WydraHello.
Thank You for Your response.
I try that and it works.
Thanks again.
Regards
Kamil Wydra -
Oracle deleting rows from tables starting with the name PQ
hai friends
we are given access rights to delete only tables starting with PQ. HAVING PQ_NUM as primary key for all the PQ tables.
totally we have 6 tables. PQ_01,PQ_02, PQ_03,PQ_04,PQ_05,PQ_06.
ALL This tables will have one primary key. for example pq_01 willl have pq01_num as primarykey and pq_02 table will have pq02_num as primary
key.
pq01_num value will exist in all the primary key of pq tables.
i want query to delete rows from the pq tables based on the input value i give.
for example if i give primarykey value 122 then that value in pq tables should be deleted.
One more problem is there. pq_06 table does not have pq02_num column. here the column differs. it is pq06_num_req.
so give your idea of deleting the rows from pq tables
waiting
SI dont have access to databse,this is untested
declare
v_cmd varchar2(2000);
columnname varchar2(30);
input_value number:=??;
tabowner varchar2(30):=???
begin
--step 1 identify table
FOR sub IN (SELECT table_name table_to_delete
FROM all_tables
WHERE table_name LIKE 'PQ%'
and owner=tabowner
) LOOP
----step 2 identify column
v_cmd :='select t.column_name from all_constraints S,All_Ind_Columns T where
S.OWNER=T.TABLE_OWNER
AND S.TABLE_NAME=T.TABLE_NAME
AND S.INDEX_NAME=T.INDEX_NAME
and s.owner=tabowner
AND S.TABLE_NAME='||table_to_delete||'
and s.constraint_type='''P'';
execute immediate v_cmd into columnname;
--step 3 delete records
v_cmd := 'delete from '||tabowner||'.' ||
sub.table_to_delete || '
where '||columnname||'='||input_value;
execute immediate v_cmd;
commit;
END LOOP;
end;Edited by: user5495111 on Aug 11, 2009 6:35 AM -
Hi,
i am trying to implement page 664 of dev guide which is delete row of table.
My page shows the data of one row.
I added a delete submitbutton to my page.
Here is my code :
int idi = Integer.parseInt(id.toString());
XxVOImpl vo = getXxVO1();
XxVORowImpl row = null;
int fetchedRowCount = vo.getFetchedRowCount();
boolean rowFound = false;
RowSetIterator deleteIter = vo.createRowSetIterator("deleteIter");
if (fetchedRowCount > 0)
deleteIter.setRangeStart(0);
deleteIter.setRangeSize(fetchedRowCount);
for (int i = 0; i < fetchedRowCount; i++)
row = (XxVORowImpl)deleteIter.getRowAtRangeIndex(i);
oracle.jbo.domain.Number primaryKey = row.getId();
if (primaryKey.compareTo(idi) == 0)
row.remove();
rowFound = true;
getTransaction().commit();
break;
deleteIter.closeRowSetIterator();
my problem is that fetchedRowCount is 0. But there are about 100 rows in my table.
And my VO is just a simple select * from mytable.
So i do not understand why fetchedRowCount is still 0 ?
Help thanks
DanDan
You need to create a dialog page with yes no button when you click on delete icon. Please refer dev guide for dialog page or you ma refer below code snippet that you may need to change little bit
else if ("delete".equals(pageContext.getParameter(EVENT_PARAM)))
// The user has clicked a "Delete" icon so we want to display a "Warning"
// dialog asking if she really wants to delete the employee. Note that we
// configure the dialog so that pressing the "Yes" button submits to
// this page so we can handle the action in this processFormRequest( ) method.
String employeeNumber = pageContext.getParameter("empNum");
String employeeName = pageContext.getParameter("empName");
MessageToken[] tokens = { new MessageToken("EMP_NAME", employeeName)};
OAException mainMessage = new OAException("AK",
"FWK_TBX_T_EMP_DELETE_WARN", tokens);
// Note that even though we're going to make our Yes/No buttons submit a
// form, we still need some non-null value in the constructor's Yes/No
// URL parameters for the buttons to render, so we just pass empty
// Strings for this.
OADialogPage dialogPage = new OADialogPage(OAException.WARNING,
mainMessage, null, "", "");
// Always use Message Dictionary for any Strings you want to display.
String yes = pageContext.getMessage("AK", "FWK_TBX_T_YES", null);
String no = pageContext.getMessage("AK", "FWK_TBX_T_NO", null);
// We set this value so the code that handles this button press is
// descriptive.
dialogPage.setOkButtonItemName("DeleteYesButton");
// The following configures the Yes/No buttons to be submit buttons,
// and makes sure that we handle the form submit in the originating
// page (the "Employee" summary) so we can handle the "Yes"
// button selection in this controller.
dialogPage.setOkButtonToPost(true);
dialogPage.setNoButtonToPost(true);
dialogPage.setPostToCallingPage(true);
// Now set our Yes/No labels instead of the default OK/Cancel.
dialogPage.setOkButtonLabel(yes);
dialogPage.setNoButtonLabel(no);
// We need to keep hold of the employeeNumber, and the OADialogPage gives us a
// convenient means of doing this. Note that the use of the Hashtable is
// really more appropriate for passing multiple parameters, but we've used
// it here for illustration purposes. See the OADialogPage javadoc for an
// alternative when dealing with a single parameter.
java.util.Hashtable formParams = new java.util.Hashtable(1);
formParams.put("empNum", employeeNumber);
formParams.put("empName", employeeName);
dialogPage.setFormParameters(formParams);
pageContext.redirectToDialogPage(dialogPage);
else if (pageContext.getParameter("DeleteYesButton") != null)
// User has confirmed that she wants to delete this employee.
// Invoke a method on the AM to set the current row in the VO and
// call remove() on this row.
String employeeNumber = pageContext.getParameter("empNum");
String employeeName = pageContext.getParameter("empName");
Serializable[] parameters = { employeeNumber };
OAApplicationModule am = pageContext.getApplicationModule(webBean);
am.invokeMethod("deleteEmployee", parameters);
// Now, redisplay the page with a confirmation message at the top. Note
// that the deleteEmployee() method in the AM commits, and our code
// won't get this far if any exceptions are thrown.
MessageToken[] tokens = { new MessageToken("EMP_NAME", employeeName) };
OAException message = new OAException("AK",
"FWK_TBX_T_EMP_DELETE_CONFIRM", tokens, OAException.CONFIRMATION, null);
pageContext.putDialogMessage(message);
}Thanks
AJ -
Get row number of record in Interactive Report
I am using an interactive report and want to be able to modify a field and if the value already exists in the database change it back to what it was originally. I am selecting data using the select statement below and I'm calling the javascript CheckExists function when the value changes. All this is working but I need to figure out how to get the row number so I can change the value back to what is in f03 in the same row. Does anyone know how to access the row number or know how I can do this?
select apex_item.checkbox(1, RESOURCE_TYPE_ID, 'onchange="CheckUsed(this, this.value);"', ':') "Delete",
apex_item.text(2, RESOURCE_TYPE, 20, 100, 'onchange="CheckExists(this, this.value);"' ) "RESOURCE_TYPE",
RESOURCE_TYPE_ID,
apex_item.text(3, RESOURCE_TYPE, 20, 100) "orig_resource_type"
from resource_types
order by RESOURCE_TYPEScott,
I was not able to find anything like using #ROWNUM# that would give me the current row number but I was able to get it if I looped through all the records until I found the record I was currently on. It is not really what I wanted to do but it works. I have included the code below.
Thanks a lot for your help I appreciate it.
Steve
*** Interactive Report Select statement ***
select apex_item.checkbox(1, RESOURCE_TYPE_ID, 'onchange="CheckUsed(this);"', ':') "Delete",
apex_item.text(2, RESOURCE_TYPE, 20, 100, 'onchange="CheckExists(this);"' ) RESOURCE_TYPE,
RESOURCE_TYPE_ID,
apex_item.text(3, RESOURCE_TYPE, 20, 100) ORIG_RESOURCE_TYPE
from resource_types
order by RESOURCE_TYPE
*** Javascript ***
function CheckUsed (pResourceType)
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=ResourcesResourceTypeExists',0);
get.add('TEMPORARY_ITEM', pResourceType.value);
gReturn = get.get();
if (gReturn > 0)
alert('Resource records exist using the Resource Type; Unable to delete.');
pResourceType.checked=false;
function CheckExists (pResourceType)
// Get the current row number.
var lResourceTypeId = document.getElementsByName("f01");
var lResourceType = document.getElementsByName("f02");
var lOrigResourceType = document.getElementsByName("f03");
var j;
for (j = 0; j < lResourceType.length; j++)
if (lResourceType[j].value == pResourceType.value)
if (lResourceType[j].value != lOrigResourceType[j].value)
break;
} // if (lResourceType[j].value != lOrigResourceType[j].value)
} // if (lResourceType[j].value == pResourceType.value)
} // for (j = 0; j < lResourceType.length; j++)
// Check if the Resource Type already exists.
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=ResourceTypeExists',0);
get.add('TEMPORARY_ITEM', pResourceType.value);
gReturn = get.get();
if (gReturn > 0)
// Reset the Resource Type to the original Resource Type.
get.add('lResourceType[j]', lOrigResourceType[j].value);
doSubmit('SUBMIT');
else
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=UpdateResourceType',0);
get.add('TEMPORARY_ITEM', pResourceType.value);
get.add('TEMPORARY_ITEM_2', lResourceTypeId[j].value);
gReturn = get.get();
alert(gReturn );
} -
Delete row internal bank problem
Hi,
i wasn't able to delete row of my internal bank, despite i delete this bank in my BP account and in all payment method.
Also i delete all the information in internal banck account ( branch, count number, iban,etc) but when i delete the row the system give me this messagge error
bank account is currently in use and therefore can not be eliminated 705-20
i currently use 2007A SP 01 patch level 7
how can i resolve this problem? thanks a lotHi,
thanks a lot, but this bank is not linked to any one field in Sap B1
1) in initial details there isn't
2) in payment methods there isn't
3) in registry BP there isn't
where can i has to find it????
By copy espress i had copied all payment methods ( with this bank), and after i deleted this payment methods without using this payment method in anyone Sap b1 documents....and here the strange thing -
Hi!
Is there a way to delete row in database table by telling the number of the row?
Thanx!Oh, sorry I didn't properly read your post.
Try out what rvflannery suggests.
But, for reference, you should always delete a row by it's unique ID.
Don't go deleting things, by their position on a table, because a rows position can change.
V -
A system bug regarding to "base row number"
Dear All,
I may have found a system bug, which is causing problems.
Would anyone have a way around? or should I raise the issue to SAP through our reseller?
Basically, the "base row numbers", in some cases, can incorrectly relate to the row numbers in base documents.
One example:
We have 3 lines on one Sales order
row number | Item code
1 | C001
2 | B002
3 | A003
If I need to duplicate row 2 (B002) on the order, or insert a new line in between the 3 items, to change the order to
(Similiarly, you could double click on the column title i.e. Item code to sort the grid table)
row number | Item code
1 | C001
2 | B002
3 | B002
4 | A003
Then I copy the order to a Delivery, you will see the "base row number" in the database like so, which is wrong
row number | base row | Item code
1 | 1| C001
2 | 4| B002
3 | 2| B002
4 | 3| A003
This issue is causeing many problems (as existing in all documents) for reporting in terms of linking documents.
Because there could be same items put on order more than once, we cannot use "item code" to link/track line details etc.
Any idea? or I would be glad to see I was wrong.
Many thanks
Yang
Edited by: Y on Nov 17, 2009 11:10 AMIt is not a bug. In the documents two data describe the position of the row:
1. The LineNum is the number assigned to the line when it is generated. It does not change when you insert a line before it. The Base Row Number refer to this number, because it must point to the same line even when a new line is inserted before it.
2. The VisOrder is the actual sequence number of the line in the document. It may change when you insert/delete lines in the document.
What you may assume problem is that you can not make visible the LineNum by Form Settings. But you can define a UDF and an FMS setting it to the LineNum:
Select $[RDR1.LineNum] -
Deleting rows by key from several tables
Hello!
One of action of my stored procedure is deleting rows from several tables on a key , that I'm getting through statement :
delete from table3 where key_column in ();
delete from table4 where key_column in ();
commit;
select key_column from Table!
minus
select key_column from Table2
Unfortunately the number of lines mentioned by this statement isn't known in advance .
How do You think , is better way to
-- execute select each time for every delete-statement or
-- create table as select result set and then select again keys for each delete- ststement or
I'm usung 11.2.0.3
Thanks and regards,
PavelBy using : 1.trigger 2. on delete cascade you can achieve this.
OraFAQ Forum: SQL &amp; PL/SQL &raquo; delete rows from multiple tables (more than 2 tables)
Regards
Girish Sharma -
Adding delete row icon to report
We have a custom report that I would like to add the delete row icon to. Is this possible? Thanks in advance.
EricI am looking to add a sequential row number to some reports.Standard or interactive reports?
>
I can't use an ID number because they may not be in a specific order and for asthetics, I would like them to be numbered sequentially. I have a report that we run for different meetings and based on the meeting group is what we base the report on. For example, we have a meeting to review cases with our security team and we have a meeting to review incidents with our server admin team so I have a report based on the different teams we are meeting with and would just like to have a reference to go by. There could be 40 returned rows and if I use an ID they may not be in sequential numerical order so asking someone to look at a row could still be time consuming for them to find and view, if that makes sense.
>
That appears to require that the order must be fixed in the query like this:
select owner, incidentname, incidentaction
from mytable
where resolvingteam = 'teamnamehere'
order by ownerin order for people looking at different instances of the report to be seeing the rows in the same sequence? (The only way to guarantee the sort order in SQL is to <tt>ORDER BY...</tt>) It doesn't appear that there is any room for ambiguity here: you don't want someone instructed to deal with case #4 as a matter of priority when their #4 is numbered according to a different order...
Do the reports use pagination or should all rows appear on one page? The "+...asking someone to look at a row could still be time consuming for them to find and view...+" comment argues against pagination as it may require one or more page changes to find a given row, but retrieving everything on one page may impact performance and lead to issues with scrolling.
What version of APEX are you using?
What theme and template (if it's standard reports) are used?
What browser(s) and version(s) are used?
(FWIW, permanent, immutable IDs do appear to be a better idea to eliminate any possible ambiguity.) -
I have a CORD_LOB_MAPPING table which has a line_of_business as a column
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D2>DESC CORD_LOB_MAPPING
Name Null? Type
LINE_OF_BUSINESS NOT NULL VARCHAR2(10)
LOB_DESCRIPTION VARCHAR2(100)
LOB_SID NOT NULL VARCHAR2(10)
D2>SELECT LINE_OF_BUSINESS FROM CORD_LOB_MAPPING;
LINE_OF_BU
OPNRCH
OPNWLD
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I have the following 3 tables:
I want to delete rows from all the 3 tables depending on the follwoing rule.
In all the 3 tables i want to retain those rows whose data is present in CORD_LOB_MAPPING's line_of_business column
All those rows which do not corrospond to the line_of_business in CORD_LOB_MAPPING should be deleted.
For example, in the example given below, i am deleteing all rows from TMP_CORD_OUCS whose line_of_business
does not match with CORD_LOB_MAPPING line_of_business.
In other words, delete all rows which do not belong to OPNRCH and OPNWLD
DELETE FROM TMP_CORD_OUCS TCO
WHERE NOT EXISTS ( SELECT 1 FROM CORD_LOB_MAPPING CLM
WHERE UPPER(TCO.LINE_OF_BUSINESS) = UPPER(CLM.LINE_OF_BUSINESS));
D2>DESC tmp_cord_oucs
Name Null? Type
OUC_CODE VARCHAR2(9)
LATEST_PERIOD NUMBER(10)
OUC_PROCESS_FLAG VARCHAR2(1)
LINE_OF_BUSINESS VARCHAR2(10)
I want to know the delete statement for this table?
Delete all those rows from tmp_cord_rate_ids whose line_of_business is anything except OPNRCH and OPNWLD
DELETE FROM TMP_CORD_RATE_IDS TCRI
WHERE NOT EXISTS (SELECT 1
FROM TMP_CORD_OUCS TCO, CORD_LOB_MAPPING CLM
WHERE TCO.LINE_OF_BUSINESS=CLM.LINE_OF_BUSINESS
AND TCRI.OUC_CODE=TCO.OUC_CODE)
D2>DESC tmp_cord_rate_ids
Name Null? Type
OUC_CODE VARCHAR2(9)
RATE_ID VARCHAR2(5)
RATEID_PROCESS_FLAG VARCHAR2(1)
I want to know the delete statement for this table?
Delete all those rows from tmp_cord_rates whose line_of_business is anything except OPNRCH and OPNWLD
D2>DESC TMP_CORD_RATES
Name Null? Type
RATE_ID VARCHAR2(5)
RATE NUMBER(13,4)
RATE_PROCESS_FLAG VARCHAR2(1)Hi folks,
I will explain again.
I have a table
D2>DESC CORD_LOB_MAPPING
Name Null? Type
LINE_OF_BUSINESS NOT NULL VARCHAR2(10)
LOB_DESCRIPTION VARCHAR2(100)
LOB_SID NOT NULL VARCHAR2(10)
I have a column in cord_lob_mapping as line_of_business.
Now i want to delete rows from all the following 3 tables whose rows do not match up with line_of_business of cord_lob_mapping.
D2>DESC tmp_cord_rates
Name Null? Type
RATE_ID VARCHAR2(5)
RATE NUMBER(13,4)
RATE_PROCESS_FLAG VARCHAR2(1)
D2>DESC tmp_cord_rate_ids
Name Null? Type
OUC_CODE VARCHAR2(9)
RATE_ID VARCHAR2(5)
RATEID_PROCESS_FLAG VARCHAR2(1)
D2>DESC tmp_cord_oucs
Name Null? Type
OUC_CODE VARCHAR2(9)
LATEST_PERIOD NUMBER(10)
OUC_PROCESS_FLAG VARCHAR2(1)
LINE_OF_BUSINESS VARCHAR2(10)
Suppose the cord_lob_mapping table has the following rows in line_of_business
column
Line_of_business
world
universe
Now all rows from tmp_cord_oucs whose line_of_business is not world or universe should be deleted.
Simillarly, all corrosponding rates from tmp_cord_rates and rate_ids from tmp_cord_rate_ids should also be deleted whose line_of_business is not world or universe.
I have included the delete statements for each of the 3 tables. Could anyone of you please verify them to be correct.
delete from tmp_cord_rates tcr
where not exists(select 1
from cord_lob_mapping clm, tmp_cord_oucs tco, tmp_cord_rate_ids tcri where clm.line_of_business=tco.lob_mapping
and tco.ouc_code=tcri.ouc_code
and tcri.rate_id=tcr.rate_id);
delete from tmp_cord_rate_ids tcri
where not exists(select 1
from cord_lob_mapping clm, tmp_cord_oucs tco
where clm.line_of_business=tco.lob_mapping
and tco.ouc_code=tcri.ouc_code);
delete from tmp_cord_oucs tco
where not exists(select 1
from cord_lob_mapping clm
where clm.line_of_business=tco.lob_mapping);
Maybe you are looking for
-
App store wont let me open cretain apps
I searched 'computer' in the app store, and it shows apps so that you can connect to your computer. But when I tap on one, it starts to show the description, then it closes the app store. I've tried other apps of that kind, same thing. I tried seeing
-
Erratic behaviour while firing a BAPI
Hi All, In my application, I am using a BAPI. I enter an account no in the text field and data corresponding to it is returned. The problem I am facing is that, very rarely a data for different acccount no is returned. This happens 1 in 20000 times a
-
2 Conditions on the same keyfigure
HI all, can we create two conditions Top N and Bottom N on the same keyfigure but in the output the same keyfigure will show in two different columns like Top N wise & Bottom N wise. please give the solution. Thnaks pinkyreddy Edited by: pinky reddy
-
DEAR ALL, WHILE IMPORTING LICENSE FILE IN SAP B1 , I AM GETTING AN ERROR 'CANNOT VERIFY THE DIGITAL SIGNATURE OF LICENSE FILE' WHAT SHOULD I DO? THANKS AGRANSHU SHUKLA
-
Paying for a service not listed on my account
I cancelled my Adobe Illustrator CC subscription some time ago, and it does not appear under "Plans & Products" on my account. It says I have no plans or products, and the program is no longer installed on my PC. However I am still being charged $19.