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?

Similar Messages

  • How to delete a column from the table control in module pool?

    Hi,
      can any one please tell How to delete a column from the table control in module pool?
    thanks in advance
    warm regards
    HareeshKumar N

    hi hareesh,
    I think it is better to hide it.
    How to hide: You can check this link
    Dynamic Hide column in table control

  • 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

  • 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

  • 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.

  • 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 PM

    user8105261 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 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

  • 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 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 advance

    Hi,
    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 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
    ravi

    This 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

  • Problems with Click a row in the Table

    Dear All,
    I am new to Java GUI. I got some problems with clicking the row in a table.
    My table allows the user to delete some rows fromt the table. When the user click a row or some rows in my table, the delete button should be enabled. It does work in most of the time. But sometimes, even the row being hight lighted, the button is still not enabled.
    Do you have any idea for what can cause this problem?
    What I did is :
    1. add a mouse listener to the table
    _userTable.addMouseListener(new java.awt.event.MouseAdapter()
    public void mouseClicked(MouseEvent e)
    userList_mouseClicked(e);
    2. then, if the row being selected is > 0, I will enable my delete button.
    Can anybody help?
    Thanks!

    Dear All,
    I am getting problems with single selection in a table. Although I have set the selection model to single, if I select a row int the table and then depress Ctrl/Shift multiple rows are selected.
    The code for set single selection is :
    ListSelectionModel seleModel = myTable.getSelectionModel();
    seleModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    Any idea about this? Is this a bug in JAVA?
    Thanks!

  • Web Dynpro for ABAP:How to insert and delete a row in a table

    I have a table.
    My requirement is to insert a row into the table and i want to delete a particular row also.
    How can i do it.
    Plz reply me..

    Try the Web Dynpro for ABAP forum:
    Web Dynpro ABAP
    Kind Regards
    Stefanie

  • Deleting a row from a table containing CLOB as one of the columns

    When i delete a row from a table which contains a CLOB (internal clob) i.e. CLOB or BLOB column, Will the CLOB data will also be deleted ? I understand that what exactly stored in the CLOB column is the clob locator which points to the actual data.
    So, when I delete this row, the clob locator will be deleted, but will the actual data what this locator is pointing to is also deleted ??? if not what is the process to delete the data the locator is pointing to when the row containing the locator is deleted ? If this is not happening then the actual data might become an orphan data which nobody has access to, will automatic garbage cleaning occurs on a frequent intravels to delete unaddressed data residing on the database server ?
    Thanks in advance for the help, can email me at [email protected] alternatively.
    Regards,
    Srinivasa C.

    Michael,
    Thanks very much for your inputs, here are the results i got when i tried the way you explained in your answer, the TRUNCATE command made the actual size back to normal, but the delete is not the same, so, how can i delete the data that a particular clob locator may point to ?
    truncate would delete all the rows of the table, which might not serve my purpose, i would like to delete a row and also it's associated clob data from the database! is there anyway to do this ?
    is there any limitation on the ool_sample size? i am basically a c++ programmer, i am looking for some function like FREE which would free the allocated memory to the clob once the locator is deleted.
    your help is greatly appreciated - Thanks!
    :-) Srini.
    ==========================
    My Results:
    ==========================
    SQL> create table sample (
    2 id integer primary key,
    3 the_data CLOB default empty_clob() )
    4 lob (the_data) store as ool_sample;
    Table created.
    SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
    2 from user_segments
    3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
    4 group by segment_name;
    SEGMENT_NAME
    SOTRAGE_CONSUMED
    OOL_SAMPLE
    20K
    SAMPLE
    10K
    SQL> select count(*) from sample;
    COUNT(*)
    0
    SQL> begin
    2 for i in 1..1000
    3 loop
    4 insert into sample values (i, RPAD('some data', 4000) );
    5 end loop;
    6 end;
    7 /
    PL/SQL procedure successfully completed.
    SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
    2 from user_segments
    3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
    4 group by segment_name;
    SEGMENT_NAME
    SOTRAGE_CONSUMED
    OOL_SAMPLE
    6420K
    SAMPLE
    70K
    SQL> delete sample;
    1000 rows deleted.
    SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
    2 from user_segments
    3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
    4 group by segment_name;
    SEGMENT_NAME
    SOTRAGE_CONSUMED
    OOL_SAMPLE
    6420K
    SAMPLE
    70K
    SQL> commit;
    Commit complete.
    SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
    2 from user_segments
    3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
    4 group by segment_name;
    SEGMENT_NAME
    SOTRAGE_CONSUMED
    OOL_SAMPLE
    6420K
    SAMPLE
    70K
    SQL> begin
    2 for i in 1..1000
    3 loop
    4 insert into sample values (i, rpad('some data', 4000));
    5 end loop;
    6 end;
    7 /
    PL/SQL procedure successfully completed.
    SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
    2 from user_segments
    3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
    4 group by segment_name;
    SEGMENT_NAME
    SOTRAGE_CONSUMED
    OOL_SAMPLE
    9616K
    SAMPLE
    70K
    SQL> truncate table sample;
    Table truncated.
    SQL> select segment_name, round(sum(bytes)/1024, 2) || 'K' as sotrage_consumed
    2 from user_segments
    3 where segment_name in ('SAMPLE', 'OOL_SAMPLE')
    4 group by segment_name;
    SEGMENT_NAME
    SOTRAGE_CONSUMED
    OOL_SAMPLE
    20K
    SAMPLE
    10K

Maybe you are looking for

  • No "Clam shell" mode with MBP?

    I have used powerbook with an external display and mouse with the lid closed (clam shell mode -as they call it). But when I try the same with MBP, I get the display for a few seconds and the mouse stops responding and the system seems to sleep. Wakin

  • Problem with ALV amount field display

    hi friend!! i have a editable ALv out put and in that i am displaying Amount and quantity field. In O/p if i enter 100 its taking as 100,00 .Please tell me how to correct the same. Plz help me

  • Automate selection of Clipping Path?

    I'm trying to create a droplet that will strip out the background of an image using the active Clipping Path regardless of the path's name (similar to the way InDesign automatically selects the active Clipping Path and ignores the other paths. So far

  • Exporting large excel file exception

    Hello- I am using Jasper reports within a j2ee application to generate an excel file, and this file is written on the reponse outputstream. It is deployed as a web application on Oracle application server 10g When the generated xls file is large like

  • Is there any app that will  let me  listen music through bluetooth headset

    Is there any Iphone App that will let me listen music through my bluetooth headset.