get information from inside a trigger of the other tables in the schema even

Addendum:

... Sorry I forgot: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64 bit

*******************

Hello

I'm trying for a few hours to get information from inside a trigger to another table in the same pattern.

My trigger is PSE_BKB. NUM_PHANTOM_BP

I first tried a simple solution...


CREATE OR REPLACE TRIGGER PSE_BKB. NUM_TR_PHANTOM_BP
BEFORE DELETING, INSERTION OR UPDATE
ON PSE_BKB. NUM_PHANTOM_BP
REFERRING AGAIN AS NINE OLD AND OLD
FOR EACH LINE
DECLARE

v_recht NUMBER (1): = 0;
v_recht2 NUMBER (1): = 0;
v_change_mitarbeiter NUMBER (1): = 0;
v_recht_mitarbeiter NUMBER (1): = 0;
v_typ varchar2 (20);
v_obj_key varchar2 (11): = "gugus";
v_ph_key varchar2 (11);
-ph_key varchar2 (11);
v_obj_keys varchar2 (4000): = ', ';

anz_num NUMBER: = 0;
anz_num_tmp NUMBER: = 0;
anz_st_si NUMBER: = 0;


BEGIN

...
Select count (*)
in anz_num
of pse_bkb.num_objekt o
where o.obj_key in
(select distinct (ov.obj_key)
of pse_bkb.num_objekt_verb ov
where ov.phantom_key =: old.phantom_key
)
and o.typ = "NUM";

...

Explanation: my trigger table is PSE_BKB. NUM_PHANTOM_BP.

On the pse_bkb.num_objekt_verb of the table, I have a relationship 1: n to one or several object-key (field named obj_key!) on my referenced key: old.phantom_key. With this obj_key, I want to watch the weather, I have one or more lines in the table type num_objekt "NUM". So the internal selection gives me all the num_objekt_verb obj_key with my: old.phantom_key and with whom I count the number of lines I have on num_objekt with type "NUM".

The problem is that the trigger does not see the table.

I tried many variations.

The latest version I tried was with a cursor inside the trigger definition as in the block of code below.

For debugging purposes, I inserted a RAISE_APPLICATION_ERROR in the inner loop - see below. The v_obj_key variable is never defined, as in all the other variations, I tried-, I still see the predefined "gugus" in the declare section.

It seems that oracle can not read other tables at this point. La: old.phantom_key is defined (in this simple example there would come a return obj_key).

Thanks in advance for your help - and excuse my English.

Trigger code:

CREATE OR REPLACE TRIGGER PSE_BKB. NUM_TR_PHANTOM_BP
BEFORE DELETING, INSERTION OR UPDATE
ON PSE_BKB. NUM_PHANTOM_BP
REFERRING AGAIN AS NINE OLD AND OLD
FOR EACH LINE
DECLARE

v_recht NUMBER (1): = 0;
v_recht2 NUMBER (1): = 0;
v_change_mitarbeiter NUMBER (1): = 0;
v_recht_mitarbeiter NUMBER (1): = 0;
v_typ varchar2 (20);
v_obj_key varchar2 (11): = "gugus";
v_ph_key varchar2 (11);
-ph_key varchar2 (11);
v_obj_keys varchar2 (4000): = ', ';

anz_num NUMBER: = 0;
anz_num_tmp NUMBER: = 0;
anz_st_si NUMBER: = 0;


BEGIN


Start
declare

cursor nums is

Select obj_key
of PSE_BKB.num_objekt_verb
where phantom_key =: old.phantom_key;

Start

for the RC looping nums
v_obj_key: = cr.obj_key;

RAISE_APPLICATION_ERROR (-20099,' AGAIN 9 v_obj_key: ' | v_obj_key |) ': old.phantom_key ' | (: old.phantom_key);

When the exit nums % NOTFOUND;

Select count (*) in the pse_bkb.num_objekt anz_num_tmp where obj_key = v_obj_key and type = "NUM";
anz_num: = anz_num + anz_num_tmp;
end loop;

end;
end;

Published by: user832075 on 14.01.2013 06:18

The reason why you get count_n = 0 in tr_c is that there is no line in B with key_c = 17, to the moment you arrive at tr_c. The removal of B has already occurred, and since you're in a single transaction, the application for tr_c:

