PL/SQL  on delete cascade..   ( how  to view the child record deleted..?)

Hai
i have 70 tables integrated with foreign and child key constraints. i have on delete cascade for all the child tables. if i delete the parent table automatically child table record get deleted.
Kindly tell me how can i check howmany child record has been deleted ..? how can i monitor this...?
one thing i can do... i can make count of child table before and after...
is there anyother way..?
S

Peter,
I subscribe to the general consensus around trigger usage. Allthough I allways diffentiate between triggers that,
- perform pl/sql with embedded DML (that is: delete, insert, update)
versus triggers
- that perform pl/sql with embedded queries only.
The latter use of triggers is good (in my opinion), and most frequently used to enforce (non declarable) data integrity constraints.
The former use of triggers is bad. Because it makes things happen automagically.
Just google "asktom triggers are evil", you'll find statements such as:
~quote
because things happen automagically
because side effects are bad
because explicit linear code is more maintainable then "happens as a by product of something in the background"
magic should be avoided. Experience tells me this.
~quote
And to me a CASCADE DELETE clause on a foreign key definition, is a TRIGGER. Allbeit not one for which you had to write CREATE TRIGGER statements, but one that you can declaratively introduce. And this trigger holds embedded DML, it is of the former case, and is therefor bad.
You the designer of the application may be aware that you have your FK's as cascade delete. But your successor(s) might not be aware of this when they write maintenance code to delete Orders. They might be expecting the database to throw them an FK violation message when they try to delete an Order that still has Lines attached to it.
Everybody knows the effect of an INSERT, a DELETE, an UPDATE. But the moment you've introduced triggers with embedded DML in them, the effect of these three well known primitive SQL statements suddenly becomes unknown. With triggers you can create any effect for any of these three primitives, that you want. And more often than not other people maintaining your codebase later on in the future, do not realize these side effects happen, because they didn't check the presence of any triggers, nor investigated the side effects caused by them.
Btw. for exactly the same reasoning I consider use of DEFAULT-clause on table columns, or even use of (fixed length) CHAR datatype, evil also. Again they are in effect declarative triggers with side effects. Allbeit that their side effects usually are less worse than those caused by handwritten triggers with embedded DML.
Toon

