doubt everything by removing the child records

Hi people,
I have a table with following structured Teg.

SQL > DESC TEG
Name Null? Type
----------------------------------------------------- -------- ---------------
A NON NULL NUMBER (38)
B NUMBER (38)
C NUMBER (38)


where A column is the primary key column and column B is foreign key
According to column A column.


SQL > select * from teg.

A, B AND C
---------- ---------- ----------
10 10 30
20 10 40
30-20-90

now, these are the data present in this table.now I want to delete a recording of teg, where A = 10.but I couldn't do because I have child records according to values.so primary key, I decided to delete records by using the statement.

SQL > delete from the teg where b = 10;
Remove from the teg where a = 10
*
ERROR on line 1:
ORA-02292: integrity constraint (VID. TEGFK) violated - book of the foundling

but throws with this error.then I tried to remove another
Save the Declaration,

SQL > delete from the teg where b = 20;

1 line removal.

but I got that last removed the table.why file I couldn't remove data using State 'WHERE B = 10'.but able to delete the record
with "WHERE even if the parent record is A found.pls = 20' help me."


Concerning
VIDS

vidusnat wrote:
SQL > SELECT * FROM TEG.

A, B AND C
---------- ---------- ----------
10 10 30
20 10 40
30-20-90

as I could delete record of TEG by issuing,

REMOVE FROM THE TEG WHERE B = 20;

Yes, this means that you remove a record of a value in column A of 30 (for B = 20) - there is no trace of the child who refers to this record with a value in column A of 30, so you can REMOVE that record without problem.

vidusnat wrote:

But why I couldn't delete records to aid,

REMOVE FROM THE TEG WHERE A = 10;

10 and 20 are present in the primary key column A.but why am not able to delete the address of the child column B.I don't know no other integrity constraints have been create except between column A and B.pls suggest me.

There must be a record in the referencing table that has a foreign key value 10 - don't forget on the deletion of a record of the child in column B, you can delete an entire record, not a partial record. The table that references must be another table, it is not another column in the same table -it does not work like that. A foreign key between tables , not within the same table.

Run this code, and you'll see what other table of the foreign key means:

SELECT table_name
   FROM ALL_CONSTRAINTS
 WHERE CONSTRAINT_NAME  = 'TEGFK'

That will tell you the other table that has a foreign_key associated with your table TEG.

Tags: Database