select count(*)
  into   counter_n
  from   a aa
  where  aa.key_a in (select distinct(bb.key_a)
                      from   b bb
                      where  bb.key_c = v_ph_key
                     )
  and    aa.typ = 'n';

'knows' that the row has been deleted then gets a number of 0.

I added a set of instructions dbms_output to show the order in which triggers run, and that's what I get:

SQL> delete from b_vw where key_a = 1 and key_c = 17 ;
in trigger b_tr_vw
In tr_b
in tr_c
delete from b_vw where key_a = 1 and key_c = 17
            *
ERROR at line 1:
ORA-20077: Remark: counter_n: 0 counter_s: 0 v_ph_key: 17 old.key_c: 17
new.key_c:
ORA-06512: at "OPS$ORACLE.TR_C", line 38
ORA-04088: error during execution of trigger 'OPS$ORACLE.TR_C'
ORA-06512: at "OPS$ORACLE.B_TR_VW", line 17
ORA-04088: error during execution of trigger 'OPS$ORACLE.B_TR_VW'

Thus b_tr_vw trigger is triggered first and deletes a B. trigger fires tr_b as part of this statement to remove and check against A, happening apparently so no error is triggered and succeeds the removal of B. Now tr_b_vw takes back control and deletes C. Since the B line which has key_c = 17 already deleted a control for counter_n > 0 and counter_s = 0 fails and raise you the-20002 error. Note that I'm assuming that the error of-20077 you lift is just to see the values and is not intended to be part of your actual code.

Because I have really no idea what you're trying to accomplish here I can't offer a lot of advice that you might want to try entering two tr_c of the tr_b_vw trigger validation queries before deliver you the removal of b and put the counter_n > 0 and counter_s = 0 control under tr_b_vw to decide whether or not you want to remove.

John

Tags: Database