Similar Messages

  • How to view the sql query?

    hi,
      how to view the sql query formed from the xml structure in the receiver jdbc?

    You can view SAP Note at
    http://service.sap.com/notes
    But you require SMP login ID for this which you should get from your company. The content of the notes are as follows:
    Reason and Prerequisites
    You are looking for additional parameter settings. There are two possible reasons why a feature is available via the "additional parameters" table in the "advanced mode" section of the configuration, but not as documented parameter in the configuration UI itself:
    Category 1: The parameter has been introduced for a patch or a SP upgrade where no UI upgrade and/or documentation upgrade was possible. In this case, the parameter will be moved to the UI and the documentation as soon as possible. The parameter in the "additional parameters" table will be deprecated after this move, but still be working. The parameter belongs to the supported adapter functionality and can be used in all, also productive, scenarios.
    Category 2. The parameter has been introduced for testing purposes, proof-of-concept scenarios, as workaround or as pre-released functionality. In this case, the parameter may or may not be moved to the UI and documentation, and the functionality may be changed, replaced or removed. For this parameter category there is no guaranteed support and usage in productive scenarios is not supported.
    When you want to use a parameter documented here, please be aware to which category it belongs!
    Solution
    The following list shows all available parameters of category 1 or 2. Please note:
    Parameter names are always case-sensitive! Parameter values may be case-sensitive, this is documented for each parameter.
    Parameter names and values as documented below must be used always without quotaton marks ("), if not explicitly stated otherwise.
    The default value of a parameter is always chosen that it does not change the standard functionality
    JDBC Receiver Adapter Parameters
    1. Parameter name: "logSQLStatement"
                  Parameter type: boolean
                  Parameter value: true for any string value, false only for empty string
                  Parameter value default: false (empty String)
                  Available with: SP9
                  Category: 2
                  Description:
                  When implementing a scenario with the JDBC receiver adapter, it may be helpful to see which SQL statement is generated by the JDBC adapter from the XI message content for error analysis. Before SP9, this can only be found in the trace of the JDBC adapter if trace level DEBUG is activated. With SP9, the generated SQL statement will be shown in the details page (audit protocol) of the message monitor for each message directly.
                  This should be used only during the test phase and not in productive scenarios.
    Regards,
    Prateek

  • How to view the login log in window NPS after login cisco switch and without SQL server database

    how to view the login log in window NPS after login cisco switch and without SQL server database
    in summary 
    there is only log with event id 4400
    A LDAP connection with domain controller XCPAWS20.cyberport.noc for domain NOC2 is established.

    Hi adil,
    For your issue, you can create a custom security token service (STS) and then set up a trust relationship between a SharePoint 2010 farm and the custom STS.
    For more information, you can refer to the articles:
    http://forums.asp.net/t/1335229.aspx?Sharing+Authentication+Ticket+Between+ASP+NET+and+Sharepoint
    https://msdn.microsoft.com/en-us/library/office/ff955607(v=office.14).aspx
    http://www.paraesthesia.com/archive/2011/02/01/working-with-windows-identity-foundation-in-asp-net-mvc.aspx/
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to view the planned orders in mass and how to delete in mass

    Hi gurus,
    How to view the planned orders in mass and how to delete in mass.
    Regards
    R.Rajakarthik

    Hi,
    Use the collective display of planned orders, transaction code MD16.
    You can select the data by different options and choose which ones or all that you need to delete.
    Click the Delete button to trash them.
    This will delete planned orders without deleting the planned independent requirements and sales orders.
    Hope it helps

  • How to view the cancelled/deleted sales order?

    Hi SAP Gurus
    I there any T.code/Table to view the cancelled or deleted sales order.
    I am not able to view the order even in VA03.
    Regards
    Giridhar

    Dear Sushmitha,
    T. Code: SE16
    Key-in -
    Table: CDHDR - Change Document Header.
    Table: CDPOS - Change Document Items.
    and "Enter". On to next page, Key-in
    Field: Change doc. object (OBJECTCLAS) as VERKBELEG
    Field: Transaction Code as VA02
    Field: Appl.obj.change, as D - Delete, and execute (F8).
    Then you will get object values (sales orders) and document numbers. Pass these two values along with objectclas: VERKBELEG) to table CDPOS to get more details about these deleted orders.
    Also, Go to -
    T. Code: SE38,
    and execute Report: RVSCD100.
    Enter Sales Document Number and Execute. This will provide information, who deleted the order.
    Best Regards,
    Amit

  • How to view the table at the application level

    Dear All,
    How to view the table in the Data Dictionary at the application level, If a table is created at the database level by using CREATE statement.
    code/
    create table zmard as select * from sapone.mard where 1 = 2
    /code
    I would like to view the table above, which is created at the Oracle database level in the Data Dictionary.
    can anyone guess the solution.
    Best wishes
    Mahesh

    Hi
    U should create a program using SQL native in order to select and show the data.
    By SE11 or directly in the program u can define a structure like your table:
    DATA: BEGIN OF W_ZMARD,
                  FIELD,
              END     OF W_ZMARD.
    EXEC.
       OPEN CURSO FOR SELECT * FROM ZMARD
    ENDEXEC.
    DO.
      EXEC.
         FETCH NEXT CURSOR INTO :W_ZMARD
      ENDEXEC.
      IF SY-SUBRC <> 0.
         EXIT.
      ENDIF.
      WRITE: / W_ZMARD-FIELD,
    ENDDO.
    EXEC.
      CLOSE CURSOR
    ENDEXEC.
    I don't know if it's possible to create a view in SE11, because it's needs a table just defined in SE11, u can create a new view ZMARD based on MARD but I don't believe it'll use your table.
    Max

  • Hi i am using oracle 10g how to view the content of the stored procedure or trigger ?

    Hi i am using oracle 10g .How to edit  the content of the stored procedure or trigger ?

    jklopkjl wrote:
    Hi i am using oracle 10g .How to view the content of the stored procedure or trigger ?
    query ALL_SOURCE
    SQL> desc all_source
    Name                                      Null?    Type
    OWNER                                              VARCHAR2(30)
    NAME                                               VARCHAR2(30)
    TYPE                                               VARCHAR2(12)
    LINE                                               NUMBER
    TEXT                                               VARCHAR2(4000)

  • How to view the DDL script prior to object deployment in OWB 10g R2?

    How to view the DDL script prior to object deployment in OWB 10g R2?
    Here is what I' looking for: in 10gR2, let's say I've built dimension X, but it's not deployed yet. I've selected one of the deployment options, let's say: "Deploy to Catalog only". Now, I'd like to see a DDL script that will be executed at the deployment time. Where can I find this script? What screen? What menu?
    Thanks,
    vr

    Viewing the Scripts
    After you have generated scripts for your target objects, you can open the scripts and
    view the code. Warehouse Builder generates the following types of scripts:
    ■ DDL scripts: Creates or drops database objects.
    ■ SQL*Loader control files: Extracts and transports data from file sources.
    ■ ABAP scripts: Extracts and loads data from SAP systems.
    To view the generated scripts:
    1. From the Generation Results window, select an object in the navigation tree on the
    left of the Generation Results dialog.
    2. Select the Scripts tab on the right of this dialog.
    The Scripts tab contains a list of the generated scripts for the object you selected.
    3. Select a specific script and click the View Code button.
    Regards,
    Marcos

  • How to view the change immediately after a java file is modified without restarting server or redeploy?

              Hi All,
              How to view the change immediately after a java file that is used in jsp is modified
              without restarting server or redeploy?
              Moreover, it is better to keep the original session.
              Any suggestion is appreciated.
              Kammau
              

              Hi,
              In order to have a new version of a java class, the current classloader must be
              deleted and a new one created. This is what redeployment does. I believe that
              this is more of an issue with Sun's implementation of classloaders. You could
              ask BEA support (719.232.7878) and see if they have any plans to periodically
              check jar files to see if java class file timestamps and destroy and re-create
              classloaders on the fly.
              1) You will still have to accept the performance hit of destroying classloaders
              and creating new ones. There isn't any way around that.
              2) I would think you would want to have more explicit control in production and
              integration anyway.
              You can redeploy applications from the command line (script) file not just the
              console.
              Hope this helps,
              pat
              "Kammau" <[email protected]> wrote:
              >
              >Hi All,
              >How to view the change immediately after a java file that is used in
              >jsp is modified
              >without restarting server or redeploy?
              >Moreover, it is better to keep the original session.
              >Any suggestion is appreciated.
              >
              >Kammau
              

  • OOM PermGen... How to view the content of permgen

    I have a pretty big java application running on windows and linux (redhat) using JBoss as the application server.
    The application has been running for a long time without issues and now, with the end of a new release of our software, under heavy load, we are running out of perm gen space.
    What I would like to see is a tool that lets me view the content of the perm gen space so I can determine why we are using so much memory.
    I am aware of jmap -permstat (on linux only) that should let you view some info about permgem but for me, jmap connects to the java process and never comes back. I tried a profiler (jprofiler) and again, I can't find info about what is occupying the permgen memory space.
    Can someone suggest tools, or methods to get to the content of the permgen space so I can determine what our issue is?
    Here are our startup options; as you can see it has been tuned quite a bit for maximum performance for our usage patterns.
    I would appreciate any help chasing down this issue.
    Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_02-b05, mixed mode)
    -Xms8000m
    -Xmx8000m
    -Xss256k
    -XX:PermSize=256m
    -XX:MaxPermSize=256m
    -Xmaxjitcodesize96m
    -XX:+UseParNewGC
    -XX:+HandlePromotionFailure
    -XX:ParallelGCThreads=16
    -XX:GCHeapFreeLimit=10
    -XX:NewRatio=3
    -XX:SurvivorRatio=2
    -XX:InitialSurvivorRatio=2
    -XX:MinSurvivorRatio=2
    -XX:GCTimeRatio=19
    -XX:MaxTenuringThreshold=128
    -XX:TargetSurvivorRatio=90
    -XX:+ClassUnloading
    -XX:ErrorFile=hs_err_<pid>.log
    -XX:HeapDumpPath=java_<pid>.hprof
    -XX:-HeapDumpOnOutOfMemoryError

    jklopkjl wrote:
    Hi i am using oracle 10g .How to view the content of the stored procedure or trigger ?
    query ALL_SOURCE
    SQL> desc all_source
    Name                                      Null?    Type
    OWNER                                              VARCHAR2(30)
    NAME                                               VARCHAR2(30)
    TYPE                                               VARCHAR2(12)
    LINE                                               NUMBER
    TEXT                                               VARCHAR2(4000)

  • TS1815 Subject: What Mountain Bike help  I can't download my magazine, what mountain bike skills issue. I've followed the advise on the help questions but still can't view the magazine. Delete, re install etc.

    Subject: What Mountain Bike help
    I can't download my magazine, what mountain bike skills issue. I've followed the advise on the help questions but still can't view the magazine. Delete, re install etc.
    Thanks Malcolm

    said article below....
    HT1747: iTunes: How to remove and reinstall the Apple Mobile Device Service on Mac OS X 10.6.8 or Earlier
    Learn about iTunes: How to remove and reinstall the Apple Mobile Device Service on Mac OS X 10.6.8 or Earlier

  • How to View the Loaded Data

    Hi,
    I have loaded the data into an ODS from an External Flat file and executed the job. Can anyone guide me how to view the loaded data in the ODS ?
    Thanks

    Hi Madhu,
    You can simply Goto Transaction LISTCUBE and give the ODS name -> Execute.
    Regards
    Hemant

  • How to view the Users in the Portal Activity Report

    Hello,
    Can anyone tell me how to view the Report of users who have logged in a specific time. For Example I would like to view the users who have logged in between 9.00 am and 9.15 am. Is it possible to view mentioning the country name?
    Please explain me in detail how to view the Report.
    Thnx in Advance
    cheers,
    Murali

    hi,
    You can certainly do it for hourly basis but i am not sure whether it could be done quarter an hour basis. Also The portal nodes within a cluster can be in different time zones, yet the activity data from all nodes are aggregated together and reported together. To enable the reporting of hourly data from different time zones, portal activity reports display hourly data based on the GMT time zone.
    Do see the documentation
    http://help.sap.com/saphelp_nw04/helpdata/en/fb/144120ea5b4e9c9385d493a578d6c9/frameset.htm
    Weblog :Portal SP9: Portal Activity Report
    Regards,
    Ganesh N

  • How to View the Scheduler in ODI Console

    Hi
    In ODI Studio, we may Schedule a Scenario and also, we may view all Schedules process from the Agents (View Schedule option).
    My colleagues are going to use ODI Console, but we cannot find out HOW to View the Schedule in ODI Console.
    In Oracle documentation about FDMEE, we can read the following: If you want to cancel a specific instance of a schedule, use the ODI Studio or ODI Console... see the PDF document in attachment.
    Regards
    Claude

    To display the schedule for one agent:
    In Topology Navigator expand the Agents node in the Physical Architecture accordion.
    Select the Physical Agent you want to update the schedule.
    Right-click and select View Schedule.
    The Schedule Editor appears, displaying the schedule for this agent.
    Check: http://docs.oracle.com/cd/E17904_01/integrate.1111/e12643/running_executions.htm#ODIDG634
    HTH -
    Jasmine

  • HOw to view the records in a structure qaqee ?

    hi every one ,
    we can view the tble through SE16 
    HOw to view the records in a structure qaqee ?
    Thanks in advance

    Hello,
    Please check the link
    http://help.sap.com/saphelp_erp60_sp/helpdata/EN/90/8d7301b1af11d194f600a0c929b3c3/content.htm
    You can view the struture in SE11 t-code for its components.
    Regards,
    Shailesh

