Deleting the contents of all tables in a schemas

hi ,
can someone tell me if there is a way of deleting the contents of all tables , without dropping any.because the schema is big and just want to empty all tables at the same time.
thanks in advance.

Hi,
>>Will they be enabled after running the script?
Well, of course they need to be re-enabled ... don't you think?
SQL> create table a (id number primary key);
Table created.
SQL> create table b (id number constraint fk_b_a references a);
Table created.
SQL> select constraint_name,status from user_constraints where table_name='B';
CONSTRAINT_NAME                STATUS
FK_B_A                         ENABLED
SQL> truncate table a;
truncate table a
ERROR at line 1:
ORA-02266: unique/primary keys in table referenced by enabled foreign keys
SQL> alter table b disable constraint fk_b_a;
Table altered.
SQL> truncate table a;
Table truncated.
SQL> select constraint_name,status from user_constraints where table_name='B';
CONSTRAINT_NAME                STATUS
FK_B_A                         DISABLED
SQL> alter table b enable constraint fk_b_a;
Table altered.
SQL> select constraint_name,status from user_constraints where table_name='B';
CONSTRAINT_NAME                STATUS
FK_B_A                         ENABLEDCheers
Legatti

Similar Messages

  • How to Delete the Content of a Table?

    Hi,
    Please, i need to modify the content of a table, but before i want to delete this content. See follow the code that is used actually:
    DELETE (pr_name_table).
    MODIFY (pr_name_table) FROM TABLE prt_table.
    MESSAGE s000(zbrx) WITH text-i02 pr_name_table.
    The ABAP Editor don't accept the expression "DELETE (pr_name_table).".
    How to delete this content???
    Best Regards,
    Daniel Sanchez

    Hi,
    Thanks for helps! The problem been resolved with this solution:
    >> Call of Call:
    IF sy-subrc IS INITIAL.
          PERFORM z_upload_table TABLES t_zpf0012 t_bkp_zpf0012
                                    USING  c_zpf0012.
    ENDIF.
    >> In the Form: (after processing of Form)
    FORM z_upload_table TABLES prt_table prt_table2
                           USING  pr_nome_table.
      IF sy-subrc <> 0.
        MESSAGE i000(zbrx) WITH text-i03 l_file.
      ELSE.
        DELETE (pr_name_table) FROM TABLE prt_table2.
        MODIFY (pr_name_table) FROM TABLE prt_table.
      ENDIF.
    Best Regards,
    Daniel Sanchez

  • Program (PL/SQL) for count the registers of all tables in a schema

    Hi...
    I create a little program , for count the registers of all tables in the schema...
    If you need , send me your email...
    Atte
    Hector

    Hi,
    You can create a script by yourself by executing the script mentioned below:
    Connect as sys or system....
    SQL> spool test.sql
    SQL> select 'select count(*) from '||owner||'.'||table_name||';' from dba_tables;
    SQL> spool off;
    Hope this helps.
    Regards,
    -Praveen.
    http://myracle.wordpress.com

  • How to delete the Contents in a transaction?

    Hi all.
    I had a definite transaction that will be run by a pgm having 5 columns in a table.Now the users dont need 2 columns .
    How can we delete the contents of that table?
    Reply soon.
    Regards,
    SSR.

    I am not 100% sure what you mean.
    Do you only want to remove the two columns from the report (assumed it is a Z-report)
    In that case if it is an ALV list, just remove the fields from the field catalog and the user won't be able to see them any more.
    If it is just a standard list, you would have to remove the write statements for those two columns.
    For standard reports there is not much you can do without doing a mod or in case of an ALV list create a variant for that user which hides the fields he doesn't want to see. The variant is an option for the Z-reports as well.
    If you are talking about fields in a database table you would like to remove (assumed that it is a Z-table, you can just remove the fields in transaction SE11. After deleting the fields you will have to use the Database Utility (SE11-Utilities-Database Object- Database Utilities - Activate and Adjust Database). This will remove the columns including the data in it from that table.
    Never remove any fields from a standard table - even deleting values out of certain columns for standard tables is a very bad idea unless you really exactly know what you are doing.
    Hope that helps,
    Michael

  • What does it mean by deleting the Content of the setup table when LO cockpi

    Hi all:
        what does it mean by deleting the Content of the setup table when LO cockpit ? why should we do it?  why set up tables ?
    Thank you very much!!!
    Edited by: jingying Sony on Jun 7, 2009 4:46 AM

    Hi Jingying Soni,
    Data sources in LO cockpit have a seperate exctraction source during full update mode and delta update mode.
    During delta update mode(when an transaction is posted in any particular application - like SD - sales orderm delivery) data is posted in application tables and updated alongside to the update table/extraction queue.
    From the extraction queue this data is further transfered to the delta queue using periodic background jobs.The data is then upladed in BW. The delta lad always reads data from this delta queue.
    However, when a full load is requested from the BW, the data is sourced by the set up table of the corresponding application.
    The setup table is loaded/initalized first. In this initialization process , it reads data frm the corresponding application tables and stores it within this table. Later BW reads from this set up table whenever full/initial load is requested.
    The process of filling set up able before full load request frrom BW is called set up run.
    Before you run a set up to fill the set up tables you need to check that the set up table is empty.
    If it is still containing data that was previously loaded in some other set up run. This data will als get loaded in BW unitinetionally/accidentally.
    So, you need to ensure that you only get the intended data in BW. This can be done by proper selections to transfer data from application tale to set up table and from setup table to BW.
    Along with this you hae to ensure that the set up table is either empty or you are using a disparate selection in the set up run and BW load which does not overlap with the previous set up runs data.
    Hope it helps,
    Best regards,
    Sunmit.

  • I a got a new phone and backed all of my stuff on to the new one can I now delete the old phone backups off I cloud without deleting the content from my phone?

    I a got a new phone and backed all of my stuff on to the new one can I now delete the old phone backups off I cloud without deleting the content from my phone?

    Yes, absolutely, but before you do, give yourself three or four days to verify that you have everything on the new phone. You also probably will not be able to delete old backup for three days anyway, I have heard that Apple places server in three days lock out after restore from backup initially started.

  • EXP: Export all tables for one user except the contents of one table

    I need to export all tables (> 100 Tables) of an user except the contents of one table. Is there a possibility to call the EXP command and exclude the one table ??
    Thanks in advance .-)
    (Oracle11G)
    Edited by: gromit on Feb 14, 2011 4:41 AM

    It is not possible to perform it from a client. Is this correct? The datapump task itself can be started from a client, but - you are right - datapump is server-based. Especially that refers to the dumpfile location, which has to be defined as DIRECTORY on the server:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e16536/dp_overview.htm#i1007107
    Werner

  • Hi. How can I delete the table without deleting the content? My pages is 5.2.2.

    Hi. How can I delete the table without deleting the content? My pages version is 5.2.2. Thank you for your help.

    There is no convert Table to text capability in Pages v5.2.2, as there was in Pages ’09 v4.3.
    You can keep the table while making the table grid vanish, leaving the existing tabular text structure. Select the table, and under the Format panel > Table tab, the following settings will produce this output. If selected, you can refine its document placement in the Arrange tab.

  • Recently my iPhone 4 has started to delete the content of messages as soon as I open them and also is changing the names of some of my contacts from the name that I give them to their email addresses and all of this is without any input from me help!

    My iPhone 4 has started to delete the content of messages automatically as soon as I open them and is also changing some of my contact names from their names to their email addresses. Help!

    I've had the same problem with the names being changed to email addresses.Did you ever find out how to stop this ?

  • Delete the content of a UDT through DI

    Hi all,
    is there a way to delete the content of UDT (delete) with DI (not to drop the table)?
    Thanks in Advance,
    Vangelis

    Hi ,
    Try this.
    Dim rsd As SAPbobsCOM.Recordset
            rsd = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
            rsd.DoQuery("SELECT T0.[Code],T0.[Name] FROM [dbo].[@USERTABLE] T0")
            Dim sCode As String
            Do Until rsd.EoF
                sCode = rsd.Fields.Item("Code").Value.ToString.Trim
                Dim oTables As SAPbobsCOM.UserTable
                oTables = oCompany.UserTables.Item("USERTABLE")
                If oTables.GetByKey(sCode) = True Then
                    oTables.Remove()
                End If
                oTables = Nothing
                rsd.MoveNext()
            Loop
    andy.
    Edited by: Andy Quipit Sayus on Aug 1, 2010 5:27 PM

  • Unable to delete the contents of the Cube.

    Hi All,
      I am trying to delete the contents of the cube selecting the option<b>(Delete Data</b>) from the context menu of the cube.
    I am getting the error message as
    Database Table /BI0/F0PA_C01 Could not be deleted or recreated.
    is there a way to solve this issue.
    Thanks & Reegards
    Chetana. S

    Hello Chetana,
    If you have to delete the data from the cube and then again schedule full updates, following are the steps:
    (please dont bother about the present error and go ahead with the following steps):
    1. right click on cube-> Manage. In the requests tab, select all requests and click on the delte icon below.
    click on refresh till you dont see any requests on this screen.
    2. if you had some initialisation loads done before in this cube, go to the infopackage for the init loads.
    In the infopackage change screen, go to the menu scheduler-> initialisation options for source system-> delete the request(if any).
    3. the above steps will ensure that all data is deleted from the cube. you can then go ahead and load full update data loads on the same( if you are sure you want to go ahead with the full update option).
    Hope this helps..
    thanks,
    (dont forget to assign points for helpful answers...)

  • How to delete the data in a table using function

    hi all,
    i need to delete the data in a table using four parameters in a function,
    the parameters are passed through shell script.
    How to write the function
    Thanks

    >
    But the only thing is that such function cannot be used in SQL.
    >
    Perhaps you weren't including the use of autonomous transactions?
    CREATE OR REPLACE FUNCTION remove_emp (employee_id NUMBER) RETURN NUMBER AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    tot_emps NUMBER;
    BEGIN
    SELECT COUNT(*) INTO TOT_EMPS FROM EMP3;
    DELETE FROM emp3
    WHERE empno = employee_id;
    COMMIT;
    tot_emps := tot_emps - 1;
    RETURN TOT_EMPS;
    END;
    SQL> SELECT REMOVE_EMP(7499) FROM DUAL;
    REMOVE_EMP(7499)
                  12
    SQL> SELECT REMOVE_EMP(7521) FROM DUAL;
    REMOVE_EMP(7521)
                  11
    SQL> SELECT REMOVE_EMP(7566) FROM DUAL;
    REMOVE_EMP(7566)
                  10
    SQL>

  • How to delete the data from partition table

    Hi all,
    Am very new to partition concepts in oracle..
    here my question is how to delete the data from partition table.
    is the below query will work ?
    delete from table1 partition (P_2008_1212)
    we have define range partition ...
    or help me how to delete the data from partition table.
    Thanks
    Sree

    874823 wrote:
    delete from table1 partition (P_2008_1212)This approach is wrong - as Andre pointed, this is not how partition tables should be used.
    Oracle supports different structures for data and indexes. A table can be a hash table or index organised table. It can have B+tree index. It can have bitmap indexes. It can be partitioned. Etc.
    How the table implements its structure is a physical design consideration.
    Application code should only deal with the logical data structure. How that data structure is physically implemented has no bearing on application. Does your application need to know what the indexes are and the names of the indexes,in order to use a table? Obviously not. So why then does your application need to know that the table is partitioned?
    When your application code starts referring directly to physical partitions, it needs to know HOW the table is partitioned. It needs to know WHAT partitions to use. It needs to know the names of the partitions. Etc.
    And why? All this means is increased complexity in application code as this code now needs to know and understand the physical data structure. This app code is now more complex, has more moving parts, will have more bugs, and will be more complex to maintain.
    Oracle can take an app SQL and it can determine (based on the predicates of the SQL), which partitions to use and not use for executing that SQL. All done totally transparently. The app does not need to know that the table is even partitioned.
    This is a crucial concept to understand and get right.

  • 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 the content of an existing site and start from scratch

    I choose the wrong template when i initially setup my bc hosting for a customer how do i change the template i choose in site options and select a different one . I need to delete everything and stat over. I tried deleting everything under the develop area but lost my module style sheets for the eCommerce package. please help. Im on the business catalyst platform

    Hi Joey,
    Good to see that we are not the only ones running into this problem.
    Seems as there is no standard solution available.
    We have developed our own process type which deletes the content of the Open Hub table.
    Thanks,
    Klaus

