SQL error msg - The DELETE statement conflicted with the SAME TABLE REFERENCE constraint

Executed as user: ****. The DELETE statement
conflicted with the SAME TABLE REFERENCE constraint "FK_PARENT_TASK_REF".
The conflict occurred in database "****", table "****", column
'PARENT_TASK_ID'. [SQLSTATE 23000] (Error 547) The statement has been
terminated. [SQLSTATE 01000] (Error 3621). The step failed.
Does this error msg indicate the whole script failed to execute or was it just a single step/task that failed ?
What does error msg mean ?
Anyway to prevent this error msg and ensure script runs successfully

Hi mdavidh,
This error occurs because the record  'PARENT_TASK_ID' was referenced by 'FK_PARENT_TASK_REF'.
Please refer below codes:
CREATE TABLE MyTable (
ID INT, primary key(ID), -- primary key
ID_Parent INT foreign key(ID_Parent) references MyTable(ID), -- foreign key reference the same table
insert into MyTable(ID,ID_Parent)
values(0,0);
insert into MyTable(ID,ID_Parent)
values(1,0);
insert into MyTable(ID,ID_Parent)
values(2,0);
insert into MyTable(ID,ID_Parent)
values(3,1);
insert into MyTable(ID,ID_Parent)
values(4,3);
insert into MyTable(ID,ID_Parent)
values(5,4);
CREATE TRIGGER MyTrigger
on MyTable
instead of delete
as
set nocount on
update MyTable set ID_Parent = null where ID_Parent in (select ID from deleted)
delete from MyTable where ID in (select ID from deleted)
Now we could delete records.
delete from MyTable where ID_Parent=0
Thanks,
Candy Zhou

Similar Messages

  • The DELETE statement conflicted with the REFERENCE constraint "FK_Equipment_Assets". The conflict occurred in database "WorkOrderSystem", table "dbo.Equipment", column 'AssetCode'........can someone give me a solution for this Error.

    The DELETE statement conflicted with the REFERENCE constraint "FK_Equipment_Assets". The conflict occurred in database "WorkOrderSystem", table "dbo.Equipment", column 'AssetCode'

    ya that's true row is referenced by another table.....but i want the row to referred by another table ,I don't know how to fix it
    Actually this is not a C# issue. It is a T-SQl issue.
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/home?forum=transactsql
    The above link should be posted.
    Per my understanding, first you should
    delete the record from the Foreign Table and then after you have to delete the record from the Primary Key table
    Hope it helps you.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Trying to set up Directv GenieGO using Airport Extreme.  Getting error message: DHCP range entered conflicts with the WAN IP Address of your base station.  How do I resolve the conflict.

    Trying to configure an Airport Extreme manually.  After I enter the IP Address of the GenieGo along with the rest of information required I am getting the following error message when I click update:
    DHCP range entered conflicts with the WAN IP address of your base station. 
    How do I resolve the conflict? 

    You cannot use the same range on LAN and WAN if you are routing.. it must be different.. and you should not be routing at all.
    The AE should be in bridge mode. NO DHCP settings at all.

  • Forcing nologging hint in the delete statement

    Hi,
    We are forcing nologging hint in the delete statement to improve the performance of delete statement.
    DELETE /*+ nologging */ FROM A
    Table and Tablespace level Logging is set to Yes. Our database is running in archivelog mode and we have physical standby database.
    I would like to know the following.
    1. redo entries will be generated or not during the delete opeation with nologging hint
    2. If no, how records will be deleted in the standby database
    3. Do we really gain performance with nologging in the delete statement
    Thanks.

    You mean that, nologgin hint ...First, there is no such thing as a nologging hint. At least I've never heard of one, documented or undocumented.
    Second, as Herman said, DELETE is always logged. In fact DML is always logged except for direct path inserts.

  • The action could not be completed because of a conflict with the original item. The conflict may have occurred when an existing item was updated on another computer or device. Open the item again and try making your changes. If the problem continues, cont

    I have a user on an iMac 10.6 connected to our domain.  She uses Outlook web access for email on our exchange server.  Last week she received the following message which is randomly preventing her from sending emails.  She claims no attachment was involved in the original email when this all started.  I have not been able to look at her account as she is out of the office but maybe someone else dealt with this issue.  I realize this may not be Mac related but thought I'd give it a try.  She did say it occurred once over two days while working on a PC but it continued over the past weekend.
    If an internal user tries to send a message with infected attachment using Outlook Web Access, it may report the following error message: The action could not be completed because of a conflict with the original item. The conflict may have occurred when an existing item was updated on another computer or device. Open the item again and try making your changes. If the problem continues, contact technical support for your organization.
    This is because F-Secure Anti-Virus for Microsoft Exchange has detected a virus in the attachment. If the user tries to send the message again, the message will be sent but without the attachment. At the same time a blank message with an attachment named "Attachment_information.txt" will remain in the user's Drafts folder. The "Attachment_information.txt" will contain information about the virus detected in the message.

    PS - have found other posts indicating that clips smaller than 2s or sometimes 5s, or "short files" can cause this. Modern style editing often uses short takes ! Good grief I cannot believe Apple. Well I deleted a half a dozen short sections and can export, but now of course the video is a ruined piiece of junk and I need to re-do the whole thing, the sound etc. which is basically taking as much time as the original. And each time I re-do it I risk again this lovely error -50 and again trying to figure out what thing bugs it via trial and error instead of a REASONABLE ERROR MESSAGE POINTING TO THE CLIP IT CAN'T PROCESS. What a mess. I HATE this iMovie application - full of BUGS BUGS BUGS which Apple will not fix obviously, since I had this product for a few years and see just hundreds of hits on Google about this error with disappointed users. Such junk I cannot believe I paid money for it and Apple does not support it with fixes !!!
    If anyone knows of a GOOD reasonably priced video editing program NOT from APPLE I am still looking for suggestions. I want to do more video in future, but obviously NOT with iMovie !!!

  • I can't receive my incoming mail. ESP is yahoo.  Error msg says unable to connect with POP server.  Any solution?

    I can't receive my incoming mail in Mac Mail. ESP is yahoo.  Error msg says unable to connect with POP server.  Any solution?  I am able to get my incoming messages via yahoo website but not through the Mail app.

    Try this, if it is not the correct department, ask them for the number or to be transfered..
    Call 1-800-318-0612 for Login Help
    Also on most autmated systems, if you hit 00000, or ##### you can sometimes get thru to a person.
    Is Yahoo your Internet provider? Do you have  a local provider? ei:AT&T, SBC,  cable co, check who you make your check or epatment to...etc, If so I would start there, but if no joy go to the "Mothership"
    I may be wrong about this, (it's been a long time now) I may have deleted my mail account from Mail (after writing down all the info from all General/accounts, and the rest of the tabs, and then added a new account using my existing email address, and it may have "walked me thru the rest of the proceedure".
    But like I said it was a long time ago 3-4 years, but that may have been the path I ended up taking, make sure to write all the info down in case you need to re-enter it all manually. Then try calling them.
    All the best

  • A network error occurred while trying to communicate with the server.

    Hello All,
    I am getting some new error messages when opening the server app on my Mac Mini server running OS X 10.8.2 and Server 2.2.1. First I get a message that says "A network error occurred while trying to communicate with the server." and then after trying to open some of the service panes, I get additional errors that say "Multiple errors occurred on the server while processing commands." The services don't load and I just see "Error Reading Settings" in the server app.
    I started to get these errors when I added a new website to the server. All the services are working fine but I cannot access them in the server app.
    In console I'm seeing these errors when I try to access various services:
    2/24/13 8:02:12.692 PM Server[956]: Error: The server '10.0.1.150' reported an error while processing a command of type: 'readSettings' in plug-in: 'servermgr_dns'. Error: Error Domain=XSActionErrorDomain Code=499 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “10.0.1.150” which could put your confidential information at risk." UserInfo=0x7f8c4003a760 {NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “10.0.1.150” which could put your confidential information at risk., originalError=Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “10.0.1.150” which could put your confidential information at risk." UserInfo=0x7f8c3f547db0 {NSURLErrorFailingURLPeerTrustErrorKey=<SecTrust 0x7f8c40599080 [0x7fff7711ffd0]>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSUnderlyingError=0x7f8c3d58c0b0 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be “10.0.1.150” which could put your confidential information at risk.", NSErrorPeerCertificateChainKey=(
        "<SecCertificate 0x7f8c3f6747e0 [0x7fff7711ffd0]>"
    ), NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “10.0.1.150” which could put your confidential information at risk., NSErrorFailingURLKey=https://10.0.1.150:311/commands/servermgr_dns, NSErrorFailingURLStringKey=https://10.0.1.150:311/commands/servermgr_dns, NSErrorClientCertificateStateKey=0}}
    I have already restarted the server and used terminal to stop and start postgres. Any more thoughts on how to repair this?

    Just as I had suspected, the whole GUI crashed because of certificate problems. After two and a half hours with enterprise support, it turns out the com.apple.servermgrd certificate in the server keychain had become corrupt.
    We determined this by typing https://127.0.0.1:311 into Safari and we could see all the server modules and interact with them through the web interface. All the services were working properly as well so we knew that it was just the Server.app GUI that simply couldn't read settings that was causing the problem.
    So, first we closed the server app. Went into /var/servermgrd and deleted all the files from this folder. Then, in Keychain, deleted the com.apple.servermgrd certificate. Did a search for com.apple.servermgrd in Keychain and deleted everything else that came up for it.
    Then restarted the server. Now the server app was able to properly connect to the services in the background and read them properly. This was the jist of the troubleshooting that solved the problem. It also seems like DNS is causing problems because that is the only service that will not read right but is functioning properly in the background.
    I will post an update once Apple figures out what is wrong with DNS. Hope this helps anybody else having these problems.

  • Import error imp-00017: following statement failed with oracle error 1659:

    Hi all,
    I am trying to import a file (dmp) which is of 1.63GB size,
    when I type
    imp
    dbname/pwd@db
    c:\filepath
    30720
    no
    no
    yes
    yes
    yes
    I am getting the error imp-00017: following statement failed with oracle error 1659:
    -- end it says Ora-01659 unable to allocate minextents beyond 1 in tablespace USERS
    --unable to create INITIAL extent for segment in tablespace USERS
    --import terminated successfully with warnings
    when I looked into
    select maxbytes,file_name from dba_data_files where tablespace_name='USERS';3.4360+10 c:\oracle\product\10.2.0\oradata\orcl\users01.dbf
    kindly help me in solving this is.
    Regards,
    aak
    Edited by: AAK 460425 on Apr 12, 2009 6:33 PM

    Thanks,
    select bytes from user_free_space where tablespace_name='USERS'
    BYTES
    458752
    720896
    458752
    655360
    43384832
    is the size less?
    My apology I have updated this in the below thread, which is same as this one.
    Re: Import error

  • When i try to open docs in mail box  i get an error msg : there is a problem with adobe acrobat/read

    when i try to open docs in mail box  i get an error msg : "there is a problem with adobe acrobat/reader.  If it is running please exit and try again (1014:1014)"

    I have the same problem also but solved with the solution from http://www.brain-cluster.com/blog/orange/2011/03/06/there-problem-adobe-acrobatreader-if-it-running-please-exit-and-try-again

  • "conflicts with the WAN IP address"

    I just picked up a used AirPort Extreme N (Gigabit Ethernet) to replace my current non-Apple router, which has worked satisfactorily but lacks the ability to share disks--something I need. Using my G5 running 10.4.11, I downloaded AirPort Utility 5.4.2 to set up the new (to me) device, and did a factory reset just to clear everything out. I placed the AirPort in the network exactly where the old one had been--with its WAN port connected to the line supplied by my ISP (see below) and its three other ethernet ports connected to various clients. Then I ran into a problem:
    Under the "Internet" icon of Airport Utility, I set it to Connect Using Ethernet, and Configure IPv4 using DHCP (My current router uses DHCP to provide IP addresss to both the wired and wireless devices on my network). The numbers below that are: IP address 192.168.1.12, subnet mask 255.255.255.0, and router address 192.168.1.1.
    The first field of the line labeled "DNS Server(s)" defaults to 192.168.1.1, while the second field is empty, as are the fields Domain Name and DHCP Client ID. I left Ethernet WAN port on "Automatic" and put "Connection Sharing" on "Share a Public IP address," since I believe its combination of DHCP and NAT offer the best security.
    The problem: When I click the "Update" button to confirm my settings, I get this message: "The DHCP range you have entered conflicts with the WAN IP address of your Apple wireless device."
    Although I am unclear as to why the Internet Connection pane of the AirPort Utility lists "IP address" and "Router address" as two separate numbers (aren't they referring to the same device, the AirPort itself? How can it have two IP addresses?), I figured that I could play it safe and change the starting number to 192.168.1.13 to avoid the conflicts with 192.168.1.12.
    But I still get the same error message when pressing "update." I tried changing the range to 192.168.1.50 - 192.168.1.60, and I still get the same error message. There seems to be no range that the utility will accept as non-conflicting with the "WAN IP address" of the Airport.
    My ISP did not provide a visible modem as others in the past have done. The internet connection they left me simply comes out of a box on the back of the house that is connected by fiber optics to (presumably) a fiber optic line out in the street. However, this "supply line" has always worked fine with my non-Apple router and--after disconnecting the AirPort that had temporarily taken its place--is working right now as I throw this question to the forum.
    Additional notes:
    * Under the NAT tab, the box "Enable NAT Port Mapping Protocol" is checked, as it was by default) while "Enable default host at" is unchecked and blank.
    * While I currently have wireless turned on in the AirPort, I haven't even tried wireless connectivity yet and want to make sure my wired connectivity is working first.
    Thanks for any assistance.

    The problem: When I click the "Update" button to confirm my settings, I get this message: "The DHCP range you have entered conflicts with the WAN IP address of your Apple wireless device."
    This error message typically indicates that your 802.11n AirPort Extreme Base Station (AEBSn) is receiving a Private (as opposed to a Public IP address) on its WAN port. That could be because your ISP does not provide any device (computer or router), that is directly connected to their "box," with a Public IP address.
    Your AEBSn is both a DHCP client (on the WAN-side) and a DHCP server (on the LAN-side). The Configure IPv4 is basically the on/off switch for the AEBSn's DHCP client. It's other option, PPPoE, would only be used if your ISP requires it.
    One option would be to reconfigure the AEBSn as a bridge. This would disable both the AEBSn's NAT & DHCP services.
    Although I am unclear as to why the Internet Connection pane of the AirPort Utility lists "IP address" and "Router address" as two separate numbers (aren't they referring to the same device, the AirPort itself? How can it have two IP addresses?
    The IP address information on (actually the TCP/IP pane) is showing you the AEBSn's WAN port settings. Settings that with Configure IPv4 set to Using DHCP would come from the DHCP server upstream of it. If this server was providing Public IP addresses then the values in both the IP Address & Router Address fields would not be in any of the three valid Private IP Address ranges (10.x, 172.x, or 192.x)
    Under the NAT tab, the box "Enable NAT Port Mapping Protocol" is checked, as it was by default) while "Enable default host at" is unchecked and blank.
    This setting would not have anything to do with the error message that you are getting. Instead, this option is used as an on/off switch for the NAT-PMP protocol. This protocol is similar to non-AirPorts' UPnP protocol.
    While I currently have wireless turned on in the AirPort, I haven't even tried wireless connectivity yet and want to make sure my wired connectivity is working first.
    Both wired and wireless clients will be impacted by this until resolved. I again, suggest that you try reconfiguring the AEBSn as a bridge. (ref: AirPort Utility > Select the AEBSn > Manual Setup > Internet > Internet Connection > Connection Sharing = Off (Bridge Mode))

  • HELP!! Itunes wont install on Windows 7.  I get an error msg. there is a problem with this windows installer package. A program required to install to complete could not be run.  Contact your support personnel or package vendor. WHAT NOW?

    HELP!! Itunes wont install on Windows 7.  I get an error msg. there is a problem with this windows installer package. A program required to install to complete could not be run.  Contact your support personnel or package vendor. WHAT NOW?

    Ok, Below is what worked for me somewhat. 
    Okay ... try downloading and saving a copy of the iTunesSetup.exe to your PC from the Apple website:
    http://www.apple.com/itunes/download/
    Now download a trial version of WinRAR:
    http://www.rarlab.com/download.php
    Open the iTunesSetup.exe with WinRAR, and try to run the standalone install of Apple Application Support from the AppleApplicationSupport.msi you find in there.
    It works now BUT there are still problems.  It is not allowing or recognizing my Cd/DVD player and i CANT burn.  Looking still for this fix.

  • When syncing my iphone 6 plus, i now get an error that reads, "IP address conflicts with another system or network."  How can i eliminate this error permanently?   Thank you in advance!

    when syncing my iphone 6 plus, i now get an error that reads, "IP address conflicts with another system or network."  How can i eliminate this error permanently?   Thank you in advance!
    This never happened before, however the last couple of months it comes up every time I plug my USB from PC to iphone.

    HyperNova Software,
    Thank you so much.  Because I am very computer illiterate, could you help me on how to get started?  I don't have the slightest on where to get started, the steps to follow, etc.
    Can't thank you enough for your help!

  • DYNAMIC_CALL_FAILURE Error during proxy processing An exception with the ty

    Hi,
    SRM 7.0 contains 2 clients:
    Sender: 100 for EBP, logical system is CLNT100
    Receiver: 200 for SUS, logical system is CLNT200
    both the clients are connected through PI 7.0, logical system of PI is CLNT001.
    From SPROXY of 100EBP, i'm executing the outbound proxy, in moni sent msg success.
    In PI also msg is processed.
    But in SUS200, it is showing below error msg:
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Call Inbound Proxy
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIProxy</SAP:Category>
      <SAP:Code area="ABAP">DYNAMIC_CALL_FAILURE</SAP:Code>
      <SAP:P1>UNCAUGHT_EXCEPTION</SAP:P1>
      <SAP:P2>CL_BBPX_TRADING_PARTNER_SUS_IN</SAP:P2>
      <SAP:P3>EXECUTE_ASYNCHRONOUS</SAP:P3>
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>Error during proxy processing An exception with the type CX_BBPX1_STD_MESSAGE_FAULT occurred, but was neither handled locally, nor declared in a RAISING clause Application Error</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    Pls help in resolving the same....
    tnx n rgds,
    balu

    Hi,
    How did you solve the issue? Can you please provide the solution.
    Thanks,
    -Devi Swain

  • Err 62007: SQL Error: 99999 ORA-24338: Statement Handle not Executed

    Hi,
    I am facing a problem while adding a new parameter n my JSP Report JDBC query based on a ref-cursor from a stored procedure define in a package in database.
    No problem at database level, I have added the new parameter in package specification and Package body for that procedure and compile my package, it complies without any error and warning.
    but when I open the report and add parameter in the report JDBC query window, then it is generating a error message,
    "Err 62007: SQL Error: 99999 ORA-24338: Statement Handle not Executed "
    and I am unable to add the new parameter in report.
    e.g.
    Actual which was working is:
    My-package.My-procedure(:P1,:P2,:P3 ,:P4,:P5,:P6,:P7)
    I want to do this:
    My-package.My-procedure(:P1,:P2,:P3 ,:P4,:P5,:P6,:P7,:P8)
    but unable to do due to this error message:
    ("Err 62007: SQL Error: 99999 ORA-24338: Statement Handle not Executed ")
    Reports Builder 10g:
    Database 10g:
    Operating system windows XP:
    using JDBC Query base on ref-cursor coming from the stored procedure define in the Package.
    Regards,
    Khan

    and compile my package, it complies without any error and warning.That doesn't mean anything in this case. You are getting a runtime error, not a compilation error. The error is coming when you execute your procedure.
    Did you test your modified procedure in sqlplus or SQL Developer?

  • The colour swatch 'black' has a conflict with the current document?

    I have created some graphic styles and saved them as the manual explains.
    When using them in a new document I keep getting the conflict window asking if I wish to merge swatches.
    What have I done to keep getting this unwanted conflict message?

    Yeah, *real* annoying. This is something new. It didn't happen before in CS5, at least not to me and I always work with global colors.
    Example:
    No matter what object, no matter what color (even without any color!), upon paste I get the merge dialog: The color swatch "K=30" has a conflict with the current document.
    When I delete the swatch and then cut something (not having that color) I get: The color swatch "Deleted Global Color" has a conflict with the current document.
    Does anyone have a solution to this problem?
    This is driving me nuts.

Maybe you are looking for

  • Trinidad and ADF Rich Faces components::

    Hi! Does someone know about any problem while using Trinidad and ADF Rich Faces, or just the Trinidad components in JDev11g ? Thanx. Endy

  • Images not displayed properly jv:imageButton tag

    Images are not displayed jv:imageButton tag. I am able to see the images sometimes, but not consistently. I have followed the steps mentioned from the Platform RI. I was able to see the images without any problem before Beta 3/JDev R1 uptake. I had m

  • Keyborads for Final Cut Pro

    I am looking to purchase a keyboard for final cut pro, to make it easier for me to do my editing. I have been looking at LogicKeyboards: http://www.logickeyboard.com/shop/mac-keyboards-801c1.html does anyone use these? Which ones are people using? Th

  • Installation error code 11 Weblogic 7 in SUSE 7.2

    I downloaded at least two times weblogic server 7.0 SP2. The bin file is executed but abort with font error's. I tried console installation but installation aborted with error code 11 Help...give me a solution!!!!

  • HELP! unable to find correct drivers to for P755 s5390

    After a hard drive failure, I had to install a new hard drive and do a clean install of Windows 7. A recovery disk is not available. I've reviewed the driver files for my computer at the Toshiba drivers/downloads page. I followed the instructions to