How to delete MANY rows of a table
Dear Oracle experts,
I fear this is a very stupid question but I don't know the solution of that problem :
I have a table with about 15 Million lines here. I would likt to delete about 12 M lines by a delete statement.
My Problem is, that this query takes very much time (more than 45 min), because the database writes all deleted lines into the redo-log , I assume.
Is there any way to sorround that mechanism or to increase the speed of the delete
in any way ?
Woukd it help to switch off the archivelog mode and to perform a new backup instantly after deleting the table rows ?
Do you have better recommendations ?
Best regards,
Daniel
Alternately, you can move the rows you want to keep into a new table, truncate the existing table, and move the data back. This has the advantage that you don't have to re-create all your constraints & indexes so you avoid the risk of accidentally missing something.
Justin
Similar Messages
-
How to delete a row in the table in servlets
I have met a problem in deleting a row in table using servlets.
My table looks like this:
ID Name Type
12 Milienium S
15 USIA O
My code looks like this:
String query = "SELECT * FROM tb_Funds";
rs = statement.executeQuery(query);
while(rs.next()) {
StdID=rs.getString("FundID");
StdName=rs.getString("Name");
StdType=rs.getString("Type");
out.print("<td><INPUT TYPE=TEXT NAME=
myName VALUE=" + StdID + "></td>");
out.print("<td>" + StdName + "</td>");
out.print("<td>" + StdType + "</td>");
buf.append("<td>" + "<INPUT TYPE=SUBMIT
NAME=Delete VALUE=DELETE>" + "</td></tr>");
There is a delete button in every row. May I know how to delete the row that I want by getting the ID from the table and delete it from the database.
Deleting from a table is simple -> delete from tb_funds where id = <value>. Obviously replace <value> with the appropriate ID or use a bind variable (a ?) and prepared statements.
Are you asking how to pass the id associated with the table row from the browser when the button is pressed? -
How to delete multiple rows from ADF table
How to delete multiple rows from ADF table
Hi,
best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
Frank -
How to delete a row in ADF Table by pressing "Delete" Key
I want to delete a row in my ADF table by pressing the "Delete" key..How can i achieve it?
hai ,
I write clientListener and ServerListener..But in the script i printed the event.getKeyCode() ...*When i press Delete Key or EnterKey ,it is not printing the value*..
The code i write is pasted below..
In the code backing_Comm is my backingbean..Is there any problem in the code that i had written?I want to delete a selected row from my table using keypress Event...pls advice..
<script type="text/javascript">
onPressDeleteKey=function(event){
alert(event.getKeyCode()); // *Here i am not getting the alert, when i press Delete Key or Enter Key..But getting alert when i press A- Z or 1 - 0*
if(event.getKeyCode()==AdfKeyStroke.ENTER_KEY) {
var source = event.getSource();
AdfCustomEvent.queue(source,performDeleteOnPress,{},false);
</script>
<*af:table* value="#{bindings.ComMastVO.collectionModel}"
var="row"
rows="#{bindings.ComMastVO.rangeSize}"
emptyText="#{bindings.ComMastVO.viewable ? 'No rows yet.' : 'Access Denied.'}"
fetchSize="#{bindings.CompMastVO.rangeSize}"
rowSelection="single"
id="tblCom"
columnStretching="last" inlineStyle="width:100%;"
width="273"
selectionListener="#{backing_Comm.rowSelectCom}"
binding="#{backing_Comm.tblCom}"
clientComponent="true" >
<*af:column* sortProperty="Com" sortable="true">
<*af:inputText* value="#{row.bindings.Com.inputValue}"
label="#{bindings.ComMastVO.hints.Com.label}"
required="#{bindings.ComMastVO.hints.Com.mandatory}"
columns="150"
maximumLength="#{bindings.ComMastVO.hints.Com.precision}"
shortDesc="#{bindings.ComMastVO.hints.Com.tooltip}">
valueChangeListener="#{backing_Comm.onValueChange}"
autoSubmit="true" >
<f:validator binding="#{row.bindings.Com.validator}"/>
*</af:inputText>*
*<af:serverListener type="performDeleteOnPress"*
*method="#{backing_Comm.goDeleteCurrentRow}"/>*
</af:column>
*<af:clientListener type="keyPress"*
*method="onPressDeleteKey"/>*
</af:table>
=================================================
anybody pls help??
Edited by: Briston Thomas on Jun 3, 2009 2:25 AM -
Delete many rows from one table at once URGENT
Assume we have table called emp.
table desription:
SQL> desc emp
Name Null? Type
EMPNO NOT NULL NUMBER(6)
DIVISION NOT NULL NUMBER(3)
JOB_NO NOT NULL NUMBER(4)
START_DATE NOT NULL DATE
select * from emp;
EMPNO--------DIVISION--------JOB_NO------------START_DATE
1111------------------011-------------8181--------------04/10/1999
1111------------------011-------------8181--------------04/10/2004
2222------------------011-------------3131--------------05/11/2005
3333-----------------022-------------8181--------------06/09/2001
3333-----------------044-------------8181--------------06/08/1988
5555-----------------011-------------8066--------------01/01/2001
6666-----------------033-------------9600--------------01/01/1999
7777-----------------044-------------8181--------------06/24/1996
7777-----------------033-------------8181--------------12/02/1991
7777-----------------033-------------8181--------------03/01/2002
9999-----------------044-------------9191--------------03/05/1980
9999-----------------055-------------9191--------------03/06/1989
My goal is to delete employee records for those employee which contains multiple values for JOB_NO
equal to 8181, (JOB_NO= 8181) with new start_dateS.
We need to keep only one record for JOB_NO 8181 which contains oldest start_date.
Here is the delete statement for the single record.
delete from emp
where empno = 7777 and job_no = 8181 and start_date in ('03/01/2002','06/24/1996);
So how could I delete thousands records from the table with this logic?
After deleting multiple records table should be as below:
select * from emp;
EMPNO--------DIVISION--------JOB_NO---------START_DATE
1111-----------------011-------------8181--------------04/10/1999
2222-----------------011-------------3131--------------05/11/2005
3333-----------------044-------------8181--------------06/08/1988
5555-----------------011-------------8066--------------01/01/2001
6666-----------------033-------------9600--------------01/01/1999
7777-----------------033-------------8181--------------12/02/1991
9999-----------------044-------------9191--------------03/05/1980
9999-----------------055-------------9191--------------03/06/1989Here's one way to do it. I think this fits your business rules. At least it matches the output for your first example. It uses an analytic. I just like using them.
SQL> select * from employees;
EMPNO DIVISION JOB_NO START_DATE
1111 11 8181 10-APR-1999
1111 11 8181 10-APR-2004
2222 11 3131 11-MAY-2005
3333 22 8181 09-JUN-2001
3333 44 8181 08-JUN-1988
5555 11 8066 01-JAN-2001
6666 33 9600 01-JAN-1999
7777 44 8181 24-JUN-1996
7777 33 8181 02-DEC-1991
7777 33 8181 01-MAR-2002
9999 44 9191 05-MAR-1980
9999 55 9191 06-MAR-1989
12 rows selected.
SQL> delete employees
2 where rowid in
3 (select rowid
4 from
5 (
6 select empno
7 ,job_no
8 ,start_date
9 ,row_number() over (partition by empno, job_no order by start_date) rn
10 from employees
11 where job_no = 8181
12 )
13 where rn > 1
14 )
15 ;
4 rows deleted.
SQL> select * from employees;
EMPNO DIVISION JOB_NO START_DATE
1111 11 8181 10-APR-1999
2222 11 3131 11-MAY-2005
3333 44 8181 08-JUN-1988
5555 11 8066 01-JAN-2001
6666 33 9600 01-JAN-1999
7777 33 8181 02-DEC-1991
9999 44 9191 05-MAR-1980
9999 55 9191 06-MAR-1989
8 rows selected. -
How to delete all rows in all tables of a schema in Oracle?
Hi all,
I want to delete all records of all tables of a schema and I think there should be some statement for this but I don't know how?
may you help?
Edited by: user8105261 on Nov 25, 2009 11:06 PMuser8105261 wrote:
Hi all,
I want to delete all records of all tables of a schema and I think there should be some statement for this but I don't know how?
may you help?
Edited by: user8105261 on Nov 25, 2009 11:06 PMA typical way to reset a schema (e.g. to recreate a schema on the test database) is totally different.
1) Drop the user
2) recreate the user including table scripts from
2a) your version control system
2b) from a export dumpfile using the "nodata" option while importing -
How to delete multiple rows in a table of web dynpro for abap?
hi,
Experts ,
I want to delete the selected multiple records from a table from that i have inserted a check box ui element in a first column of a table what ever checkbox ix checked i want to delete those selected records from table .
please suggest me on
Thanks in advanceHi,
If you have DELETE button, in that action you write this code -
DATA lr_node type ref to if_wd_context_node.
lt_set = lr_node->get_elements( ).
loop at lt_set into ls_set.
ls_set->get_staitc_attributes
importing
static_attirbutes = ls_row.
if ls_row-check = 'X'.
lr_node->remove_element( ).
endif.
endloop.
Check the methods and thier types.
Regards,
Lekha. -
How to delete a row from database table in facade client
Hi all,
I followed the tutorial in creating a persistence entity from database table, then a session facade. Then I followed the tutorial to create a sample client to test the model. In the session facade, I could use persistEntity method to insert a record to the database. I am just thinking of an extension to the tutorial, i.e., being able to delete the record too. So I created a new method removeEntity in the session facade
public void removeEntity(Object entity) {
entity=em.merge(entity);
em.remove(entity);
em.flush();
and called it in the sample client. It was executed without any error, but the record in the table still exists.
I tried to look around for a solution, but I did not find one. Would anybody here please help out? Many thanks in advance!Hi Frank,
I tried the code snippet, but I got the following exception when executing this code:
javax.ejb.EJBException: EJB Exception: ; nested exception is:
java.lang.IllegalStateException: The method public abstract javax.persistence.EntityTransaction javax.persistence.EntityManager.getTransaction() cannot be invoked in the context of a JTA EntityManager.; nested exception is: java.lang.IllegalStateException: The method public abstract javax.persistence.EntityTransaction javax.persistence.EntityManager.getTransaction() cannot be invoked in the context of a JTA EntityManager.
java.lang.IllegalStateException: The method public abstract javax.persistence.EntityTransaction javax.persistence.EntityManager.getTransaction() cannot be invoked in the context of a JTA EntityManager.
at weblogic.deployment.BasePersistenceContextProxyImpl.validateInvocation(BasePersistenceContextProxyImpl.java:121)
at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:86)
at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:91)
at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80)
at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:26)
at $Proxy141.getTransaction(Unknown Source)
at model.SessionEJBBean.removeEntity(SessionEJBBean.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy143.removeEntity(Unknown Source)
at model.SessionEJB_qxt9um_SessionEJBImpl.removeEntity(SessionEJB_qxt9um_SessionEJBImpl.java:142)
at model.SessionEJB_qxt9um_SessionEJBImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
javax.ejb.EJBException: EJB Exception: ; nested exception is:
java.lang.IllegalStateException: The method public abstract javax.persistence.EntityTransaction javax.persistence.EntityManager.getTransaction() cannot be invoked in the context of a JTA EntityManager.; nested exception is: java.lang.IllegalStateException: The method public abstract javax.persistence.EntityTransaction javax.persistence.EntityManager.getTransaction() cannot be invoked in the context of a JTA EntityManager.
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.unwrapRemoteException(RemoteBusinessIntfProxy.java:109)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:91)
at $Proxy0.removeEntity(Unknown Source)
at model.SessionEJBClient.main(SessionEJBClient.java:71)
Caused by: java.lang.IllegalStateException: The method public abstract javax.persistence.EntityTransaction javax.persistence.EntityManager.getTransaction() cannot be invoked in the context of a JTA EntityManager.
at weblogic.deployment.BasePersistenceContextProxyImpl.validateInvocation(BasePersistenceContextProxyImpl.java:121)
at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:86)
at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:91)
at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80)
at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:26)
at $Proxy141.getTransaction(Unknown Source)
at model.SessionEJBBean.removeEntity(SessionEJBBean.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy143.removeEntity(Unknown Source)
at model.SessionEJB_qxt9um_SessionEJBImpl.removeEntity(SessionEJB_qxt9um_SessionEJBImpl.java:142)
at model.SessionEJB_qxt9um_SessionEJBImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Process exited with exit code 0. -
How to delete duplicate rows in a table
hai,
i have a table which consists of hunderds of records and contains duplicate records also. how can i delete duplicate records.
thanks
raviThis maybe a litle bit fast for deletion:-
delete from emp where rowid in (
2 SELECT rowid FROM emp
3 group by rowid,empno,ename,job
4 minus
5 SELECT min(rowid) FROM emp
6 group by empno,ename,job); -
How To Delete a Row From a TableView !!!!
Hi,
Does any know how to delete a row from a table view model.
I have a TableViewModel being displayed, when the user select the particular row and click delete i want that particular row to be deleted.
Any Suggestions How.
Thanks,
Emmanuel.If u want to delete single row, then set the property of TableView - selectionMode="SINGLESELECT". Select the radio button and click on delete button. In the main program, you can get the row value like...
public void onDeleteButtonClicked(Event event) throws PageException {
TableView table = (TableView) this.getComponentByName ("idTableView");
DefaultTableViewModel dmodel = myBean.beanModel;
String pid = "", row_selected;
// Get the first visible row
int firstVisibleRow = table.getVisibleFirstRow();
// Get the last visible row
int lastVisibleRow = table.getVisibleLastRow();
for (int i = firstVisibleRow; i <= lastVisibleRow; i++) {
if (table.isRowSelected(i)) {
row_selected = i;
pid = dmodel.getValueAt(i, 1).toString();
"i" will give you the row no, pid has the value of the row at first column.
Hope this helps.
Thanks,
Praveen -
How to delete select data in the table control
this problem makes me headache.
I am new to labview, when a table shows some data. many rows and column. how can delete on row which I selected. the other rows are remain no change.
I really need help.thanks in advance. It is better to attach the program.my labview is 2009
Solved!
Go to Solution.Hi,
You can do it with a table control as well. Check out the attached VI. To delete a row, Run the VI, just right click the row and click "Delete Row". To get back the default values, click reinitialize.
Reards,
NitZ
(Give Kudos to Good Answers, Mark it as a Solution if your problem is Solved)
Attachments:
Untitled 3.vi 8 KB -
Deleting Multiple Rows From Multiple Tables As an APEX Process
Hi There,
I'm interesting in hearing best practice approaches for deleting multiple rows from multiple tables from a single button click in an APEX application. I'm using 3.0.1.008
On my APEX page I have a Select list displaying all the Payments made and a user can view individual payments by selecting a Payment from the Select List (individual items are displayed below using Text Field (Disabled, saves state) items with a source of Database Column).
A Payment is to be deleted by selecting a custom image (Delete Payments Button) displayed in a Vertical Images List on the same page. The Target is set as the same page and I gave the Request a name of DELETEPAY.
What I tried to implement was creating a Conditional Process On Submit - After Computations and Validations that has a source of a PL/SQL anonymous block as follows:
BEGIN
UPDATE tblDebitNotes d
SET d.Paid = 0
WHERE 1=1
AND d.DebitNoteID = :P7_DEBITNOTEID;
INSERT INTO tblDeletedPayments
( PaymentID,
DebitNoteID,
Amount,
Date_A,
SupplierRef,
Description
VALUES
( :P7_PAYMENTID,
:P7_DEBITNOTEID,
:P7_PAID,
SYSDATE,
:P7_SUPPLIERREF,
:P7_DESCRIPTION
DELETE FROM tblPayments
WHERE 1=1
AND PaymentID = :P7_PAYMENTID;
END;
The Condition Type used was Request = Expression 1 where Expression 1 had a value of DELETEPAY
However this process is not doing anything!! Any insights greatly appreciated.
Many thanks,
Gary....the "button" is using a page level Target,...
I'm not sure what that means. If the target is specified in the definition of a list item, then clicking on the image will simply redirect to that URL. You must cause the page to be submitted instead, perhaps by making the URL a reference to the javaScript doSubmit function that is part of the standard library shipped with Application Express. Take a look at a Standard Tab on a sample application and see how it submits the page using doSubmit() and emulate that.
Scott -
How to delete an item in the table
hi all ,
Is anyone there to give me an idea , how to delete the item in the table , by selecting the row. , for the what i have to do , is there any documentation to follow , guide me itys really urgent.Hai Madhu,
It is pretty simple.
First u define a button. and in onAction Event of the button write the following code.
process is as follows:
1)get the node
2)get the element
3)using the method remove_element() ,remove the element.
<u><b>The Sample Code is as follows</b></u>
DATA:
node_flighttab TYPE REF TO if_wd_context_node,
elem_flighttab TYPE REF TO if_wd_context_element.
node_flighttab = wd_context->get_child_node( 'FLIGHTTAB' ).
get element via lead selection
elem_flighttab = node_flighttab->get_element( ).
node_flighttab->remove_element( element = elem_flighttab ).
Follow the above code ,it will definately help you. -
Regarding how to delete the record in internal table
Hi experts ,
how to delete the record in intarnal table after validating the data,
if record contains invalid fields?
i am giving my code see this and give me the answer?
loop at it_data into wa_data .
Validate Cost Center
READ TABLE it_kostl INTO wa_kostl WITH KEY kostl = wa_data-kostl BINARY SEARCH.
IF sy-subrc NE 0.
PERFORM update_error_log USING wa_data
text-004.
ENDIF.
Validate source file material ( material number )
loop at it_mara into wa_mara .
read table it_ausp into wa_ausp with key atwrt = wa_data-i_matnr .
if sy-subrc NE 0 .
PERFORM update_error_log USING wa_data
text-002.
delete it_data-objek .
else.
read table it_mara into wa_mara with key matnr = wa_ausp-objek .
if sy-subrc EQ 0 .
wa_data-objek = wa_mara-matnr.
wa_data-matkl = wa_mara-matkl.
ENDIF.
Modify it_data from wa_data .
endif.
*endloop.
Validate unit of measure (unit)
READ TABLE it_t006 INTO wa_t006 WITH KEY msehi = wa_data-unit .
IF sy-subrc NE 0.
PERFORM update_error_log USING wa_data
text-003.
endif.
Validate delivery location ( storage location )
READ TABLE it_lgort INTO wa_lgort WITH KEY del_loc = wa_data-del_loc.
IF sy-subrc NE 0.
PERFORM update_error_log USING wa_data
text-001.
if wa_data-flag ='x' .
delete it_data from wa_data .
endif.
ENDIF.
endloop.Hi Naren,
First get the index number of the IT_data table and store it in one variable whose declaration like this.
data: tabix type sy-tabix.
while reading the internal table it_data set the tabix variable.
tabix = sy-tabix.
Instead of the above use below one.
Delete it_data-objek
Use the Below statement it will delete the row from the internal table.
Delete it_data-objek index tabix
Thanks,
Chidanand -
Deleting a row from parent table
Dear Guru's
I am having two table with parent - child relationship. My problem is when I am deleting a row from parent table the curresponding child row from child table also should be deleted.
My Primary table 'Employee, EMPID Primary key
Child table 'Privilage' inthis EMPID referencing the EMPID of Employee table
My need is when I am deleting a row from parent table the curresponding child row from child table also should be deleted
I issued the SQL query like,
delete from employee where empid='12345' cascade constraints;
Then it showing me error like,
ERROR at line 1:
ORA-00933: SQL command not properly ended
Please resolve my issue , Its Top urgent
Thanks & Cheers
AntonyChoosing How Foreign Keys Enforce Referential Integrity
Oracle Database allows different types of referential integrity actions to be enforced, as specified with the definition of a FOREIGN KEY constraint:
Prevent Delete or Update of Parent Key The default setting prevents the deletion or update of a parent key if there is a row in the child table that references the key. For example:
CREATE TABLE Emp_tab (
FOREIGN KEY (Deptno) REFERENCES Dept_tab);Delete Child Rows When Parent Key Deleted The ON DELETE CASCADE action allows parent key data that is referenced from the child table to be deleted, but not updated. When data in the parent key is deleted, all rows in the child table that depend on the deleted parent key values are also deleted. To specify this referential action, include the ON DELETE CASCADE option in the definition of the FOREIGN KEY constraint. For example:
CREATE TABLE Emp_tab (
FOREIGN KEY (Deptno) REFERENCES Dept_tab
ON DELETE CASCADE); Set Foreign Keys to Null When Parent Key Deleted The ON DELETE SET NULL action allows data that references the parent key to be deleted, but not updated. When referenced data in the parent key is deleted, all rows in the child table that depend on those parent key values have their foreign keys set to null. To specify this referential action, include the ON DELETE SET NULL option in the definition of the FOREIGN KEY constraint. For example:
CREATE TABLE Emp_tab (
FOREIGN KEY (Deptno) REFERENCES Dept_tab
ON DELETE SET NULL);
SQL> conn scott/tiger
Connected.
SQL> create table ppk ( no number primary key);
Table created.
SQL> begin for inn in 1..10 loop insert into ppk values (inn); end loop; end;
PL/SQL procedure successfully completed.
SQL> create table ffk ( no number references ppk(no));
Table created.
SQL> begin for inn in 1..10 loop insert into ffk values (inn); end loop; end;
PL/SQL procedure successfully completed.
SQL> drop table ppk cascade constraints;
Table dropped.Message was edited by:
user52
Message was edited by:
user52
Message was edited by:
user52
Maybe you are looking for
-
External hard drive for quick access to photos/music
Hi! I have a 13" Macbook Pro circa 2009. I want to purchase a large and fast external hard drive that I can actively use. Meaning this external hard drive would become my storage for all photos and music, NOT just a backup drive. I want to be able to
-
Silence at the beginning of a bounced file
most times that i bounce a wave file and convert it into an mp3, i get about 20 seconds of silence at the beginning of the file and the last 20 seconds of the song is cut off. any suggestions? thanks!
-
Hi, I have a servlet which need to send xml(Which can have any unicode characters) as response. Below are my trails. *1>>>* PrintWriter out = response.getWriter(); response.setContentType("text/xml;charset=ISO-8859-1"); out.write("<?xml version=\"1.0
-
Calibrating: Improve the quality and accuracy of your images
The Sprout Workspace depends on the alignment of the HP Touch Mat and the projected screen on the touch mat. This alignment is calibrated during initial setup and can also be recalibrated at any time you choose. During calibration, Sprout detects the
-
Sql Queries - adding calculated variables to views
Hello: I'm trying to do add a calculated variable to my view that isn't an Entity Attribute, its simple really but i don't know if I'm leaving something out or not. I add the "new Attribute" , call it nCompleted, type - number I then check off everyt