Maybe you are looking for

  • How to get sour to play through mini display via vga without sound cables?

    I know that many of you guys might tell me that this question is stupid or that it is impossible to do it but i run in to problems that usually the company that made the product can't asnwer it all the time. So here it is. I have the mid 2009 MBP 17

  • MAC OSX 10.5.8 HP C7280 not printing - communication failure

    I have a Mac OSX 10.5.8 , It has been wirelessly connected to mt HPC7280 for a long time and prints perfectly up until today. The queue shows "printing" for a while but nothing prints and then I get this messege: "Communication Failure: The computer

  • In Need Of Divine Intervention

    Need some help with this. I can't seem to get the "browse" button to browse my PC for images in the Upload frame. The "Cancel" button is closing the entire programme instead of just the Upload frame. Anyone know the problem? i just started java bout

  • How to make Geological Cross Sections in Adobe Illustrator?

    I have been tasked with producing a geological cross section in Adobe Illustrator. It is a lengthy process, as I am new to the software. I never learned it in my GIS studies. I know that there is plenty of GIS software out there to produce x sections

  • Incomplete Recovery and Read Only

    Ok, I seem to be missing something. I've performed an incoplete recovery to a specified SCN. Everything is great if I open the database with resetlogs. But, the documentation (see quote below) says I can open the database as read only to check the re