How to delete an entry in a table when drop a user????

I want to write a trigger that when someone drop a user, delete the related data in one table ..
how to write this one ???

Hi,
You can create a DDL trigger. (a trigger that fire after a DROP command for example):
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7004.htm#i2235611
In this trigger you can look for a specific event (use the ora_sysevent, ora_dict_obj_owner, ora_dict_obj_name system variables if you only wnat to track the drop of users.
you have a such example here:
http://psoug.org/reference/ddl_trigger.html
I suggest you to start with a trigger that log all drop command and then you issue different drop command and see how the trigger is logging the different events ..
Edited by: user11268895 on Aug 16, 2010 10:44 AM

Similar Messages

  • How to delete the entries in CDCLS table

    Hi All,
    There is a potential issue with the size of table CDCLS on production system. We need to reduce or manage the amount of data in this table. CDCLS is a cluster table and cannot be reduced directly,
    So first we were reduced the entries in CDHDR and then from CDPOS tables.
    After that we tried to reduce the entries from CDCLS table through the program - RSSCD7RE, We are facing the error as - no data available and No active archive key was selected.
    Please help me out, how to proceed further in this task. Thanks in advance.

    Go to DB15 and see the archiving object.
    You can also use the archiving object CHANGEDOCU, please refer SAP documents for that.
    Transaction is
    SARA -> Archive object CHANGEDOCU
    Message was edited by:
            ANIRUDDHA DAS

  • How to delete the entries in internal table

    Hi Experts,
    I have 2 internal tables ,
    if i find any same entries of 2 internal tables,  i have to delete that entries in first internal table.
    Regards,
    Srinivasu

    hi check this..
    report .
    data:begin of itab occurs 0,
         f1 type c ,
         f2 type i,
         end of itab .
    data:begin of itab1 occurs 0,
         f1 type c ,
         end of itab1 .
         itab-f1 = 'A'.
         itab-f2 = 12.
         append itab .
         itab-f1 = 'b'.
         itab-f2 = 12.
         append itab .
         itab-f1 = 'c'.
         itab-f2 = 12.
         append itab .
         itab1-f1 = 'A'.
         append itab1 .
    loop at itab1 .
    read table itab with key f1 = itab1-f1 .
    if sy-subrc  = 0.
    delete itab where  f1 = itab1-f1 .
    endif .
    endloop.
    loop at itab.
    write:/ itab-f1,itab-f2.
    endloop.

  • How to delete the entries from NAST table

    Hi,
    Please help me out by providing any function module that delete's the entries from hte NAST table.
    Regards,
    Kiran.L

    REPORT ZSCD_TEST13.
    delete from nast where VSTAT = '1'.
    =====
    If you see the FM : NAST_DELETE_OBJECT, its only useful when NACHA = 7 (i.e. message transmission medium = Simple Mail)
    For others its not useful.
    We had similar issue few days back and after long RnD, we straightaway deleted the entries using the Zprogram.
    regards,
    Edited by: Pranu Pranu on Aug 19, 2008 1:42 PM

  • How to delete obsolete entries in SID table

    I have an Infoobject (0PCA_ITEMNO)  without master data and is used in a DSO. The sid table of the info object and its index has grown very large to about 207 gB. The DSO is periodically selectively deleted to hold the last 3 months data. How can I delete the the old and unused sid table entries to reduce the size.

    Correct...you wouldn't want to delete the SID table values using custom code. This would potentially cause inconsistencies because you may inadvertently delete a SID value that is located elsewhere in your environment.
    For example, if you have an InfoObject with SID value 1 for actual value of A1 and it's deleted. However, there is an InfoCube that has SID value 1 for this InfoObject in a dimension table.
    To remove the values from the SID table for this InfoObject, your best bet is to use RSRV as stated before.

  • BPM question - Delete all entries in a table and Insert data

    Hello,
    I'm new to PI BPM and have this scenario to implement.
    I'm supposed to delete all entries in a table and then insert data to the same table.
    Is BPM necessary? If it is, what is the best practice to implement my scenario?
    I want to make sure that all entries were successfully deleted before insert data.
    How do I check if all entries in the table were deleted successfully before
    initiating insert.
    Thank you.
    -Won

    Hi Won,
    Yes, this is possible without BPM.
    You have to create 2 separate mappings, each for deleting & inserting the records.
    You will have 2 different Interface mappings as well.
    But in ID, create a single interface determination.
    In that, configure Deletion interface mapping first and in the second row, configure Insertion interface mapping.
    Please make sure that the parameter 'Mainain Order At runtime' is checked in interface determination.
    -Supriya.

  • Delete any entry in the table before adding an entry?

    Hello ABAP Experts,
    I have the data in the work area. I can modify / update / insert to the table.
    How to write the ABAP code for this situation.
    1) to delete any entries in the table
    2) update this entry
    so finally always there would be only one entry.
    Suggestions appreciated.
    Thanks,
    BWer

    Hi,
    Delete the entries of table by this stmt.
    DELETE FROM (dbtabname).
    Then insert the values from workarea
    INSERT INTO dbtab VALUES <work_area>.
    And u can upadte the entry with values of workarea by this stmr.
    UPDATE (dbtabname) FROM wa.
    Dont use MODIFY. It will add a new record if its a new entry.
    Rgds,
    Prakash

  • Delete an entry in ASMD table

    Hi Experts,
    Can anyone help me in how to delete a entry in SAP standard table ASMD.
    This table consist of service master data.I tried to create service master data using LSMW tool,but the service master data was created without service number.
    Due to this I'm unable to execute tcode AC03,which gives a short dump .
    the system I'm using doesn't have development access.
    Thanks in advance.

    Hi,
    You can create a DDL trigger. (a trigger that fire after a DROP command for example):
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7004.htm#i2235611
    In this trigger you can look for a specific event (use the ora_sysevent, ora_dict_obj_owner, ora_dict_obj_name system variables if you only wnat to track the drop of users.
    you have a such example here:
    http://psoug.org/reference/ddl_trigger.html
    I suggest you to start with a trigger that log all drop command and then you issue different drop command and see how the trigger is logging the different events ..
    Edited by: user11268895 on Aug 16, 2010 10:44 AM

  • How to find latest entry in the table according to time

    how to find latest entry in the table according to the time
    is there any function module to do so
    \[removed by moderator\]
    Regards
    Shashi
    Edited by: Jan Stallkamp on Aug 25, 2008 4:39 PM

    Hi,
    If you want to read the entry from an internal table,
    sort the internal table in the descending order by the time and
    delete adjacent duplicates by comparing the fields other than time and the internal table will have the latest record.
    Suggestion: instead of only time try to have one more field called date with the time combination
    Regards,
    Ramesh

  • How to check duplicate entries in internal table??

    Dear Friends,
    How to check duplicate entries in internal table??
    Exp: In my internal table if I am having the same records more then ones then I need to print the error message, here I am using steploop for selecting the values from screen, and the values are coming into my internal table if user enter the same value more then ones I need to print the error message.
    Thanks,
    Sridhar

    Hi,
    After storing the data into internal table say ITAb, move the data into another internal table.
    t_dup[] = itab[].
    LOOP AT itab.
        count1 = count1 + 1.
        itab-count1 = count1.
        MODIFY itab.
    ENDLOOP.
    LOOP AT t_dup.
        count2 = count2 + 1.
        t_dup-count2 = count2.
        MODIFY t_dup.
    ENDLOOP.
      DELETE ADJACENT DUPLICATES FROM itab.
      LOOP AT t_dup.
        record_dup = 'N'.
        READ TABLE itab WITH KEY count1 = t_dup-count2.
        IF sy-subrc = 0.
          record_dup = 'Y'.
        ENDIF.
        IF record_dup NE 'Y'.
          t_dup-message = 'DUPLICATE ENTRY'.
          t_dup-flag = 1.
          MODIFY t_dup.
        ENDIF.
      ENDLOOP.
    Use this sample code.
    Reward pts if it is helpfull.
    Regards
    Srimanta

  • How to delete forecast entries with zero current and original qty from a particular forecast set which span across multiple forecasts

    how to delete forecast entries with zero current and original qty from a particular forecast set which span across multiple forecasts

    Hi,
    There is no way to delete those records selectively from front end.
    The best possible way is to delete the records from MRP_FORECAST_DATES tables from backend.
    Hope that helps!!
    Regards,
    Mohan Balaji
    NOTE: Please mark the post as Helpful or Answered if the update has really helped you. This would also bring the thread to logical conclusion and will be helpful for the viewers.

  • How to delete null values in a table

    hi all,
    tell me please any one how to delete null values in a table
    example:
    in emp table is there
    empno ename job mgr sal deptno
    7900 scott 7902 2000 10
    7499 clerk 7900 20
    7834 james manager 3000 30
    like this in the above emp table there are some null values are there
    so how to delete the null values in emp table
    thanks,
    regards.
    Edited by: user9195968 on Feb 25, 2010 6:30 AM

    not too sure what you mean, perhaps you could supply a table description and some sample data
    but, consider
    delete from table_1 where column_1 is null
    commit
    /

  • How to delete the data from partition table

    Hi all,
    Am very new to partition concepts in oracle..
    here my question is how to delete the data from partition table.
    is the below query will work ?
    delete from table1 partition (P_2008_1212)
    we have define range partition ...
    or help me how to delete the data from partition table.
    Thanks
    Sree

    874823 wrote:
    delete from table1 partition (P_2008_1212)This approach is wrong - as Andre pointed, this is not how partition tables should be used.
    Oracle supports different structures for data and indexes. A table can be a hash table or index organised table. It can have B+tree index. It can have bitmap indexes. It can be partitioned. Etc.
    How the table implements its structure is a physical design consideration.
    Application code should only deal with the logical data structure. How that data structure is physically implemented has no bearing on application. Does your application need to know what the indexes are and the names of the indexes,in order to use a table? Obviously not. So why then does your application need to know that the table is partitioned?
    When your application code starts referring directly to physical partitions, it needs to know HOW the table is partitioned. It needs to know WHAT partitions to use. It needs to know the names of the partitions. Etc.
    And why? All this means is increased complexity in application code as this code now needs to know and understand the physical data structure. This app code is now more complex, has more moving parts, will have more bugs, and will be more complex to maintain.
    Oracle can take an app SQL and it can determine (based on the predicates of the SQL), which partitions to use and not use for executing that SQL. All done totally transparently. The app does not need to know that the table is even partitioned.
    This is a crucial concept to understand and get right.

  • How to delete an item in the table

    hi all ,
    Is anyone there to give me an idea , how to delete the item in the table , by selecting the row. , for the what i have to do , is there any documentation to follow , guide me itys really urgent.

    Hai Madhu,
    It is pretty simple.
    First u define a button. and in onAction  Event of the button write the following code.
    process is as follows:
    1)get the node
    2)get the element
    3)using the method remove_element() ,remove the element.
    <u><b>The Sample Code is as follows</b></u>
    DATA:
          node_flighttab                      TYPE REF TO if_wd_context_node,
          elem_flighttab                      TYPE REF TO if_wd_context_element.
        node_flighttab = wd_context->get_child_node( 'FLIGHTTAB' ).
      get element via lead selection
        elem_flighttab = node_flighttab->get_element(  ).
        node_flighttab->remove_element( element = elem_flighttab ).
    Follow the above code ,it will definately help you.

  • Regarding how to delete the record in internal table

    Hi experts ,
    how to delete the record in intarnal table after validating the data,
    if record contains invalid fields?
    i am giving my code see this and give me the answer?
    loop at it_data into wa_data .
    Validate  Cost Center
        READ TABLE it_kostl INTO wa_kostl WITH KEY kostl = wa_data-kostl BINARY SEARCH.
        IF sy-subrc NE 0.
          PERFORM update_error_log USING wa_data
                                         text-004.
        ENDIF.
    Validate source file material ( material number )
    loop at it_mara into wa_mara .
      read table it_ausp into wa_ausp with key atwrt = wa_data-i_matnr .
               if sy-subrc NE 0 .
       PERFORM update_error_log USING wa_data
                                           text-002.
    delete it_data-objek .
         else.
      read table it_mara into wa_mara with key  matnr = wa_ausp-objek .
           if sy-subrc EQ 0 .
           wa_data-objek = wa_mara-matnr.
           wa_data-matkl = wa_mara-matkl.
         ENDIF.
         Modify it_data from wa_data  .
      endif.
    *endloop.
    Validate unit of measure (unit)
        READ TABLE it_t006 INTO wa_t006 WITH KEY msehi = wa_data-unit .
        IF sy-subrc NE 0.
          PERFORM update_error_log USING wa_data
                                         text-003.
        endif.
    Validate delivery location ( storage location )
        READ TABLE it_lgort INTO wa_lgort WITH KEY del_loc = wa_data-del_loc.
        IF sy-subrc NE 0.
          PERFORM update_error_log USING wa_data
                                         text-001.
             if wa_data-flag ='x' .
          delete it_data from  wa_data .
        endif.
        ENDIF.
    endloop.

    Hi Naren,
    First get the index number of the IT_data table and store it in one variable whose declaration like this.
    data: tabix type sy-tabix.
    while reading the internal table it_data set the tabix variable.
    tabix = sy-tabix.
    Instead of  the above use below one.
    Delete it_data-objek
    Use the Below statement it will delete  the row from the internal table.
    Delete it_data-objek index tabix
    Thanks,
    Chidanand