Maybe you are looking for

  • Install Anywhere error!!

    Hi, I have just installed "InstallAnywhere" and am using NetBeans IDE to develop my code. I created a very simple gui (just the frame) and tried to create an executable with InstallAnywhere but I got this error: Unable to locate the applications main

  • Quicktime Slideshow Movie Won't Play Music

    I created a slideshow using my iPhoto 5.0.4 then exported it to a movie as Quicktime, with music. It plays beautifully on my machine. I burned it to a CD and sent it to someone with the identical Mac (a PowerBook G4) and he couldn't play it on his SA

  • Ultiboard - connecting pins to each other on footprint

    I have a shielded connector with two mounting screws.  Both screws are connected to the shield, so if I want to ground it I only have to connect my GND net to one of the hole pads.  It doesn't matter which one, because they are common to the shield.

  • Can we change the DOCTYPE written out by the af:document component?

    (JDeveloper 11.1.1.1.0) ADF Faces pages that use the af:document component produce (X)HTML pages with their content type set to <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">. My style-savvy col

  • ZCM 11.2.4

    Hi, I need to install a new server with 11.2.4 (same as my existing ZCM server) to be able to migrate my old x86 server to the new x64. Where can I find ZCM 11.2.4 update ? I only see 11.3.0a. Thanks.