Similar Questions

  • get information from the sms message

    How to get information from sms

    ex: 1. the sender's phone number

    2. sms text

    Check the interface messages and methods like getAddress(), text, getPayLoadText.

  • currently still have PP CS5.5 & want to install on another office, understand that I can only use one at a time. don't have a CD, can I get information from the current installation and a link to download PP CS5.5?

    currently still have PP CS5.5 & want to install on another office, understand that I can only use one at a time. don't have a CD, can I get information from the current installation and a link to download PP CS5.5?

    Download & install instructions https://forums.adobe.com/thread/2003339 can help

    -includes a link to access a page to download the Adobe programs if you do not have a disk or drive

    Find your http://helpx.adobe.com/x-productkb/global/find-serial-number.html serial No.

  • Why can't get information from frequency of NI USB-5132

    Hello

    I use NI USB-5132 and try OR Scope example measure a library.

    I wonder why I can't get information from the input signal frequency.

    Thank you

    In the flexible Panel, you need to adjust the time/Div and, possibly, the Volts/Div to get a consistent result. Make a note of the settings.

    Based on what you used in the soft cover, you must change the parameters of the VI until you see a signal. If you don't see something here, then obviously you can not perform a measurement. Try other examples to see if you can capture at least the waveform.

  • How to get information from web interface tables

    Hello

    How to get information from web interface tables

    as in the forms... Go to help-> Diagnostics-> review
    Block = SYSTEM field is LAST_QUERY.

    Kind regards.

    Salvation;

    Please see the paragraphs below:

    How to determine the Table and the name of the column to a field in a form in 11i [ID 259722.1]
    How to find the query that succeeded recently? [241628.1 ID]

    Respect of
    HELIOS

  • How to extract information from tree logical structure using the PDF Library?

    How to extract information from tree logical structure using the PDF Library?

    Adobe's PDF Library has PDSEdit APIs to extract information of the logical structure of a tagged PDF file.

    But I couldn't find any example code to demonstrate the C API on PDSEdit layer.

    I google search using different keywords, find none.

    I contact datalogics (which gives me the evaluation of adobe PDF library copy), no code sample on APIs PDSEdit yet.

    Everyone knows any code example can demonstrate extract structure logic tree information PDSEdit APIs (in C/C++ or Java)

    from a tagged PDF file? And is there any sample to demonstrate that connects a tagged logical tree contained in the content stream?

    I thank very you much in advance!

    logicaltree

    Did you look at the code snippets in the SDK?  There are a bunch of samples to work with PDSEdit and structure/marking.

  • Get information from the low level of the Subvi ni5660

    A quick explanation of the problem: I need to create several VI just to return a value of the PXI-5660 (ex: Center frequency, Span, etc.) while the entries are only a "VISA" and one "error in.»

    Detailed explanation of problem: I need to create multiple VI that the properties 'Set' or 'Get' of the PXI-5660 module (ex: the Central frequency value, get frequency, etc...).  Each VI must have a VISA in/out and in/out Error, but the only other present in/out should be the property of game/called.  Global variables are not allowed.

    One of the biggest problems for me is that ni5660 drivers do not contain a property node.  I managed to (apparently) set some of the properties by feeding only a single entry in the icon 'configure ni5660 for spectrum', but the only tool that seems to be able to output all information is the icon «MT get Attributes»  The release of 'MT get Attributes' does not contain many of the properties that I need good output.

    I tried to use the icon 'MT get Attributes' linked to "ungroup by name" which has the value "handle receiver.handles.niScope" which feeds on the reference to a property niScope node, hoping that I would be able to obtain information through the niScope 5660 (it seems that ni5660 software uses the niScope on a lower level software ", correct me if I'm wrong).  This VI finished, when put online with the 'ni5660 Initialize.vi' and ' ni5660 Close.vi, ' returned the error (-1074135028) with the explanation 'ID attribute not recognized.' ""  (The error occurred on the property node in the Subvi "Get the Central frequency")

    The goal is to make the action of PXI chassis similar to a HP8563E Spectrum Analyzer.  With this in mind, the list of attributes that I will need in the end to set and get (the separate VI) are the following: Center frequency, Span, window, number of Points, resolution bandwidth, level of reference, mitigation and time sweep.

    I apologize for my (very probably) simple question, but endless (I only started programming in LabVIEW there about 2 weeks).  If someone would be able to point me in how to make apparently PXI-5660 current property settings from thin air, I would be very grateful.  If more information or details are needed, feel free to ask.

    Thank you

    zdunn wrote:

    ....

    but unfortunately, I'm still at a loss, how to create a VI that "calls" that same property back and the fate, while using only 'VISA In' and 'In Error' as inputs.

    Located on how silly that statement. You want to create a function where (for example) you want to set the resolution bandwidth and do not want to pass as a parameter the name of the instrument. You have created the programming language that is able to read minds?

    You can use a function where you can pass a parameter in (or use a function that retrieves a parameter) or do nothing at all with the instrument. It is more complicated than that.

    There are tutorials available that can help yu with LabVIEW to learn, but I think that there are certain fundamentals means.

    Edit: Sorry, I may have misunderstood. to query does not require an entry but I don't understand what you want to query. The parameters of the instrument are all under control stripped - a program you or any other writing. Unlike a GPIB instrument, there is no one '?' command to read a rear frame. It is assumed that you know how the instrument has been configured in the first place.

  • How can I get information from performance on disc with vFoglight 6.5 latency?

    Can someone tell me where I can get info from performance on disc with vFoglight 6.5 latency?

    There are also alarms that deal with the latency of disk. You are looking for a report or dashboard? Check the alarm Viewer and define a filter on the "latency". This will show you all the current latency time, then you can explore the host or logical unit number that is having the problem.

  • Get information from Netapp in VCOPS

    I managed to install adapter netapp for vcops and able to gather all the information.

    However, how can I have any widget showing me netapp volume/aggregate/system specific to a data store.

    In other words, using my overview of the application, I fed my vc relationship. Then I click on my store of data and I want that it show me

    health of the aggr, the lun, the volume and the system staying on the dastore. How can I get a receiver such widget?

    It can be done, but it is a custom job. It says relationship running scripts in the manual, but which requires either another adapter in relation to a request file to face the Database postgres which is JOINS the data to determine the parent/child. The problem is, you may or may not have data in the identifiers of resourcekind to make this association... e.g. canonicalname NetApp LUN to vCenter Datastore or anything of the sort... YMMV Yes. The new adapters have this logic of relationship already included, so no need to script.

    I had earlier suggested looking at the adapter of the BM NetApp IS the adapter for NetApp to go forward with the brand VMW MP getting EOL old.

    You run the old adapter EOL or the more recent SolutionsExchange (BM)?

  • How to get information from the owners of devices (NMP and Powerpath) using the VI SDK

    Hello

    I just started to work with VI SDK in C++ using gsoap. I am

    facing a problem. Using VI SDK, where can I get more information

    regarding who manages the paths. Inside of the VI GUI client we can

    see that in the owner field. The GUI shows if the owner is NMP

    or powerpath. Can I get the same information by using VI SDK API? I'm not

    able to conclude within ScsiLun HostMultipathInfoLogicalUnit or

    HostMultipathInfoPath Dataobjects.

    Kindly help me.

    Thank you

    Gesner

    Ah good to know it is where it is located.

    national immunization days , you can find more info here: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.host.PlugStoreTopology.html#path

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    repository scripts vGhetto

    VMware Code Central - Scripts/code samples for developers and administrators

    http://Twitter.com/lamw

    If you find this information useful, please give points to "correct" or "useful".

  • Get information from the Bank of Tables HZ

    Hi I mostly use CE_BANKS_V for the information of the Bank, but in case I want this HZ_PARTIES table information so how I can get because there is presented data of parties, people, etc.. i don't know which one I should mention to get only the condition information stores.

    Kind regards
    Shakeel Khan

    Hi Shakeel

    If you see the script for ce_banks_v, it uses the table hz_parties only. You can use the following query (this one is taken by the script of ce_banks_v only):

    Select * from
    hz_parties bankparty, hz_code_assignments bankca
    where
    bankparty.party_type = "ORGANIZATION".
    AND bankca.class_category = 'BANK_INSTITUTION_TYPE. '
    AND bankca.class_code IN ('BANK', 'CENTRE')
    AND bankca.owner_table_name = 'HZ_PARTIES. '
    AND bankca.owner_table_id = bankparty.party_id
    AND NVL (bankca.status, 'A') = "A".

    Thank you
    Serge

  • In my attempt to get information from IP addresses only Flash on the screen for a second

    When I type in ipconfig on my guest information only flashes on my screen for a second. He's just there.

    Open a first order - instead of typing IPCONFIG in the run box, type CMD instead. Then, type IPCONFIG inside the command prompt box that opens.

  • Get information from my computer about the details of the graphics card and so on, in order to install games.

    From the control panel > Performance and tools > can't view and print details of the basis of the normal English Windows experience index. See below. This is what is displayed in Notepad.  The reason why I'm doing this is because I was not able to install Games 2/2, I bought. The guy at EB Games says print a list of information on the computer so that I could buy the appropriate game. I would like to have a game on my computer. My friend recommended to Doom 3. Is there something that exists and why I receive this report not readable?


    Check this similar thread:

    Printing performance information

    In the end, make sure that HKEY_CLASSES_ROOT\htafile\Shell\Open\Command is set to one of the following values, depending on the architecture of the operating system:

    x 64:
    c:\windows\syswow64\mshta.exe "%1" % *.

    x 86:
    c:\windows\system32\mshta.exe "%1" % *.

  • Get information from the file for use in Action of PS

    I am trying to create an Action that adds text from a photo of an image metadata.

    When recording an Action, I could open the information file and copy the text and then paste the text from the image. However, when I replay the Action on another image, for example the text of the original photo is pasted, the Action does not save the copy and paste it to the Clipboard.

    How can I automate paste the title of the Document, Description and other similar texts on a picture?

    The larger goal is to create a Droplet use to process a large number of images exported from Lightroom. However, I have not been able to successfully create the first step of a PS action that does what I need.

    Thanks for any help with this problem.

    Old Photo from Photoshop Web Gallery function would be inspired by galleries that could include the Image title and Description that is stored in the metadata of the Image. My scripts SimpleViewer and WS-Slideshow Photoshop create Web Flash galleries that support also the title and description of the metadata of the image and EXIF and notice of copyright. only Copyright metadata are superimposed on the image that the rest of text is displayed by Flash player in the XML file built by Photoshop script using the metadata of images. Example http://www.mouseprints.net/SVNewZealand/ws-slideshow.html

  • How to get information from the view on the columns referenced in the tables

    Hi all

    I was looking for view DBA Oracle DB that displays information on the notice. In particular, I want to find information for each column in a view - of which table is this column and what his original name of the column. Is this possible at all?

    Thanks in advance!

    If you are looking for a view dictionary

    question

    Select *.
    dict
    where table_name like '%%'
    ;

    or consult the Oracle reference manual for your unknown version of Oracle.
    The answer is so obvious...

    -----------
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for