Problem in enabling constraint - after disabling and truncation of table .

Hello Friends,
I have a table called DRR_TABLES that has list of table names . The requirement is to truncate the tables present in DRR_TABLES except KEY_IDS table and table_name like '%TYPE%' table.
written a procedure . successfullly truncating the tables from DRR_TABLES but while enabling constraints after truncation , I am getting problem in enabling constraints .
ERROR at line 1:
ORA-02270: no matching unique or primary key for this column-list
ORA-06512: at "schema123.TRUNCATE_DRR_TABLES ", line 49
ORA-06512: at line 1
Heres is the code .
PROCEDURE TRUNCATE_DRR_TABLES is
x varchar2(200);
v_tablecount number := 0;
cursor c is select TABLE_NAME from DRR_TABLES where population_source='PUBLISHING' and TABLE_NAME != 'KEY_IDS' and TABLE_NAME NOT LIKE '%TYPE%';
BEGIN
DBMS_OUTPUT.PUT_LINE (' TRUNCATING DRR TABLES ...........');
OPEN c ;
LOOP
FETCH c INTO x ;
EXIT WHEN c%NOTFOUND;
for c1 in (select table_name, constraint_name from user_constraints where TABLE_NAME = x and status ='ENABLED' ORDER BY CONSTRAINT_TYPE DESC )
loop
begin
execute immediate ('alter table '||c1.table_name||' disable constraint '||c1.constraint_name|| ' cascade');
NULL;
end;
end loop;
EXECUTE IMMEDIATE 'TRUNCATE TABLE ' || x ;
v_tablecount := v_tablecount + 1 ;
DBMS_OUTPUT.PUT_LINE('TABLE TRUNCATED :'|| x );
END LOOP ;
DBMS_OUTPUT.PUT_LINE (' TOTAL TABLES TRUNCATED ' || v_tablecount );
CLOSE c;
OPEN c ;
LOOP
FETCH c INTO x ;
EXIT WHEN c%NOTFOUND;
for c2 in (select table_name, constraint_name from user_constraints where TABLE_NAME = x and status = 'DISABLED' ORDER BY CONSTRAINT_TYPE)
loop
begin
execute immediate ('alter table '||c2.table_name||' enable constraint '||c2.constraint_name);
NULL;
end;
end loop;
END LOOP ;
CLOSE c ;
END TRUNCATE_DRR_TABLES ;
LINE 49 is the line corresponding to enable constraint statement.
Edited by: kumar73 on 3 Sep, 2012 11:44 PM

