Please suggest solution for deletion of  all rows in table at a time

Suggest me pl/sql code for a push button in form to ‘delete entire rows’ in a table.
BEGIN
LOOP
DELETE
FROM mytable(say table name)
WHERE ROWNUM < 20000;
EXIT WHEN SQL%ROWCOUNT = 0;
COMMIT;
END LOOP;
END;
I wrote this code but not deleted .
Execute immediate ‘truncate table <tablename>’; this code too not working.
What my need is ‘ I don’t want to put entire block fields in the form, just I want to put a push button and when I pressed it must delete all rows in a particular table.
That I want to delete all rows form builder runtime not by entering sql.8.0 and then there delete the rows.
thanks in advance
prasanth a.s.

to delete all records in a table, if you want to get good performance, then use:
FORMS_DDL('TRUNCATE TABLE your_table_name');
It is better than use DELETE FROM TABLE_NAME. But if you have condition in where clause, then you have to use DELETE FROM ...

Similar Messages

  • PDF file is not opening in ipad mini,pdf file does not show any containts in file ,tried all options , please suggest solution

    Hi Friends
    i am not able to read some of the important  pdf from ipad mini,pdf is opening but not showing any containts,i tried all suggestion priviously given in discussion forum (reinstallation,formatting,system upgrade,mailing pdf document  )
    can any one kindly suggest solution for above problem ?

    Try and install free Adobe Reader to save and read your PDF files.
    https://itunes.apple.com/sg/app/adobe-reader/id469337564?mt=8

  • Please provide Solution for Customer Condition Group when defining 2 Chrt's

    Dear Guru's,
    Please provide Solution for Customer Condition Group when defining 2 Charecters or 2 digits.
    I have Completed all possible Combinations like AA,BA,1A,A1,01 to 99 etc.. Total Enteries reach upto 1200+ so I am unble to find no more Combinations( without Special Characters & no chance to increase other than 2 Char/digt)..
    Any body Suggest me any Good Combinations or Proper Alternative....
    Thanks,
    Panduranga

    Hi panduranga
    A Customer Condition Group is maintained in only 2 digits .If you want to go for more than 2 digits then you need to take the help of ABAP'er and you need to go for enhancement
    Regards
    Srinath

  • I cannot access Content Library in iMovie - Content Library doesn't show on the iMovie screen and is greyed out when accessed through "windows" tab at the top. Also unable to update the projects/events (a suggested solution for a similar question).

    I cannot access Content Library in iMovie - Content Library doesn't show on the iMovie screen and is greyed out when accessed through "windows" tab at the top. Also unable to update the projects/events (a suggested solution for a similar question). I haven't had this issue before, I have always used the content library on the screen but haven't used this for about a month. How can I make the Content Library available?

    Thanks so much! I am backing up the entire computer now with an external hard drive - this should be fine right? And surely if I am backing up the whole computer these projects/videos will be backed up too? I wasn't sure how to do this any other way and I am clearly not great with tech issues. Once this is done and I am sure my projects/videos are safe I will do the delete and reinstall bit. Thanks for taking the time to help

  • All rows in table do not qualify for specified partition

    SQL> Alter Table ABC
    2 Exchange Partition P1 With Table XYZ;
    Table altered.
    SQL> Alter Table ABC
    2 Exchange Partition P2 With Table XYZ;
    Exchange Partition P2 With Table XYZ
    ERROR at line 2:
    ORA-14099: all rows in table do not qualify for specified partition
    The exchange partition works correct for the first time. However if we try to exchange 2nd partition it gives the error.
    How do i solve this error?
    How do i find rows which are not qualified for the specified portion. is there a query to find out the same?

    stephen.b.fernandes wrote:
    Is there another way?First of all, exchange is physical operation. It is not possible to append exchanged data. So solution would be to create archive table as partitioned and use non-partitioned intermediate table for exchange:
    SQL> create table FLX_TIME1
      2  (
      3  ACCOUNT_CODE VARCHAR2(50) not null,
      4  POSTING_DATE DATE not null
      5  ) partition by range(POSTING_DATE) INTERVAL(NUMTOYMINTERVAL(1, 'MONTH'))
      6  ( partition day0 values less than (TO_DATE('01-12-2012', 'DD-MM-YYYY') ) )
      7  /
    Table created.
    SQL> create index FLX_TIME1_N1 on FLX_TIME1 (POSTING_DATE)
      2  /
    Index created.
    SQL> create table FLX_TIME1_ARCHIVE
      2  (
      3  ACCOUNT_CODE VARCHAR2(50) not null,
      4  POSTING_DATE DATE not null
      5  ) partition by range(POSTING_DATE) INTERVAL(NUMTOYMINTERVAL(1, 'MONTH'))
      6  ( partition day0 values less than (TO_DATE('01-12-2012', 'DD-MM-YYYY') ) )
      7  /
    Table created.
    SQL> create table FLX_TIME2
      2  (
      3  ACCOUNT_CODE VARCHAR2(50) not null,
      4  POSTING_DATE DATE not null
      5  )
      6  /
    Table created.
    SQL> Declare
      2  days Number;
      3  Begin
      4  FOR days IN 1..50
      5  Loop
      6  insert into FLX_TIME1 values (days,sysdate+days);
      7  End Loop;
      8  commit;
      9  END;
    10  /
    PL/SQL procedure successfully completed.
    SQL> set linesize 132
    SQL> select partition_name,high_value from user_tab_partitions where table_name='FLX_TIME1';
    PARTITION_NAME                 HIGH_VALUE
    DAY0                           TO_DATE(' 2012-12-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
    SYS_P119                       TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
    SYS_P120                       TO_DATE(' 2013-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')
    Now we need to echange partition SYS_P119 to FLX_TIME2 and then echange FLX_TIME2 into FLX_TIME1_ARCHIVE:
    To exchange it with FLX_TIME2:
    SQL> truncate table FLX_TIME2;
    Table truncated.
    SQL> alter table FLX_TIME1 exchange partition SYS_P119 with table FLX_TIME2;
    Table altered.To exchange FLX_TIME2 with FLX_TIME1_ARCHIVE we need to create corresponding partition in FLX_TIME1_ARCHIVE. To do than we use LOCK TABLE PARTITION FOR syntax supplying proper date value HIGH_VALUE - 1 (partition partitioning column is less than HIGH_VALUE so we subtract 1) and then use ALTER TABLE EXCHANGE PARTITION FOR syntax:
    SQL> lock table FLX_TIME1_ARCHIVE
      2    partition for(TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') - 1)
      3    in share mode;
    Table(s) Locked.
    SQL> alter table FLX_TIME1_ARCHIVE exchange partition
      2    for(TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') - 1)
      3    with table FLX_TIME2;
    Table altered.
    SQL> Same way we exchange partition SYS_P120:
    SQL> truncate table FLX_TIME2;
    Table truncated.
    SQL> alter table FLX_TIME1 exchange partition SYS_P120 with table FLX_TIME2;
    Table altered.
    SQL> lock table FLX_TIME1_ARCHIVE
      2    partition for(TO_DATE(' 2013-01-02 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') - 1)
      3    in share mode;
    Table(s) Locked.
    SQL> alter table FLX_TIME1_ARCHIVE exchange partition
      2    for(TO_DATE(' 2013-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN') - 1)
      3    with table FLX_TIME2;
    Table altered.
    SQL> Now:
    SQL> select  count(*)
      2    from  FLX_TIME1 partition(day0)
      3  /
      COUNT(*)
             8
    SQL> select  count(*)
      2    from  FLX_TIME1 partition(sys_p119)
      3  /
      COUNT(*)
             0
    SQL> select  count(*)
      2    from  FLX_TIME1 partition(sys_p120)
      3  /
      COUNT(*)
             0
    SQL> select partition_name from user_tab_partitions where table_name='FLX_TIME1_ARCHIVE';
    PARTITION_NAME
    DAY0
    SYS_P121
    SYS_P122
    SQL> select  count(*)
      2    from  FLX_TIME1_ARCHIVE partition(day0)
      3  /
      COUNT(*)
             0
    SQL> select  count(*)
      2    from  FLX_TIME1_ARCHIVE partition(sys_p121)
      3  /
      COUNT(*)
            31
    SQL> select  count(*)
      2    from  FLX_TIME1_ARCHIVE partition(sys_p122)
      3  /
      COUNT(*)
            11
    SQL> SY.

  • HT201406 my ipad touch screen is not working please give solution for it.

    my ipad touch screen is not working please give solution for it.
    i have connected ipad to itunes and done it restore seetings then also my touch is not working but
    when i connected ipad to i tunes inside functions are working properly but touch screen is not working what can i do

    If you have a screen protector on the iPad's screen, try removing it. If you don't or that doesn't help, and restoring the iPad to factory settings has not corrected the problem, then the iPad probably has a hardware problem and will need to be taken or sent to Apple for replacement.
    Regards.

  • How to get all rows in table to red using alternate rows properties option

    How to get all rows in table to red using alternate rows properties option

    Hi Khrisna,
    You can get all rows red by selecting the color red in the "Color" and "frequency" to 1 under the "Alternate Row/Column colors".
    I tried doing it and the colors freaked me out (all red) :-D
    Kindly tell me if im missing something.
    Regards,
    John Vincent

  • How can i Delete the data from three tables at a time  using same key.

    I am New to Oracle ADF, I have a Requirement Like these, I have three tables like Employee,Salaries,Teams all of these are having one common EmpNo as common attribute, I have Search form these will return the all the employees related to that search query, when i click on Delete button the particular employe Data should delete from all the three tables based on the EmpNo.
    Any Help is appreciable..

    1) The easiest way is to mark the foreign key constraints from SALARIES to EMPLOYEES and from TEAMS to EMPLOYEES as ON DELETE CASCADE. The DB server will then delete the necessary rows whenever you delete an employee row.
    2) Another way is to implement a Before-Delete-Row DB trigger on the EMPLOYEES table where you can delete the related rows in the other tables (have in mind, that if you have foreign keys you may get a Mutating Table Exception, so this approach might be not very good).
    3) An ADF way is to implement a custom EntityImpl class for the Employee entity and to override the remove() method where you can lookup the related TeamMember and Salary entities (through EntityAssoc accessors) and invoke their remove() methods too.
    4) Another ADF way is to implement a custom EntityImpl class for the Employee entity and to override the doDML() method where you can delete the necessary rows in SALARIES and TEAMS tables through JDBC calls whenever a DELETE operation is being performed on the underlying Employee entity.
    Dimitar

  • How to restrict deletion of all rows in a child table(Ex:all emps in a Dept

    I have use case where a table which has a child ID, parent ID and some other columns. I want to restrict deletion of all children of a parent.
    I tried a 'before delete' trigger as follows and ended up with a mutating table error-ORA-06512 Any suggestions on how this can be done.
    Following is the trigger I tried:
    create or replace
    TRIGGER C_MODULE_EXEC_SELECT
    BEFORE DELETE ON C_MODULE_EXEC_SELECT FOR EACH ROW
    DECLARE
    rowcnt number;
    BEGIN
    SELECT COUNT(MODULE_CODE) INTO rowcnt FROM C_MODULE_EXEC_SELECT WHERE EXEC_PLAN_ID=:OLD.EXEC_PLAN_ID AND MODULE_CODE != :OLD.MODULE_CODE;
    IF rowcnt = 0 THEN
         RAISE_APPLICATION_ERROR(-20000, 'Cannot remove all subject areas from a execution plan');
    END IF;
    END;
    Thanks,
    Sireesha

    What you have written is clear but it seems to me your rule, as stated, is not valid. At the point where you insert a parent, there will initially be no children. How is that different from any other parent with no children? Is there a guarantee, after inserting a parent, that a child record will be inserted? In one millisecond? One hour? One-hundred years?
    And why is the deletion of the last child record any less valid than the deletion of any other child record? Perhaps the rule should be ... when the last child record is deleted the parent should be deleted too. This would be far easier to enforce.
    Delete the children and each time check to see if the parent can be deleted. If an exception is raised then it can't be.

  • Logic for Deletion of a row is not reflecting in DEV instance

    Hi ,
    I have a method in AM attached to a Search screen which has logic to delete rows from 3 different VOs.
    1. VO for selecting the rows from Details table.
    2. VO for selecting the rows from Master table.
    3. VO for holding the rows of results tables.
    The results table displays rows from both master table and details table. On selecting a row for delete in results table , the remove() method is being called to remove rows from the three VOs in the same order mentioned above.
    This logic works perfectly in my local setup. The commit was initially not getting recognized. So , we included the line "JDBC\:processEscapes=true" after which delete and commit started working fine in my local setup.
    But the same code does not work in the DEV instance. Can anyone please suggest what can be done in such a case.
    Thanks,
    Chandrika

    Thanks for your reply,
    As we did registration again now for the problematic server autoreaction method is now visible in RZ20
    But it is not picking up the alert for the scenarios. Also found other 2 server is also giving error while connection test below is screen shot.
    I checked the log file. Foundthe agent lock is not getting updated.
    and error log details
    [Thr 4396]
    Fri Jun 27 08:12:44 2014
    INFO: Register central system PSM.
    INFO: Register central system: System PSM already registered as central system. Trying to update...
    ERROR: Register central system: cannot stop agent, because the agent is restarting.
    Fri Jun 27 08:44:56 2014
    INFO: Unregister central system PSM.
    ERROR: Unregister central system: cannot stop agent, because the agent is restarting.
    [Thr 7084]
    Fri Jun 27 08:52:07 2014
    INFO: Register central system PSM.
    INFO: Register central system: System PSM already registered as central system. Trying to update...
    ERROR: Register central system: cannot stop agent, because the agent is restarting.
    Can you please check and let me know the fix to resolve the error.

  • Please suggest Partition for following example urgent

    Hi all
    my table have one column Year
    I need to create 2 partition year_1,year_2 for year column but synario is
    If 2004 ,2005 2004 must go into year_2 and 2005 must go into year_1
    also for 2006 must go into year_1 and 2005 into year_2
    Please suggest type of partition if possible with example
    Regards

    > I need to create 2 partition year_1,year_2 for year column
    <snipped>
    An exceedingly bad idea to partition a date range like this - stuff some data into one partition and some other data into another partition, without any logical condition that governs what data must go into which partition.
    So do not create just two partitions. Decide on the partitioning strategy you want based on criteria such as:
    a) volume of data
    b) access to data (i.e. predicates used)
    c) data management requirements (e.g. removing or aging old data from the table)
    Satyaki's example shows you the basics of how this should be done. A partition by year. Or, monthly or even daily partitions. And possibly even sub-partitions.
    You will be achieving nothing in terms of performance or data management by trying to stuff date ranged data into two partitions as you are indicating.
    As for future yearly partitions? Create yearly partitions for the next 10 years. Or 20 years. Or 100 years. They will be empty. Small space footprint. Ready to be used.
    In this case there are relatively few (yearly) partitions - far less than having to deal with 1000's of daily partitions where it is often a better idea to automate adding of new partitions using a DBMS_JOB.

  • Please find solution for this problem ...pl/sql table problem

    Hi
    I am using forms 6i. Now i am having a form to insert purpose. which contain 70 fields to enter. that is there are 10 screens contain 10 fields each. Each screen contains two buttons 'next' and 'previousscreen'. Now what my problem is after entering the 20 fields and i am entering 27th field in 3rd screen i noticed that i did a mistake in 2nd field value which is in 2nd screen. when i moved from third scrren to first screen by using pushbutton previous screen. all data in second and third screen has gone. For this i used a pl/sql table and put the code in 'nextscreen' button. the code is
    declare
    type emptabtype is table of :emp%rowtype
    index by binary_integer;
    emptab emptabtype;
    begin
    insert into emptab values(:emp.eno,:emp.ename.....so on);
    commit;
    end;
    The above is the approach i used. but not successful. Is the approach followed by me is correct (I strongly believe that some mistake is there). If not, pls tell me what to do for my problem. What my ultimate requirement is i should not loss the data entered in the fields even when i modify any data on any screen.
    I hope you people understand my problem
    Thanks in Advance,
    bigginner in forms
    prasanth a.s.

    Hi there,
    I have a form which has over 150 fields (from 4 tables). I have used a tab-canvas form to handle all the input - 2 screens for the fields from the first table and 1 screen each for the remaining 3 tables. I can navigate between the tabs without trouble. When everything is done, the contents of the screens are saved to the database via a menu item. Most of the fields are database items.
    My point is that Oracle Form has no problems in handling
    such processing and I am only using its normal default capabilities.
    What type of canvas are you using? There should be no reason to use buttons to navigate betweeen screens if you are using a tab-canvas form. You should not have to use PL/SQL table to handle the data if the fields are normal database columns.
    Regards,
    John

  • Problem with deleting a new row in table

    Hi
    I'm using JDev 11.1.1.2.0
    Please someone tell me if he/she experience the same issue:
    - I have an simple entity with PrimaryKey other than RowID. I have a ViewObject on top of the Entity.
    - From this view I create Editable table and add createInsert and Delete buttons.
    This is one of the most common scenarios.
    Now when I click createInsert a new blank row is added to the table. I enter it's primary key (because is mandatory) and move selection to some other row (let say X).
    When I go back and select my new Row and press Delete -> it is not deleted but the row X is deleted.
    This is because the table is not refreshed and it cant select the new row.
    How can I deal with this problem?
    Thanks
    Angel

    I tried with adding my selectionListener method like this:
            Object next = selectionEvent.getAddedSet().iterator().next();
            Object prev = selectionEvent.getRemovedSet().iterator().next();
            System.out.println(prev + " " + next);      
            DCBindingContainer bc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding iter = (DCIteratorBinding)bc.get("TestDopSyotvIterator");
            FacesCtrlHierBinding object1 = (FacesCtrlHierBinding)bc.get("TestDopSyotv");
            FacesCtrlHierBinding.FacesModel collectionModel = (FacesCtrlHierBinding.FacesModel)object1.getCollectionModel();
            collectionModel.makeCurrent(selectionEvent);I add new row, enter data and change selection. Then the system.out prints the right keys of the rows.
    But when I go back to the new added row, the system.out prints "null" for the "next" value (that means the rowKey was lost).
    Any ideas how to fix this?

  • How to Enable All rows in Table

    Hi Friends,
    I have to create table in firstview. My requirement is I will give 4 or 5 inputs at a time then click on save button that input data will be saved in ECC system
    So in First View I have to create table by using apply template that time I have to pass all u201Cinput filedsu201D.
    In that time the table having only first row editable and remaining rows will be disable. I need all rows in enable in that Table.
    Or
    My Requirement is how to enter multiple input detals at a time. At a time customer enter 4 or 5 inputs click on submit buttion that data will be saved in ECC System.
    How to do this work.
    Regards
    Vijay Kalluri
    Edited by: KalluriVijay on Mar 5, 2010 12:34 PM

    Hi Vijay,
    The number of editable rows in the table would be equivalent to the number of elements the node to which the table is bound contains. In your case, it might be only having one element for the node as so you can only see that row enabled while the rest of the rows are disabled. So, in case you want even the rest of the rows to be enabled then, you should just create more elements for the same node (with or without setting any of the attribute within).
    Then, when you need to use the values in the table (existing or modified or new values), then loop through the table node and check if all the attributes within the node or the mandatory field value for the table entry is not nul, otherwise, ignore the corresponding table node element.
    Rather, I would suggest you to have a button say "Add Rows" and within the action of the node, I would like you to create one more element for the table at the end. This way, you wont have any unnecessary element in the table to be checked for not holding any value.
    Regards,
    Tushar Sinha

  • Get all Rows in table

    Hi All
    I'm developing web app using jd 11.1.1.4
    In my web page I have a table with several rows. In one column I have a selectOneChoice to select the status.
    I want to change status of several records and approve them at once.
    How to iterate through all rows of the table in the backing bean.
    Thanx

    the iterator rowset will have all the rows..
    DCIteratorBinding dciter;
    BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
    dciter = (DCIteratorBinding) bindings.get("findAllTestAndryIter");
    RowSetIterator rs = dciter.getRowSetIterator();
    for(Row r : rs){
    r.setAttribute("Status", "Y");
    }

Maybe you are looking for