PL/SQL Trying to update a table through trigger on the same table
Hi everyone my name is Edwin and I'm new to this forum. I hope I can learn a lot from this community and over time contribute to it.
The problem I'm facing at the moment is a tough one. I need to update a table (table a) with a value called block_id. This block_id is generated by a procedure I have written myself, the end result is stored in another table (table b). This block_id needs to be generated after certain rows of table a get updated with a trans_id. The trans_id is all the same for these rows in table a, but the generated block_id isn't. In my code I use an after update on collumn a of table a trigger. So if the the collumn gets updated the trigger fires. The trigger calls the procedure that generates the block_id and the procedure generates table b with all the block_id's. But then I want to update the rows in table a with the generated block_id in table b. The problem is that this self-deadlocks.
You might think that this would call a recursive trigger, but I have written code in the trigger that checks if the block_id isn't allready filled in on table a.
Also I really need all the values wich get updated (table a), so I believe a before update is also out of the question.
And the first update of table a is done through an erp-packet and I can't get at that code, otherwise I would just have run my code from there.
Message was edited by:
user625855
CREATE OR REPLACE TRIGGER block_id_trigger AFTER UPDATE ON unload_details_tab
DECLARE
current_transport_id NUMBER;
check_value NUMBER;
check_block_id NUMBER;
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
current_transport_id := get_curent_trans_id; --function that gets the current transport_id
check_value := check_site_and_directive(current_transport_id); --function checks if this transport_id should have a block_id
check_block_id := check_for_block_id(current_transport_id); --function checks if there isn't allready a block_id set.
IF check_value = 1 AND check_block_id = 0 THEN
create_blok_id_table(current_transport_id); --this procedure creates the blok_id in temptable
UPDATE unload_details_tab a SET a.block_id = (SELECT DISTINCT b.blok_id FROM temptable b WHERE b.mark = a.mark_1) WHERE a.transport_id = current_transport_id; --this statement should update the table back, if I leave it out everything works fine, but when I leave it I get the self-deadlock error.
ELSE
null;
END IF;
END block_id_trigger;
Ok, I cleaned the code somewhat.
user625855
Similar Messages
-
I'm desesperated!!
iOS: Device not recognized in iTunes for Mac OS X
Or
See
iOS: Device not recognized in iTunes for Windows
- I would start with
Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
or
Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
However, after your remove the Apple software components also remove the iCloud Control Panel via Windows Programs and Features app in the Window Control Panel. Then reinstall all the Apple software components
- Then do the other actions of:
iOS: Device not recognized in iTunes for Windows
paying special attention to item #5
- New cable and different USB port
- Run this and see if the results help with determine the cause
iTunes for Windows: Device Sync Tests
Also see:
iPod not recognised by windows iTunes
Troubleshooting issues with iTunes for Windows updates
- Try on another computer to help determine if computer or iPod problem
Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities -
I am trying to update my software through the app store but for some reason an error occurs and will not allow me to do so. And when i go online to log into my apple id account it states that there is an error. Can someone help me solve this issue, its annoying me?
Apple’s having trouble with the iTunes Store servers right now. Wait for them to resolve the issue.
(123935) -
My ipod touch is stuck up at Apple Logo, I have tried to update and restore through ITunes but no use, It stuck up again at Apple Logo with no Error, after restoring ITunes showes your ipod is restore but still apple logo won't go, Due to new Laptop, I do not have any backup, therefore i have tried to select new Ipod touch and goes through step by step procedure but no use, Please help what to do?
i tried reseting my ipod today and had a similar problem... it wont be recognized by itunes, the only thing i havent tried is putting it into DFU mode, or the state that it is in when u recieve it telling u to connect it to itunes.i recommend putting it into DFU mode. http://www.youtube.com/watch?v=34v8HMC9B98 this should better explain it. if i find another way, ill keep u updated
-
Im trying to update db table in user exit, with the internal table
Im trying to update db table in user exit, with the internal table
my scenario:
loop at itekpo.
updating itekpo -
> at the end of user exit the db table ekpo have to be updated
endloop.
Im updating internal table, using
MODIFY itekpo TRANSPORTING INCO1 INCO2 WHERE ebeln = itekpo-ebeln
where itekpo is internal table, but it is not updating the db table 'ekpo'.
i also tried updating ekpo directly !
Thanks in advanceHi,
you can search in the forum itself,
Try this link for instance
https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=tocreateaBADI&adv=false&sortby=cm_rnd_rankvalue
You can find a code for finding BADI as a report with the following Transaction
finding badis
How to find BADIs
Reward if helpful
Regards
Byju -
Hi, I tried to update my iPad through iTunes but it did not work. I am trying to update to 5.0. Thanks.
Originally it said that the process would take 76 minutes but after about 30 minutes there was no longer a message giving the status of the update.
-
I tried to update Photoshop CS6 through CC, and PS got corrupted and wont open now.
I tried to update Photoshop CS6 through CC, and PS got corrupted and wont open now. I uninstalled it, but now I can't re-install photoshop...installer just gives me the option to uninstall.
This is my job, so very important .
Thanks
JohnnyDownload the CS6 installer from this link it should install on any machine the meets the specs. Even without a serial it should install as a trial version. If CS6 was activated on your system your CS6 credentials should still be there and when you install it should be activated. Then use CS6 menu Help>Updates to install the updated, CS6 installs need to be updated.
-
I tried to update my ipad through wifi and followed the steps. It says that update is complete however i must connect to itunes and restore the updates but itines says i dont have permission to do so. KIndly assist on the stages to follow. Screen is black ad i unable to work on it.
Kindly give some suggestions
Regards
BanziHello Mayanii,
This display and behavior indicates that the iPad is in recovery mode and must be restored.
If you can't update or restore your iPhone, iPad, or iPod touch
http://support.apple.com/kb/HT1808
Cheers,
Allen -
I tried to update my iphone through my itunes and recieved an error message. The phone then became frozen on the conect to itunes screen and I can not use the phone. I tried to reconect to itunes but it does not recoginze my phone it just stays frozen.
Try recovery mode as described here. You may have to try to get into recovery mode more than once to succeed.
http://support.apple.com/kb/HT1808 -
I’ve tried to update my i-Tunes version after the site suggested I should following my i-Pad Air being plugged into it for the first time. The update seemed successful but the program would not open at all despite switching off the PC and re-starting several times. I then tried wiping the original software from the computer and re-downloading from scratch. Each time I tried the download failed with a message saying “Service “Apple Mobile Device” failed to start. Verify that you have sufficient privileges to start system services” At this stage, the only way forward was to “abort” the download. This I have done now four times and the same thing happens. When I did finally manage to get an i-Tunes shortcut on my desktop, the program wouldn’t open saying: “i-Tunes was not installed correctly. Please re-install i-Tunes. Error 7 (Windows error 193)” Any ideas to resolve this?
Try the following user tip:
Troubleshooting issues with iTunes for Windows updates -
Hi,
I am trying to update a number of items which the software check brings up:
It runs and says it is installing but at the end I get this error message:
BUT then I ge tthis:
Can anyone help me to enable the software to update?
ThanksThanks. Something isn't right as I just tried to download the iphoto update - it said it had competed the download but then when I clicked on the download item I get this:
Think will have to take it into the store.....
thanks for replying. -
I have tried to update my iPod Touch 4G to the latest update, I currently have iOS 4.1. After the 4 hours an error message appears saying iTunes had lost connection even when I am fully connected to the internet. I have repeated the update 4 times now with not luck. Any ideas?
Thanks in advance
AdamIf you get a network timed out error, try disabling the security software on the computer during the download and install.
You can also try a direct download andinstall by:
iPod, iPhone and iPad Firmware Download
Nera the top of the page aretheinstructions for selecing the download for the install. -
I'm trying to update my daughter's Ipad2 to the new IOS 8 and it's got stuck on the connect to ITunes display. We don't have a computer to connect it to and it's never been connected to one. How do I get past this?
You can try a soft-reset of pressing and holding both the home and sleep buttons for 10 to 15 seconds so that it reboots, but you are likely to get the same screen. If it does then it will need to be connected to a computer's iTunes so that it can be reset back to factory defaults - do you have a friend with a computer with iTunes installed on it, or is there an Apple store nearby that you could try going to (if there is then preferably make a Genius Bar appointment at it, or don't go at a busy time) ?
Has she been backing up to the cloud ? If she has then she should be able to restore to that. If not then what she can redownload for free from the stores will show in the Purchased tabs in the store apps. -
i need help! i am trying to update iphoto on my macbook pro that i had bought from someone else. although i am signed into my account when trying to update it is asking me for the previous owners account details and it wont let me change it to my details how can i solve this problem please.
thank you
Jan RobinsonThat's because the Mac, OS X and the iLife apps that came preinstalled on the Mac all belong to the previous owner. The previous owner needs to call Apple care and have their Apple ID disassociated from the Mac. Then the hard drive needs to be totally erased and OS X and the iLife apps reinstalled using OS X Recovery.
-
trying to update my ipod but i get the error message network timed out. I've already uninstalled and reinstalled the latest version of itunes. I also do not have software update in settings on the ipod. How do i get the ipod to update?
Try the manual method specified here:
iDevice Troubleshooting 101 :: iPhone, iPad, iPod touch
Maybe you are looking for
-
My iphone 3gs ios 6.1.6 shutdown itself with out any error
my my iphone 3gs ios 6.1.6 shutdown itself with out any error & after restarting it the same thing happens please help
-
Hi PS Experts, I am faced a lots of issue in settling the project cost. I am able to run the transaction code CJ88 successfully. But when I checked CJI3 Report, The project cost is not changed to "ZERO". (Project cost is same) I don't know from where
-
HR ABAP Posiition Holder Org Unit value going dump
Hi Experts, I am working now HR ABAP. My issue is, I am using standard Program RHXPEP01. This Program is nothing but. Profile Match up Position/Holder. Once i execute this program and enter the value of Org. Unit Value is 60010128. Then after 15min
-
Update 10.5.8 to 10.7.8
I want to use iweb (and icloud). apple says I need the 10.7.8 at least to se it but i can t upload it. how should i do?
-
How can I upload a video in my "video" iPad app to YouTube or Facebook or some how share the video to others.