How to delete a table in spite of a Reference...

Hi,
i have a little Problem...
I made two tables:
CREATE TABLE one(
NR INTEGER,
xyz INTEGER REFERENCES two(abc),
PRIMARY KEY (NR)
CREATE TABLE two(
abc INTEGER,
jhg CHAR(3),
PRIMARY KEY (abc)
Now i want to delete table two:
DROP TABLE two;
But then there comes the following error message(in German):
DROP TABLE two
FEHLER in Zeile 1:
ORA-02449: Eindeutige und Primärschlüssel in Tabelle von Fremdschlüsseln referenziert
It is because a Primary Key in table references to a Foreign Key...
How can i drop the database?

Use the CASCADE CONSTRAINTS clause.
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9003.htm
C.
Message was edited by:
cd

Similar Messages

  • ADF Desktop Integration : How to delete the table in Excel?

    Hi,
    I am using Jdev 11.1.1.3.0 and Excel 2007 for Oracle ADF DI, I had created an ADF table using pageDef file in the excel. Now I wanted to delete that table and use a different pageDef file.
    I could not find a way to delete that table.
    I deleted full row of tables and then I used different pageDef file and created a new adf table. But when I am running this version of excel, I am getting runtime exception and excel is getting corrupted.
    My question how to delete the table not corrupting the Excel.
    Thanks
    Pavan

    Pavan,,
    Welcome to OTN.
    You can delete the table by selecting the top left column (of the table) and then select delete from the ADFdi tab.
    Refer the documentation for more info.
    http://docs.oracle.com/cd/E17904_01/web.1111/e10139/get_start_dev_tools.htm#ADFDI608
    -Arun

  • How to delete parent table data even though it has child records

    hi all,
    How to delete parent table data even though it has child records.
    ex: delete from pa_request cascade constraints;
    But this command is not working .
    Regards,
    P Prakash

    833560 wrote:
    ex: delete from pa_request cascade constraints;cascade constraints is DROP table option. It can't be used with DELETE. You need to delete child rows first or drop foreign keys and recreate them with ON DELETE CASCADE. Then:
    delete from pa_request will automatically delete child rows. However, personally I don't like ON DELETE CASCADE. You can, by mistake, delete half of your database without even realizing it.
    SY.

  • How to delete a table of contents?

    It sounds like a stupid question, but I cannot delete my table of contents again? I only used the TOC in the draft, but don't need it in the final version of my document anymore. But - it sounds stupid - I cannot delete it. I marked it and hit the delete key, the back key. No more idea of how to delete the TOC. I even found no hint in the manual.
    Any tips? Thanks.

    Double-click the TOC so that it is surrounded by a dark border, then hit the 'delete' key.
    Good luck,
    Terry

  • How to DELETE condition tables in IDES

    Hi Experts,
    while practicing in IDES I have created tables in the range 501-999. I have no tables to create now. Can any one tell me how to delete the existing condition table. when I tried deleting its giving error: TABLE 911 IS REFERENCED FOR ACCESS SEQUENCE.
    Thank you
    SAHER

    Dear Saher,
    The best solution is to do as below.
    TCODE: SE11
    Database Table : T682I  --> choose DISPLAY
    CTRLSHIFTF10
    Input 911 in KOTABNR
    Execute / F8
    you will get the access sequences which use the condition table 911.
    go to v/07 of the access sequence obtained from the previous operation and
    delete the access which use condition table 911.
    Then you will be able to DELETE 911 condition table of your own.
    Please check and revert back.
    Thanks & Regards,
    Hegal  Charles

  • How to delete a table at dictionary level

    Hi All,
          i have deleted custom table zaccount from database, usin se14 transaction.
    now i want to create a new table using same name zaccount, but it is showing me error that table already exists in data dictionary. now i am trying to delete from data dictionary also, but it is giving me error that table is refrenced at multiple levels
    guys how can i forcefully delete it from datadictionary.
    thanks and regards
    Al-salfi

    Your table was active and had data right and also it was referred at various places in different contexts.
    okay now please type the table name in SE11; can you see if yes fine you caught the problem display the table do not delete directly; click on where used list to generate a list of different places where the table has been referred.
    at all those points remove the references as per the context and do not forget to activate. so once you have done that and the where used list returns no result means all references moved then again delete the table.
    You won't have any more issues with the table
    this problem happens because of the active name tab of the table that is yet present but inconsistent as the changes to the dictionary definition have been made inconsistent by your earlier efforts.

  • How to delete a table using pages without losing its content!

    I need to delete a table on my pages docuement but i dont want to lose its content. how can i proceed?

    Try this on a duplicate of your file to be sure it produces the desired results and you don’t risk your original file: Select the entire table, then Format > Table > Convert Table to Text.
    Walt

  • Solved: how to delete a table in 3.2

    some how a duplicate table appeared - how to delete it?
    silly me - simple highlight/ delete

    Use the CASCADE CONSTRAINTS clause.
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_9003.htm
    C.
    Message was edited by:
    cd

  • JDBC Adapter Sender How to delete 3 tables?

    Hi all, I need to delete records of 3 tables after the Communication Channel send the information.
    The problem is I want to put the 3 sentences in the Update SQL Statement separated with ";" but it does not work.
    This is my statement
    DELETE from table1 WHERE field1='3';DELETE from table2 WHERE field1='3';DELETE from table3 WHERE field1='3';
    This is the error in the Runtime Workbench.
    Database-level error reported by JDBC driver while executing statement 'DELETE from pruebas.SAPRCTGH WHERE DGHSTS='3'.'. The JDBC driver returned the following error message: 'java.sql.SQLException: Token . was not valid. Valid tokens: <END-OF-STATEMENT>.'. For details, contact your database server vendor.
    When I tested from Razor SQL it works fine, I do not know what more to change.
    Regards,
    Sebastián Alvarez

    Hi all.
    Thank you very much for your answers.
    I'll try one thing, I'll create another Service Interface and in the Configuration Scenario create another Receiver Agreement, so the message will be sent to ECC and will "return" like inbound to delete the tables with 3 delete statements.
    Thank you very much to all of you.
    I'll try this and I'll tell you
    Regards

  • How to delete all TABLEs in Schema SYS which are created since 09:15?

    Unfortunately a script created lots of tables in the wrong Tablespace (=SYSTEM) and Schema (=SYS).
    How can I delete (in one DDL command) all TABLES which are created inTablespace=SYSTEM and SCHEMA=SYS
    during the last 3 hours resp. since 09:15 of 25th Sep 2011 ?
    Alternatively: How can I move these TABLEs to another Schema (e.g. ATEST) and Tablespace (USERS)?
    Is this possible with Oracle XE or only with Oracle Enterprise?
    Peter

    user559463 wrote:
    Unfortunately a script created lots of tables in the wrong Tablespace (=SYSTEM) and Schema (=SYS).
    How can I delete (in one DDL command) all TABLES which are created inTablespace=SYSTEM and SCHEMA=SYS
    during the last 3 hours resp. since 09:15 of 25th Sep 2011 ?
    Alternatively: How can I move these TABLEs to another Schema (e.g. ATEST) and Tablespace (USERS)?
    Is this possible with Oracle XE or only with Oracle Enterprise?
    PeterYou can query dba_objects and join it with dba_tables where tablespace_name='SYSTEM' , then drop the tables result of the query; the idea is to use the following query;
    SQL> select OWNER, OBJECT_NAME from dba_objects where OBJECT_TYPE='TABLE' and OWNER = 'SYS' and CREATED >= sysdate - 3 / 24;Please consider marking your questions as answered, when it is the case;
    Handle:      user559463 
    Status Level:      Newbie
    Registered:      Feb 18, 2007
    Total Posts:      583
    Total Questions:      266 (186 unresolved)Edited by: orawiss on Sep 26, 2011 4:03 PM

  • How to delete the Table Contents before inserting records into SQL table ?

    Hello Experts,
            I have a scenario where in I have to Pick up some records from SAP RFC & insert into SQL table.
            i know how to do this scenario but the proble with this is before inserting we first have to ZAP the SQL table & insert a new records. One more twist is The Triggering is happening from SAP side with Sender RFC. If this would have been from SQL Side i could have written a Stored Procedure/ Trigger & could have called this before the SENDER JDBC communciation channel picks up the Triggering event from SQL side.
    So how to do this scenarioin XI, First deleting all the Records of SQL table & then inserting the new reocrds. without using the BPM.
    Regards,
    Umesh

    hi umesh,
    you can achieve this by writing SQL query in message mapping level..
    refer this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/frameset.htm
    regards.

  • How to delete a table type

    Hi,
    I've defined a
    type reg is table of mytable%rowtype INDEX BY BINARY_INTEGER;
    reg_tab  reg;
    In my script I load some data on reg_tab
    How can I delete the data from it? I mean I'd like to do something like delete from reg_tab; after finishing to work on reg_tab
    Thanks
    Edited by: Mark1970 on 1-lug-2010 3.23

    PL/SQL tables have the following attributes that could be used on them:
    • DELETE—Deletes rows in a table.
    • EXISTS—Return TRUE if the specified entry exists in the table.
    • COUNT—Returns the number of rows in the table.
    • FIRST—Returns the index of the first row in the table.
    • LAST—Returns the index of the last row in the table.
    • NEXT—Returns the index of the next row in the table after the specified row.
    • PRIOR—Returns the index of the previous row in the table be-fore the specified row.
    In your case, you could either use
    reg_tab.delete - to delete all rows
    reg_tab.delete (n) - to delete nth row.
    To delete all rows after inspecting them one by one ... you could use the COUNT attribute in a FOR loop similar to this...
    FOR idx in 1 .. reg_tab.COUNT
    LOOP
    -- do necessary checks
    -- reg_tab.delete (idx) ;
    END LOOP;

  • How to delete internal table first 4 rows.

    Hi All,
       How can I delete First 4 rows from itab.
    Thanks and regards
    Vijaya

    hi,
    do 4 times
      if itab[] is not initial.
         DELETE itab INDEX 1.
      endif.
    enndo.
    or
    DELETE itab FROM idx1 TO idx2.
    <b>Effect</b>
    Deletes the range of lines from index idx1 to idx2 from the internal table itab. You can only use this variant with index tables (standard or sorted tables). You must specify at least one of the parameters FROM idx1 or TO idx2. If you omit the FROM parameter, the system deletes the lines from the start of the table to idx2. If you omit the TO parameter, the system deletes from line idx1 to the end of the table. The starting line idx1 must be greater than 0.
    The Return Code is set as follows:
    SY-SUBRC = 0:
    At least one entry deleted.
    SY-SUBRC = 4:
    No entries deleted.

  • How to delete empty table row in the form using formcalc

    Hi All,
    I am displaying a table in PDF which has a few empty rows in between.  I need to delete those specific rows when the form is generated, so that they do not appear on the form.
    Has anyone worked on this before? If so, can you please share the code or advise.
    Regards
    Aditi

    Hello,
    first: there MUST be same backend you get the data from right? So in this backend there is some data extraction coding, right? So the result of this coding is bad, like some unwanted extra rows are returned in the proper set of rows, right? So why don´t you change this backend coding not to return the unwanted rows?
    IF that is not possible (I don´t believe this!), but just to describe other possibilities, you can place a script on the row subform event like initialize and test if there is something missing there and if so, set the presence of such a row to hidden.
    JS: If (this.fieldA.rowValue == "") { this.presence = "hidden"; }
    Regards, Otto

  • How to delete a table row in the context?

    Hi,
    I've got a table in my context that I access with <TABLE-NAME>-<TABLE-COLUMN>[index].
    For example <TABLE-NAME>-<TABLE-COLUMN>.dim delivers the amount of entries in this table.
    Now I want to delete a specific row in this table without any ABAP-code. Is there a possibility to do this?
    I tried to set the .dim = <old dimvalue - 1>, but the row seems to still exist, it's just empty.
    There must be a method like 'delete', or am I wrong...?
    kr, achim

    Alexander,
    could you provide an example please?
    for example, if I have a code like this:
    `repeat j from 1 to MYTABLE-MYCOLUMN1.dim`
       MYTABLE-MYCOLUMN1[j] = "value1";
       MYTABLE-MYCOLUMN2[j] = "value2";
    `end`
    and now assume, I want to delete the last row of the table, what would it look like?
    `MYTABLE.deleteValue(MYCOLUMN1, j)` ???
    kind regards, achim

Maybe you are looking for