Maybe you are looking for

  • Unable to use Hp Recovery Disk (Shipped Direct from HP) Copy File Error for Windows 8

    I have a Windows 8 HP Envy Dv6-7210US Laptop, I had to order recovery disk from HP to reinstall on the same size hard drive (Hard drive was wiped clean) but in doing so the disc work till got to Disc 2 and then it popped up an Error message (See link

  • Application specific key-value pairs in jndi.properties

    Hello, Can I specify my application specific key-value pair in jndi.properties? I tried something like this java.naming.factory.initial=.jndi.WLInitialContextFactory java.naming.provider.url=t3://localhost:7001 myVar=myVal When i tried looking up "my

  • Error: Object "Dot11BandSelect" does not exist.

    Has anyone else received Error:Object "Dot11BandSelect" does not exist. when configuring the 802.11 settings on a 4400 WLC runing ver. 6.0.196.0 If so what did you do to resolve it. Thanks Barry

  • Java tag library

    if i have a variable myName <% String myName = "Dav"; %> how would i call the variable using java tag libraries? <%@taglib prefix="c" uri="http://java.sun.com/jstl/core" %> i try this, though nothing prints out? <c:out value="${myName}"/>

  • New library gutted by rebuild

    I imported about 10,000 photos into a more or less pristine iPhoto '09 library (managed, not referenced) over the course of the day. I dragged each of several hundred folders to iPhoto one at a time. I tested the library and all photos seemed to be a