It is such a pity that a user having 321 posts till date is unaware of basics of Posting a Question.
1. You need to provide us with your Oracle version
select * from v$version;2. You need to understand and get accustomed to using tags before and after Code or SQL's for better readability.
3. You need to provide us with the Table Structure and the Constraints Definition.
There are many things that looks like Bad Coding practices:
<font face="Times New Roman" size=2>
1. Avoid RBAR (Loops).
2. Implement Bulk Collect.
3. Why do you need to disable the constraints before truncating? Are you kind of handling the Referential Integrity Constraints?
4. Duplicate checking of Disabled Constraints.
5. When the procedure is being executed at Production Environment, are you going to Monitor the DBMS_OUTPUT? Why not Log the Statements into a LOG Table?
6. Why use a TableCount variable? Would the TableCount Variable be not equal to the Number of Records returned by Cursor C?
7. What is the need to use a NULL statement after every Execute Immediate?
8. What is the Need to surround each execute Immediate with Begin .. End block?
9. Where is your Exception handling Block? Forgot to write?
</font>
What has been your effort in finding which Constraint/Table is causing you the trouble?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Problem with reading data from screen and inserting in table

    hi ther,
    im new to abap-webdyn pro. can anyone suggest how to read data from screen and insert into table when press 'ADD' button.
    i done screen gui , table creation but problems with action. what the content of acton add.
    is ther any link that helps me or tut??
    thankx in advance!
    regards

    Hi,
    Create a context node for the screen fields for which you want to enter the values with cardinality 1.1.....
    Now in the layout of your view bind the screen input fields to that context node(attributes) to the value property of the input fields...
    Now in the action of ADD button....
    --> go the wizard and select the read node button and select the node which you have created it generates the auto code for you.....
    for example if the node is contains aone attribute like MATNR
    reading the node from wizard will generate the code as....
    DATA lo_nd_matnr TYPE REF TO if_wd_context_node.
      DATA lo_el_matnr TYPE REF TO if_wd_context_element.
      DATA ls_matnr TYPE wd_this->element_matnr.
      DATA lv_matnr TYPE wd_this->element_matnr-matnr.
    * navigate from <CONTEXT> to <MATNR> via lead selection
      lo_nd_matnr = wd_context->get_child_node( name = wd_this->wdctx_matnr ).
    * @TODO handle non existant child
    * IF lo_nd_matnr IS INITIAL.
    * ENDIF.
    * get element via lead selection
      lo_el_matnr = lo_nd_matnr->get_element( ).
    * @TODO handle not set lead selection
      IF lo_el_matnr IS INITIAL.
      ENDIF.
    * get single attribute
      lo_el_matnr->get_attribute(
        EXPORTING
          name =  `MATNR`
        IMPORTING
          value = lv_matnr ).
    here the variable lv_matnr will contain the entered value......
    now you can use this value for further process.
    Thanks,
    Shailaja Ainala.

  • I installed AVG 2011 Free, and Firefox 4 today on a friends compouter. The AVG Safe Search Toolbar is not available, even after disabling and enabling the Add On. I use AVG 2011 full Licence with Firefox 4 at home no problems. How do I fix this please

    Works in IE no probs, Add On shows in Add On's List. AVG Safe Search Toolbar not available in toolbar lists.

    Because I am having issues with Norton Security Suite with the upgrade to Firefox 4.0.1, I have been dealing with that as well, with no success to-date. However, I did notice today when I was looking in my trash, an interesting thing occurred with the upgrade that MAY have something to do with the apps. in Facebook not working correctly now with Firefox.
    In my trash, there are several folders of 'Recovered Files'. Two of them are loaded with Internet Plugins for Facebook and were all dumped on May 1st, the day I upgraded to v. 4.0.1 Firefox and began having all my problems. For example, they are plugins like: plugin-cross domain.xml, plugin-gateway-1.php, plugin-102452128776.gz-72.json, just to name a few of them. Now, I am wondering if they were inadvertently removed during the upgrade process, or if they are in conflict with the new upgrade. Should I put them all back into Library -->Internet Plug-Ins to see if that resolves the problems? There are so many of them, I wish there was a way to mark them in some fashion in case I would have to remove them and not take the wrong ones out! Maybe there is a way I can color code them before I move them. I hate using 2 browsers!
    I notice that 2 other people have this problem but I don't see where they left any post. I really wish Norton, Firefox, and Facebook would get this ironed out. I never had a problem with anything until this and I don't like to spend all my time trying to troubleshoot something I don't understand! Anyway, thanks for listening.

  • Lost mail after disabling and re-enabling an account

    Using Mail 3.6 on Leopard 10.5.7. I was setting up new MobileMe accounts for myself and my wife. She previously had mail checking a gmail account. After the mobileme account was set up on mail, I unchecked the enable account box in the gmail account settings. When I saw the inbox was gone, I re-enabled the account and saw the inbox with the list of emails return. What I did not realize until the following day is that despite the inbox list of messages (index?) being repopulated, the attached messages were not present. So, after reading some other threads, I chose to rebuild that mailbox. After that, the list of emails is now also gone and I can't find them in the trash or junk folders either.
    Is there any chance for recovery of these messages?

    First pause the mirroring and shutdown the servers.
    If the server network address specifies a fully qualified domain name and Ports are opened, I don't think there will
    be a problem.
    --Prashanth

  • Problem Deleting Previous System after Archive and Install

    Earlier in my time with this wonderful iMac, I did an Archive and Install to try and resolve a slight problem. I read all the docs beforehand and knew it would save the previous system in its own folder and saw that I could likely delete that folder afterwards.
    I have waited months since then, (almost forgotten about this folder) but have never had reason to want anything there, so today decided to delete it.
    I dragged the entire previous system folder to trash and tried to empty trash. It deleted most of the stuff, but kept one package DownloadReader7.pkg complaining of locked files.
    I have used Pacificist to look at the contents of this package and it says it is a receipt. It contains elements of Adobe Reader Download Manager.app
    I have looked on my present working system and can not find an equivalent.
    So two questions...
    1. Is it safe to delete this package (if I knew how)?
    2. If it is safe to delete it, HOW do I, when it appears to have locked elements when I try to empty trash?

    It's safe to delete any files in the PSF.
    Usually all you need do is press the OPTION key before selecting Empty Trash. If that doesn't work the next thing to try is restart the computer after you've dragged the file to the Trash. If neither works then visit The XLab FAQs and read the FAQ on resolving Trash problems.
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • Problem with iPhone Headset after plugging and unplugging from PC

    Hello
    First I would like to introduce myself, My name is Lukasz and I can very happy customer company Apple.
    but...
    I have one problem, which is really annoying , I hope that someone will be able to help me...here we
    A 3 months ago I bought a Apple Headset for my iPhone 4s. After realising iPhone 5 there also been realeased new iPhone headset.http://static5.businessinsider.com/image/50451874eab8eab73c000005-960/iphone-5-h eadphones-rumor.jpg    
    http://static5.businessinsider.com/image/50451874eab8eab73c000005-960/iphone-5-h eadphones-rumor.jpgHere is a link but you probably all know what I mean.
    To last couple days I was saying that Apple is the best, its Quality, Its something amazing, most amazing accessories I ever had.
    But I plug this headset into the normal PC in a college library...quest what happen after that?
    buttons for volume stop working I can only use the headset to listen to music now but I cant change any volume or double click to change the song.
    Since I plugged in and unplugged it into PC they just do not work. (it was a first time when I plugged them into PC since I bought them).
    I heard from a few people that they have the same, but you now, its not supposed to happen like that.
    Such a simply stuff and "all that amaziness and greatness" its not the same now
    Does anyone have solution for that?
    I cant afford to speend another £30 for headset because I plugged them into PC and they do not work any more...
    Please Help,
    Regardless
    Lukasz

    @aion321
    Welcome to the forum!
    AFAIK you would need adapter similar to this one:http://www.currys.co.uk/gbuk/kit-5300auadp-3-5mm-a​udio-adapter-for-nokia-mobile-phones-07960271-pdt.​...
    Happy to have helped forum with a Support Ratio = 42.5

  • Microphone gone after disabling and re-enablin​g it in BIOS (Security - I/O Port Access menu)

    Windows doesn't detect it anymore, and the microphone-mute button is dead.

    I would call the Technical support line.
    - They should have the answer since they live and breath with these day in/out and have access to info knowone else has
    - they can do the same thing on the model (with the factory image you have). We assume you have the factory image!!!
    - once testing in the lab they can get back to you
    There is very little you can do:
    - double check the BIOS retained the change you last made and IT IS STILL ENABLED
    - double check the list in Device manager as to the status (if they're on the list still)
    There is little substitue for hands on trouble shooting and I have know idea what might be missing. All be it you've not supplied any information on any aspect of the machine, configuraton or operating system you have. Nor weither you're using the Win 7 factory image of which type etc
    Call the support line. A competent tech should get you going after a few reboots. If not call back and get someone else who knows what they're doing/have it escalated to someone who knows.
    T520 Model 4239 Intel(R) Core(TM) i7-2860QM CPU @ 2.50GHz
    Intel Sandy Bridge & Nvidia NVS 4200M graphics Intel N 6300 Wi-Fi adapter
    Windows 7 Home Prem - 64bit w/8GB DDR3

  • After disabling and starting in safe mode, the connection time is still extremely slow.

    My cache empties on closing the browser and I delete history every day. Still most times, the connection time is horrible, sometimes up to 80 seconds. I run Malwarebytes and Super Anti Spyware every night. Kaspersky anti-virus runs constantly so it's up to the minute protection. This only started about 7 weeks ago and I've tried all the suggestions I could find on the web, without results.
    My server is Comcast, with 50mbps and I've been very happy with them for the past 3 years. I'm at my wits end and don't know where to turn. Can anybody give me help?

    Hello,
    '''Try Firefox Safe Mode''' to see if the problem goes away. [[Troubleshoot Firefox issues using Safe Mode|Firefox Safe Mode]] is a troubleshooting mode that temporarily turns off hardware acceleration, resets some settings, and disables add-ons (extensions and themes).
    '''If Firefox is open,''' you can restart in Firefox Safe Mode from the Help menu:
    * Click the menu button [[Image:New Fx Menu]], click Help [[Image:Help-29]] and select ''Restart with Add-ons Disabled''.
    '''If Firefox is not running,''' you can start Firefox in Safe Mode as follows:
    * On Windows: Hold the '''Shift''' key when you open the Firefox desktop or Start menu shortcut.
    * On Mac: Hold the '''option''' key while starting Firefox.
    * On Linux: Quit Firefox, go to your Terminal and run ''firefox -safe-mode'' <br>(you may need to specify the Firefox installation path e.g. /usr/lib/firefox)
    When the Firefox Safe Mode window appears, select "Start in Safe Mode".
    ;[[Image:SafeMode-Fx35]]
    '''''If the issue is not present in Firefox Safe Mode''''', your problem is probably caused by an extension, theme, or hardware acceleration. Please follow the steps in the [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]] article to find the cause.
    ''To exit Firefox Safe Mode, just close Firefox and wait a few seconds before opening Firefox for normal use again.''
    When you figure out what's causing your issues, please let us know. It might help others with the same problem.

  • How can i download photos to my IPhone after Disable and Delete ICloud Photo Library?

    I`ve started to use Icloud Photo Library, but i`ve decided to not use anymore because just a few photos were uploaded to the cloud.
    So, I`ve turned off my ICloud Photo Library entirely at Manage Storage section of ICloud Settings. After that i`ve been trying to re-download my photos to my IPhone, by "Transfer and Keep Originals" set up, but it isn`t working!

    You cannot.  this is how the iphone handles photos.
    ALL PHOTOS synced to iphone can be accessed via the "Photo Library".  Those same photos can also be accessed from the folders that you synced.  Just as you can find a book in your public library and you find the same book in the fiction section.
    Stop trying to resolve it as there is nothign to resolve.  All is working as it should.

  • Edit Problem after changing and transporting a table view

    Hallo Experts,
    I hope you can help me.
    I changed a Z-table in the Data Dictionary. For this table there exists an Tableview.
    After I added three new fields I generate a new tableview:
    Utilities -> table maintenance generator
    Change -> create maintenance screen -> ok
    after this I optimized the layout of the screen.
    On our Enviromentsystem my Tableview works perfect.
    I can make changes in the table.
    Then I transported the new tableview to our testsystem.
    There I started the sm30 "Maintain table view" and tried to change table entries.
    After a click on "Maintain" the following Message appears:
    TK 730 Changes to Repository or cross-client Customizing are not permitted.
    The strangest thing is, that before my transport, it worked, I could change table entries.
    There were no changes on the userrights.
    And I can change a similar table on the testsystem.
    I compared the properties of both tables. But I could not find a difference.
    Have anybody an idea where the error can be?

    Hi
    Caution: The table is cross-client
    Message no. TB113
    Diagnosis
    You are in the process of maintaining a cross-client table. You are using the standard table maintenance screen here, which is frequently used to maintain client-specific Customizing entries. This message serves to warn you that each change you make will have an effect on all other clients in the system.
    System response
    You have the authorization required for cross-client maintenance.
    Procedure
    Think carefully about the effect of your changes. Due to logical dependencies between client-specific Customizing and applications data on the one hand and cross-client Customizing data on the other hand, changing or deleting cross-client data could result in inconsistencies.
    Therefore such changes should be carefully planned and coordinated, taking all the clients in the system into consideration.

  • Problem with SPAU Transports after Upgrade and after applying SAPKW70016

    Dear All,
    we copied old dev to new QA, upgraded new QA, then copied new QA to new DEV.
    did the SPAU adjustments in DEV.  At that time DEV SAP_BW version was SAPKW70015.  After that we applied SAPKW70016.  Now we're having problems with the SPAU transport because of the application of SAPKW70016. 
    Requested to kindly suggest ASAP.
    Thanks & Regards
    janardhan Kumar K

    Hi,
    Could you please to be more specific with the error ? Please check the log e send us the message error that is happening during the transport.
    Thanks,
    Walter Oliveira.

  • Problems Syncing music Manually after Disabling Itunes Match

    I recently disabled iTunes match and since doing so I have been unable to manually transfer music to my iphone 4 or transfer purchases from my iphone to my itunes... anyone have a clue to how I might fix this? It's very wierd, it's almost like my computer doesn't recognize my iphone as being assocaited with my account..

    Now I deleted all settings and data from my iPad, restored from backup and tried to sync all music again. Now most of the titles are synced. But there are still about 10 title, that do not sync.
    If I browse for them on the iPad (in iTunes) the information shows the following:
    Size: Stream
    Data rate: 256 kbit/s
    The song in my library is an MP3 with 192 kBit/s. So this information is completely wrong.
    For me it seems, like the music library on the iOS devices got screwed up. The question is, how can I reset my music library without losing all the other data on the devices?

  • Problem with credit note after excise and tax  paid to govt

    Hi friends,
    Here i have one business scenario from credit note after tax paid to govt. Details are :
    1. I raised one invoice on 01/03/08. And raised excise invoice and updated the registers on that same day.
    2. I paid Excise duty on 15/03/08 to govt.
    3. But customer requested new invoice due to few mistakes     (price/qty) in invoice on 16/03/08.
    4. We used credit memo and settled the difference amount to customer.
    5. Now how to get the excise duty/vat back from govt.
    6. As per rules we can't get it from govt.
    7. But no goods retuns here to carryforward the bed to next month.
    With regards
    lakki

    Hi rajesh, Thankyou for response
    One small clarification here,
    in J1IH - ADJUSTMENT- what is the document number i need to enter in that field( document no field : )
    Is it Ecise invoice number or invoice no or delivery no.
    and one more thing what is the A - Certificate in excise invoice.
    How to maintain it
    with regards
    lakky

  • Had mail problem where losing mail after typed and moving cursor made it disappear. Did a reset of Firefox and now don't know how to set up my favorite websites

    that were located in toolbar. Don't remember which toolbar but had all sites I might visit with icons and name. Can't remember how I did that to do over again. 70 y/o now. Hope that fixed my having to retype emails.
    Thanks

    First, are you looking for the Bookmarks Toolbar? If you right-click a blank area to the right of your tabs, you can make sure the Bookmarks Toolbar is turned on.
    Hopefully that's it, but if it was an add-on toolbar, some more digging will be required...
    After a reset, you should have a new folder on your desktop with a name simlar to Old Firefox Settings. Inside that folder, there is another folder named extensions which contains a file or folder for each extension you had before the reset. One of these extensions most likely was responsible for your toolbar. Can you find that folder?
    Unfortunately, many extensions and extension folders are named using long gibberish-like numbers. If the one you're looking for isn't in English, you or a volunteer will need to look up what those are. Once we identify the toolbar, we can figure out what happened to its data (for example, if it's stored on the web, you probably just need to reinstall the extension, but if it's stored locally only on your computer, we probably need to identify and copy its data file to a new location).
    Any luck in your research? How can we help?

  • Problem in conversion routine in CGPL_PROJECT and CPGL TEXT Tables

    Hi experts...
         I have a requirement in Project planning module for audit monitor report...
    Based on the External ID (is nothing but a CAPA Number)in CGPL_PROJECT i need to display description(CAPA Description) from CPGL_TEXT Table..
    But there is a One conversion routine in CPGL_TEXT Table i.e   CONVERSION_EXIT_CGPLP_INPUT
    here input is COR-08-0000000291( CAPA number) and i am getting output as 48D9ED5BE8430069E10080000A8C681D.
    In CPGL_TEXT table fields are GUID , TEXT_GUID,TEXT1.....
    If i give the guid as COR-08-0000000291 out put is
            GUID                                                         TEXT_GUID                                                   TEXT
    48D9ED5BE8430069E1008000          48D9ED81E8430069E10080000A8C681D     CAPA - Review of Requests
    1) IF we compare GUID value here and conversion out put last 8 digits are missing.....(coz  in domain of that field len  gth and conversion lenght are difff)
    2) IF we compare TEXT_GUID and conversion out put  both values are entirely diff .....
      In select query how can i get text Value......
    Can any body please solve me out........
    Regards,
    Praveena.

    solved

Maybe you are looking for

  • Adobe PDF iFilter 9 for 64-bit platforms

    How do I search for a two word phrase as in 'style analysis'.  The software is finding 'style' and 'analysis' not the phrase

  • How to call java bean from jsp

    hi How to call a java bean from jsp page.. Is any other way to call javabean from jsp page apart from this sample code... <jsp:useBean id="obj" class="com.devsphere.articles.calltag.TestBean"/> thnx in advance

  • IPhoto Freezes upon opening

    I am having an issue with opening my iPhoto. When I click on the icon, it will take me to the opening page of IPhoto, but if I try to do anything else on iPhoto (i.e. click on a gallery, a photo-book, etc...) it freezes and I have to "force quit" to

  • CF TF for Export data

    Hi experts, I would like to know if it is possible to make a tranformation or conversión of data when a data file is Exporting. I mean, I'm trying to EXPORT (through Data Manager > Run a data managment package > Data Managment > Export from fact tabl

  • Routine to count unique values

    Hi Gurus, I am BI user,  I am trying to write a routine to populate count if employee and month from source fields is unique. For example: Employee   calmonth       count 10000          01.2008         1 10000          02.2008         1 10001