Similar Questions

  • Remove the child window Parent using WIN API

    Hi all

    For a parent-child relationship between two screws using the User32.dll I use the SetParent function and pass the handle of the parent VI and VI child to this function. Now, after this relationship has been established, I want to remove the child from the parent window and use it as an independent VI using WIN API. Can someone help me on this?

    Thanks in advance!

    Fragger Fox!

    Hi Fragger Fox,

    I think that it should be possible, if you assign a new parent to the child. Maybe this works if you assign the desktop as a new parent.

    It will be useful.

    Mike

  • extract the child records of their specific parent folder

    Hi all

    The following query shows these records that I wanted to but I want to extract the child records with their specific parent folder for the new scenario. I want to choose which set of these documents that belong to store under inventory.

    Select rt.transaction_id, rt.parent_transaction_id parent_id, trunc (rt.transaction_date) receipt_date

    (, rsh.receipt_num, rsh.attribute13 grn_num,rt.subinventory,SYS_CONNECT_BY_PATH(rt.subinventory,'/') "road".

    of rcv_transactions rt

    rcv_shipment_headers rsh

    where rt.shipment_header_id = rsh.shipment_header_id

    start with rt.parent_transaction_id =-1

    connect prior rt.transaction_id = rt.parent_transaction_id

    Brothers and SŒURS of ORDER BY rt.subinventory

    .

    child-parent_records.jpg

    Please help to extract.

    Hello

    If all you want are the lines with sub_inventory = "STORE", and their ancestors, then you can simply do this:

    SELECT *.

    OF subinventory

    START WITH sub_inventroy = "STORE".

    CONNECTION BY transaction_id = parent_id PRIOR

    ORDER BY transaction_id;

    No need of subqueries or analytical functions.  You can even no need for the ORDER BY clause.

  • Problem with remove the child to

    I have an empty clip that contains text and media for executives in a lesson called content_mc

    I load dynamically in a text box and then other things such as graphics, videos and other swf files...

    before you begin to insert swf files, it worked very well, but it was just the text on the screen, now that I have other media, it removes "randomly" children and I can't understand why it's what I use:

    for (var c:uint = 0; c < content_mc.numChildren; c ++) {}
    trace (c + ":" + content_mc.getChildAt (c) .name);
    content_mc.removeChildAt (c);
    }

    Anyone know what is happening?

    Figured it out!

    OK, for those of you who want the answer to this, but don't want to pay for it...

    I realized that when you use the removeChildAt() she removes the child of the index number... so the way I did it was like this:

    for (var c:uint = 0; c
    trace ("-" + content_mc.getChildAt (c) .name + "(" + c + "')");
    content_mc.removeChildAt (c);

    doing this, he was first to remove the child at index 0. and what made flash NOW are "slides" down an index... so the element that was at index 1 is now 0, the element at index 2 is now 1, etc... so when I arrived at the last, it would not remove it because it was no longer there...

    but change to it (instead of using the variable c, you have just put 0 in the index box):
    for (var c:uint = 0; c
    trace ("-" + content_mc.getChildAt (0) .name + "(" + c + "')");
    content_mc.removeChildAt (0);

    solved the problem :)

  • remove the last record from the plsql table

    TYPE r_LOOPElement IS RECORD (TermID   NUMBER 
                                          );
    
    TYPE t_LOOPType IS TABLE OF r_LOOPElement INDEX BY BINARY_INTEGER;
    i_CustomerLoop      t_LOOPType ;
    
    i_CustomerLoop(1).TermID=1;
    i_CustomerLoop(2).TermID=2;
    i_CustomerLoop(3).TermID=3;
    Under certain conditions, I need to remove the last record from i_CustomerLoop

    whichi s the best way to do it. because I sometimes get duplicates for TermID in this plsql table.

    Hello

    See [removing items from Collection (DELETE method) | http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/collections.htm#CJAFGFIG]

    Kind regards

  • A-team Mobile persistence Accelerator - Insertion into the child records for a Parent-child data objects

    Hello team

    We use persistence Mobile Accelerator for our application of MAF. We must build couple of REST services for it (Fetch, Create, Update), problem is we are able to insert/update of the parent records but we are not able to create child records.

    It seems when we ask the operation of creation in the book of the child, is no new line for child is created.

    Here is the screenshot of the data control wizard:

    parent.pngchild.png

    Here is the task (update) and desktop (create) JSON format (TaskAssignment is the address of the child)

    PUT the task:

    {

    'Task': {}

    'ACTIVITY_ID': 100,.

    'PROJECTID': 100,.

    'ACTIVITY_NAME': "string",.

    'DESCRIPTION': 'string ',.

    'PARENT_ACTIVITY_ID': 100,.

    'STATUS': "string",.

    'PRIORITY': "string",.

    'PERCENTAGE_COMPLETE': 100,.

    "START_DATE": "2008-09 - 28 T 21: 49:45.

    "END_DATE": "2014-09 - 18 T 19: 18:33.

    'ETA': ' 2006-08 - 19 T 13: 27:14 - 04:00 ",".

    'ESTIMATED_HOURS': 100,.

    'ACTUAL_HOURS': 100,.

    'OWNER_USER_ID': 100,.

    'CREATED_BY': "string",.

    "CREATION_DATE': ' 2009-05 - 16 T 08: 42:28"

    'LAST_UPDATED_BY': 100,.

    'LAST_UPDATE_DATE': ' 2003-08 - 08T 20: 18:37 - 04:00 ",".

    "TaskAssignment": [{}

    'ASSIGNMENT_ID': 1000.00.

    'PROJECT_TEAM_MEMBER_ID': 1000.00.

    "START_DATE": "2012-09 - 13 T 09: 00:34 - 04:00", ".

    "END_DATE": "2009-10 - 14 T 03: 16:36."

    'CREATED_BY': "string",.

    'CREATION_DATE': ' 2010-03 - 18 T 12: 05:32.

    'LAST_UPDATED_BY': "string",.

    "LAST_UPDATE_DATE": "2018-12 - 28 T 14: 51:14 - 05:00", ".

    'FAVORITE_FLAG': "string".

    } ]

    }

    }

    Workstation:

    {

    "Task": [{}

    "ACTIVITY_ID": 1000.00.

    'PROJECTID': 1000.00.

    'ACTIVITY_NAME': "string",.

    'DESCRIPTION': 'string ',.

    'PARENT_ACTIVITY_ID': 1000.00.

    'STATUS': "string",.

    'PRIORITY': "string",.

    'PERCENTAGE_COMPLETE': 1000.00.

    "START_DATE": "2008-09 - 28 T 21: 49:45.

    "END_DATE": "2014-09 - 18 T 19: 18:33.

    'ETA': ' 2006-08 - 19 T 13: 27:14 - 04:00 ",".

    'ESTIMATED_HOURS': 1000.00.

    'ACTUAL_HOURS': 1000.00.

    'OWNER_USER_ID': 1000.00.

    'CREATED_BY': "string",.

    "CREATION_DATE': ' 2009-05 - 16 T 08: 42:28"

    'LAST_UPDATED_BY': "string",.

    'LAST_UPDATE_DATE': ' 2003-08 - 08T 20: 18:37 - 04:00 ",".

    "TaskAssignment": [{}

    'ASSIGNMENT_ID': 1000.00.

    'PROJECT_TEAM_MEMBER_ID': 1000.00.

    "START_DATE": "2012-09 - 13 T 09: 00:34 - 04:00", ".

    "END_DATE": "2009-10 - 14 T 03: 16:36."

    'CREATED_BY': "string",.

    'CREATION_DATE': ' 2010-03 - 18 T 12: 05:32.

    'LAST_UPDATED_BY': "string",.

    "LAST_UPDATE_DATE": "2018-12 - 28 T 14: 51:14 - 05:00", ".

    'FAVORITE_FLAG': "string".

    } ]

    } ]

    }

    Please let me know if I missed all the details.

    Waiting for answer!

    Thank you

    Diprish

    Massari,

    Task.Java seems good. The question is: how to create the new instance of task assignment in the UI?

    That's what you do: you must use the create operation standard of the palette of the title of the collection of nested task assignment data control. Thus, enrich the collection of task, the collection taskAssignment nested in the task, expand the node of the operations and drag and drop the operation of creation on your page. This should add the new instance to the collection of the current task task assignment. To make sure that this is the case, set a breakpoint in the addTaskAssignment method in Task.java. Then, when you save the parent task, load useful json must include a table nested with the new task assignment.

    Steven Davelaar,

    Oracle Mobile A-team.

  • Cannot remove the two records at once in a table

    Hi all

    I have a version in the form of table, here I have a point of delete button where them remove those audited point tabular presentation.  If I have checked for two records continuously one after the other and press the button Delete, remove only the first record I checked only. Whereas, if I chose two records where both of them is not one after the other. Both will get supprim├⌐s.

    Start

    GO_BLOCK ('ACT_QT_TXN');

    PREMIER_ENREGISTREMENT;

    LOOP

    IF: ACT_QT_TXN. CHECK_BOX256 = 1 THEN

    delete_record;

    COMMIT_FORM;

    END IF;

    NEXT_RECORD;

    IF (: System.Last_Record = "TRUE") and: ACT_QT_TXN. CHECK_BOX256 = 1 THEN

    DELETE_RECORD;

    COMMIT_FORM;

    EXIT;

    ON THE OTHER

    IF (: System.Last_Record = 'TRUE') THEN

    EXIT;

    END IF;

    END IF;

    END LOOP;

    PREMIER_ENREGISTREMENT;

    execute_query (no_validate);

    end;

    Something wrong with my script above? Please help me. Thanks /.

    Kind regards

    Lim

    The problem is with Commit_form after every single deletion. What karim gave is smooth, but I like it this way-

    PREMIER_ENREGISTREMENT;

    DECLARE

    BEGIN
    LOOP

    WHEN THE OUTPUT: SYSTEM. RECORD_STATUS = "NEW";

    If: CHECK_BOX = 'Y' then

    delete_record;
    end if;
    NEXT_RECORD;

    END LOOP;

    COMMIT;

    PREMIER_ENREGISTREMENT;

    execute_query (no_validate);

    END;

    Concerning

    Bobin

  • How we remove the old recording files in ES2?

    Hello

    The error:

    2010-02-26 16:25:16, 811 ERROR [STDERR] 26 February 2010 16:25:16 com.adobe.idp.auditworkflow.dsc.service.storage.ProcessRecordingStorageImpl manageRecordingFileSizes
    ATTENTION: removal or the older recordings due to the limitation of space.

    I see above error several times in the log file. Then google, I had http://forums.adobe.com/thread/506674?tstart=0 wire. But I know this one.

    Is there any page in /AdminUI, where I can remove all the old record to a shot.

    Is there a way where I can improve the size of the buffer to the server?   Because sometimes I am getting error like below:

    2010-02-26 16:12:12, exceeding the threshold of memory WARN [com.adobe.idp.dsc.workmanager.workload.policy.MemoryPolicy] 558: maximum limit of 95.0, current value 106.0
    2010-02-26 16:12:12, 559 WARN [com.adobe.idp.dsc.workmanager.workload.policy.WorkPolicyEvaluationBackgroundTask] policies being violated since statistics on "adobejb_server1:wm_default". Cause: com.adobe.idp.dsc.workmanager.workload.policy.WorkPolicyViolationException: political work violated. Will try to get to 60000 ms

    Please help me!

    This is the help topic:

    http://help.Adobe.com/en_US/LiveCycle/9.0/workbenchHelp/000375.html#1548929

    Here's how to configure the number of recordings to keep:

    http://help.Adobe.com/en_US/LiveCycle/9.0/workbenchHelp/001482.html#1608026

    Scott

  • How can I remove the compositions recorded in the Mix?

    I would like to delete saved images in my library of Photoshop Mix.  can someone please tell Mr the way to do this?

    There is a small bin in the lower right corner of each project (in the view of the gallery). Click on it will remove the project.

  • Cannot remove the Null record after wrong CreateInsert

    JDev 11.1.1.6

    I use ADF BC.

    I created a table from a veiw object.  The view object has 2 fields (both required).  No field has a default value (by design).

    When a user clicks on CreateInsert and then immediately any attempt to remove the new entry, the deletion fails because the fields must be filled.

    The user can restore, but that annihilates all transactions.  I want to just delete the line empty, while keeping all other changes intact.  I don't want the user to have to fill the 2 fields, just to be able to remove.

    What is happening on several tables.

    Please let me know the best way to handle this.

    Thank you

    Ray

    Set the immediate property of the button that allows you to remove the line to true.

    Timo

  • How to remove the device recorded 2 times

    We receive this message "" we do not have your device, please try again later "" trying to remove a device that was recorded at errouneously 2 or 3 times in www.motorola.com. How to remove duplicates?

    Is there a contact email where I can get in touch with you to resolve this problem?

    Those who have this in their profile should send an email to supportforums [A & T] motorola.com with a screenshot and the IMEIs phone which must remain, and one that should be deleted.

    Hope that helps!

    See you soon,.

    Nicole

  • Remove the single record using the Recycle Bin for each line icon

    Hello

    Long ago, I saw in some blog ApEx showing how to remove records using "Trash" image on each line.
    I couldn't find that blog anywhere, but I managed to make an example.

    http://Apex.Oracle.com/pls/OTN/f?p=47888:5:0:no:

    Can you someone please guide me to good links on how to do the same.

    I appreciate for your time.

    Thank you
    Raj.

    Hello
    Here you are:

    http://Apex.Oracle.com/pls/Apex/f?p=19914:10:0:no:

    Best regards
    Fateh
    ------------------------------------------------------
    If you think that my answer was correct or helpful to you, then please check the response as helpful or appropriate.

  • Change or remove the default record for redacted documents


    Once a document is drafted, I would like to save it to the existing file rather than using the '_redacted' added at the end of my file.   We use a software that allows us to make changes to the current PDF document and it re - register under the same filename without too many difficulties, but we must use the option 'SAVE' not the option "save under".  With auto save a document redacted, we cannot save without using the option ' Save as ', which causes the document may be in a different location and delivered up at the entrance of the software.

    This addition of car of the _redacted at the end of the file name can be removed from happening?

    Go to Edit - Preferences - Documents and uncheck the box that says "Adjust".

    ' file name when you save the applied redaction.

  • Web Services activity problem insert with a link to the child records contacts

    Hi - I am using WS 2.0 to insert a new activity and bind it to a list of contacts. I converted this to 1.0 of WS. It works fine without contact, the linking of code but fails with the following message when linking to contact records...

    Update operation on the 'Activity' integration component failed because no record corresponding in the 'Action' business with the specification of the research component "[Description] = 'Test2' ' could be found." (SBL-EAI-04403)

    Here is a simplified version of the code in question...

    activity2. Law on activity is new activity2. Activity();
    Act. URL = cs.crmSessionUrl;
    activity2. Entry ActivityInsert_Input = new activity2. ActivityInsert_Input();
    entry. ListOfActivity is new activity2. ListOfActivityData();
    entry. ListOfActivity.Activity is new activity2. ActivityData [1];
    entry. ListOfActivity.Activity [0] = new activity2. ActivityData();
    entry. ListOfActivity.Activity [0]. Object = "Test2."
    entry. ListOfActivity.Activity [0]. Activity = "Task";
    entry. ListOfActivity.Activity [0]. Status = "done";
    entry. ListOfActivity.Activity [0]. Type = "Email";
    entry. ListOfActivity.Activity [0]. DueDate = DateTime.Parse (DateTime.Now.ToString ("dd/mm/yyyy hh: mm; :")) "))
    entry. ListOfActivity.Activity [0]. AccountId = "AEGA-BGV8Z9";
    entry. ListOfActivity.Activity [0]. ListOfContact is new activity2. ListOfContactData();
    entry. ListOfActivity.Activity [0]. ListOfContact.Contact is new activity2. ContactData [1];
    entry. ListOfActivity.Activity [0]. ListOfContact.Contact [0] = new activity2. ContactData();
    entry. ListOfActivity.Activity [0]. ListOfContact.Contact [0]. ID = "AEGA-CCMEWM";
    activity2. ActivityInsert_Output output is law. ActivityInsert (input);

    Any suggestion would be great!

    Try using run instead.


    xmlns:ns = "" urn: crmondemand/ws/ECB/activity/10/2004 ""
    container = "http://www.w3.org/2001/XMLSchema".
    xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance".
    xmlns:WSSE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd".
    xmlns = "" urn: / crmondemand/xml/activity/Data ">"



    yourusername
    yourPassword







    Test7
    ALA-5KC0OV
    E-mail
    Completed
    Task


    AALA - 5851K 0











    2012-06-07 T 01: 00:09Z
    2012-06-07 T 01: 00:09Z
    ALA-583LBZ
    ALA-583LBZ
    1
    ALA-5TG95O
    Services Web administrator, 06/06/2012 18:00:09
    Services Web administrator, 06/06/2012 18:00:09


    2012 03-19 T 20: 19:55Z
    2012 03-05 T 21: 43:14Z
    ALA-583LBZ
    ALA-583LBZ
    79
    AALA - 5851K 0
    Web Services Administrator, 05/03/2012-13:43:14
    Web Services Administrator, 05/03/2012-13:43:14






  • remove the second record of strings

    Hi all

    I have the table emp with the id and name columns.

    EMP

    name identity
    --------------------
    100A
    100a < -.
    101 B
    102 C
    102 c <.
    102 C

    now I want to delete duplicate lines second of each group of duplicate rows.

    Can be
    The OP wants to delete 2nd record ;)

    create table test2
    as
    select 100 col1, 'A' col2 from dual union all
    select 100, 'A' from dual union all
    select 101, 'B' from dual union all
    select 102, 'C' from dual union all
    select 102, 'C'  from dual union all
    select 102 ,'C' from dual 
    
    delete from test2 t2
    where rowid in(select rowid from(
    select col1,col2,row_number()over(partition by col1 order by col2) rn
    from test2) where rn=2)
    
    2 rows deleted 
    
    select * from test2
    
    COL1      COL
    100      A
    101      B
    102      C
    102      C
    

Maybe you are looking for

  • Is it possible to see a list of the photos by date?

    In Aperture and iPhoto, you can see a list of 'events' with photos grouped by date. How is it possible in Photos? You can have photos ordered by date, but it doesn't seem to be a way to see them grouped as a list. It is tedious to find a photo of two

  • Download and play mpg files

    I'm having problems downloading, then read mpg files or CD/DVD to play on something other than VLC Player. My main PC and an old laptop is fine, but never had this problem. I get the error messages including could be a codec problem, but do not under

  • Intermittent service problems. Vista Home Premium

    From automatic updates of Vista back in February/March 2009, when restart the program stalled and went into a research problem and repair mode. There was no found repairs and 'Restore' did does not solve the problem. Stopping continuously with the po

  • How to hide or disable Update icon in the attachments of the Documents for the record section?

    Hi allWe hope to get a response from it.  We have a requirement to hide or disable the Update icon in the attachments to the Documents in the files section in HRMS.   I thought that this could be done easily through customization but that updated ico

  • Can anyone help (loss of hair)

    Can anyone HELP! (Installation is no longer functional) WHY?I've attached a screenshot of my problem.I downloaded CC several times during the last two weeks and got nowhere.I also followed the prompt "GET HELP", that made me like before nowhere?'Phot