How to manage database triggers

Greetings,

I have an application on JDeveloper 11.1.2.4.0. At some point the user add new customer and its been stored in the database.

Because the application can be used in more than 1 shop, I created a 2nd data base, only for the uses of biography and history,

So, it can be seen by all the shops. What I did may, if there is a new record is inserted in the table of biography of the application, I also have a trigger

When the row is inserted, I also insert the new line in my database 2. In the two databases, there is a primary key to avoid a copy of the id

I was hoping instead of manipulate records duplicated the trigger, it will manage the database (if duplicate records exist, just do not save at all),

but my problem now is, his jet me an appropriate exception

ORA-00001: unique constraint (PERSONAL_RECORD. BIOGR_PK) violated ORA-06512: at «ELAB.» SAVE_BIOGR', line 11 ORA-04088: error during execution of trigger ' ELAB. SAVE_BIOGR' ORA-06512: at line 1

AND it does not record the biogr on the 1st database either. I don't understand what the trigger has to do with the first database from its insertion after rank method, and not before.

It should insert the record into the database, and then fire the trigger, throw an exception and do not save the record in 2nd database. But instead of recording its been recorded anywhere...

The case is: user fields some text boxes to a new customer, I check if the id already exists in database 2 and I notify the user that this account already exists in

personal database record (2nd database, 1 common database for all stores), and I ask the user if he or she wants to synchronize or use the current fields. If sync, I'll take the case

the 2nd base and insert them into the 1. Otherwise, I insert in the 1st database, and that's where the trigger should handle the exception of the duplicate line, not my request.

Is there a way that I can temporarily disable my adf application database trigger or I can handle the exception, BUT the record be save on the 1st database? because if the sound exception was

lifted, the new records his party.

Thanks in advance for any help.

True, since I can't manage the release procedure, I add an exception inside. So he will do something when the exception occurs, BUT it will save the customer

in the 1st database. Here is my code to trigger:

create or replace TRIGGER SAVE_BIOGR

AFTER INSERTION

ABOUT ELAB. BIOGR

FOR EACH LINE

DECLARE

v_username varchar2 (10);

BEGIN

SELECT user INTO v_username

DOUBLE;

INSERT INTO PERSONAL_RECORD. BIOGR

(ID,

NAME,

SNAME,

USER NAME)

VALUES

(: NEW.ID_PATIENTS,)

: NEW.NAME,.

: NEW. SNAME,

v_username);

EXCEPTION

WHEN DUP_VAL_ON_INDEX THEN

UPDATE PERSONAL_RECORD. BIOGR SET ERROR = "ALREADY EXISTS."

END;

I add the update on the exception because it is empty or with comment in the article SO it gave me an error I do not know why. So I just

provide a procedure of dump was updated.

Tags: Java

Similar Questions

  • How to configure Enterprise Manager Database Control (MCCD) to make it work on 2 servers (primary and standby) work according to the rules of the DG

    Hello everyone I use Oracle Database EE 11.2.0.4 with DG.

    In these cases, I need to get Enterprise Manager Database Control running against DB with no CARS and no DG I do the following:

    I have SQLPLUS logon as user SYS or SYSTEM and drop the account sysman and business objects:

    DECLARE

    CURSOR c1 IS

    SELECT master, synonym_name name

    OF dba_synonyms

    WHERE table_owner = "SYSMAN";

    BEGIN

    TO r1 c1 LOOP

    IF r1.owner = "PUBLIC" THEN

    RUN IMMEDIATELY "DROP PUBLIC SYNONYM ' |" R1. Name;

    ON THE OTHER

    RUN IMMEDIATELY "DROP SYNONYM ' |" R1. Owner: '. ' || R1. Name;

    END IF;

    END LOOP;

    END;

    /

    Mgmt_view DROP USER CASCADE;

    /

    DROP ROLE mgmt_user;

    /

    Sysman DROP USER CASCADE;

    /

    After that, I run

    EMCA - config dbcontrol db-rest recreate

    But what do I do in case I have 2 servers (primary and standby) work according to the rules of the DG?

    Hello

    It is not possible to monitor and administer a basic physical or logical standby, IE using Enterprise Manager Database Control Data Guard.  This is mainly due to the fact that Database Control is designed to monitor the 1-database and an environment Data Guard, by definition, includes more than 1 database.

    If you attempt to run emca against a database of pending, you will get an error like (i.e. ORA-01219: database is not open).

    Of course, database Control, can be used to monitor the current main database (with no capacity to administer or control Data Guard related features).  In such a case, failover Database Control needs to be reconfigured to run on the new primary database using the commands described in detail in Note 278100.1 how to remove, create and recreate DB Control In A Database, section c. recreate/ReConfig DB control, Option 2 10 g. recreate the control DB Configuration files and repository.

    Enterprise Manager Grid Control or Cloud control provides the functionality for display, monitor, and administer the primary and standby databases in a Data Guard configuration.

    Reference: It is Possible to configure the database for a logical or physical Standby Database command? (Doc ID 315116.1)

    You can effectively use EM 12 c cloud control to monitor and manager ensures DB

    Ref to the link for more details below

    Set up and manage to Oracle Data Guard with Oracle Enterprise Manager Cloud control 12 c

    Kind regards

    Rahul

  • How to manage data in css bar chart plugin

    Apex 4.2 running against database 11 g.  I have a CSS bar graph plug in the regions. Now, if there is no data found in a given region the region of bar chart is empty.  I want to display a message in the box indicating no data found rather than having just a blank area but I don't see how.  When I look at the plug of standard attributes the 'No data found Message attribute a' is disabled so I'm not able to check it out.

    The data source for the bar chart is a collection that is populated by calling a stored procedure that returns a sql query string.

    Any suggestions for how to manage this?

    nunyadba wrote:

    Apex 4.2 running against database 11 g.  I have a CSS bar graph plug in the regions. Now, if there is no data found in a given region the region of bar chart is empty.  I want to display a message in the box indicating no data found rather than having just a blank area but I don't see how.  When I look at the plug of standard attributes the 'No data found Message attribute a' is disabled so I'm not able to check it out.

    The data source for the bar chart is a collection that is populated by calling a stored procedure that returns a sql query string.

    Any suggestions for how to manage this?

    One way is to create shadow graphic HTML containing the "no data found" messages for each of the regions. Use Exists (SQL query returns at least one row) conditions to display the chart area when relevant data exist in the collection, and NOT Exists (SQL query returns no line) conditions to show the "no data found" region when it isn't.

    Another would be a dynamic action that verifies the existence of the graphical mark in each region and injects "no data found" messages where it does not exist.

    Change the plug-in (if allowed by the license) would be the last option.

  • How to manage old data?

    It is a very generic question. We use the oracle database. We hold the records of the company in the database. The company records should be available at any time, but over the years that the database continues to grow. Now, how to manage old data. All data are important, but if this is true for several years yet we more and more disk space to manage. Are there effective methodologies to manage old data? For us the old means data that are 10 years old.

    Murray9654 wrote:

    My main concern is the number of disks required. The database continues to grow for years. So how long can we continue to increase the record. It is not about the cost. I'm not sure of what will be the amount of data after 30 years.

    If the cost is not a concern, number of disks shouldn't be a concern.  In the end, you need what it takes to take what you have.  There's no silver bullet to get 50 gallons of sewage in a 10 gallon tank.  How big is your database now?  What is your current disk arragnement - local disks, SAN, NAS...

    Your statement "should be available at any time" seems to eliminate the storage of archives, out-of-database as a band.

  • How to manage what programs open when I turn on my Mac

    How to manage what programs open when I turn on my Mac

    System Preferences > users and groups > Login. Unlock the padlock (bottom left), select the item you want to remove, and then click the sign less.

  • How to manage search engines in Firefox Beta for Android

    When I type a search in the search bar, I get a list of search engines to use options:

    Google
    Amazon
    Twitter
    Wikipedia

    I would use google.co.uk not google.com (and probably amazon.co.uk and not amazon.com) but may not know how to manage search engines.

    Could someone let me know if this is possible

    see you soon,

    Malcolm.

    You can add new http://mycroft.mozdev.org/ research search engines

    To the best of my knowledge, it is not possible to remove search engines.

  • When you configure synchronization how sync manages information on two computers? It merges the information?

    When you configure synchronization how sync manages information on two computers? It merges the information?

    Hello!

    Yes, how Sync is that it brings together all the bookmarks and pushes them to all your devices. Same thing with the story.

    You will lose all the information in one of your computers.

  • How to manage or disable my 'guest user '.

    How to manage or disable my "Guest User" if I can't click on it and it's all gray? Help, please. I tried to manage or disable my 'guest user' for months now ~ Emma Saige

    Try screen http://osxdaily.com/2011/10/13/disable-guest-user-account-mac-os-x-10-7-2-login-/

  • How to manage Windows Vista power management features

    Hi guys

    I searched a bit in the technical knowledge of the Toshiba and found a very interesting article on Windows Vista power management features.

    * [How to manage Windows Vista power management features | http://aps2.toshiba-tro.de/kb0/HTD84026Q0000R01.htm] *.

    The fact is that you will not find one tool of Toshiba Power Saver on Vista as on Windows XP laptops and the parameters energy saver is a bit hidden in Vista power saving settings.

    But you can also control some options as a method of cooling or power saving Mode.

    I think that it could be interesting for some people here in the forum!

    Greetings to all!

    Thanks JayJay.

  • How to manage multiple hardware or auto select a sequence according to a condition?

    How can manage us mutiple devices to TestStand?

    I have 2 types of DMM, because some are no longer available (AG34410 which must be replaced for a 34465 has when he goes to the calibration or breaks down).

    Each DMM is structured in its own *.seq file, which includes all hardware calls.

    Example: Normally the TS developer adds a call sequence and links to 34465.seq and selects the module sub 34465 read several voltage.

    What I'm trying to do is an automatic selection for the correct DMM according to the DMM in StationGlobals:

    34410.SEQ and if he chooses the module sub 34410 read several voltage

    34465.SEQ and if he chooses the module sub 34465 read several voltage.

    All the submodules of the same 'measure' have the same settings, so the call that never would not cause any problems.

    Is this possible without having to implement a ton of if/else conditions for each type of measument or function in a DMM.seq shell?

    We are still at the beginning of a new project, I can change around a few ways to call my sequences or rename all the subsequences under the same name. LabVIEW TestStand API call might be a viable option (although I have not worked with API TS in BT yet).

    Thank you.

    So I threw this example that shows how to dynamically select what sequence of execution.  As long as they have the same prototype you should be good.

    Kind regards

  • I would like to know how to manage the ASN.1 encoding/decoding in LabView?

    I would like to know how to manage the ASN.1 encoding/decoding in LabView?

    Hello J,

    in the example given here , it looks like a format simple bytestream...

    You must read the byte stream, get the first and the second byte to decode the data type and length and then read & catalogued according to number of bytes. And then read 2 bytes and so on...

    Encoding will work the same but in reverse

  • How to add contacts to your existing groups or how to manage your groups?

    Anyone know how to add contacts to your existing groups or how you manage your existing groups. How do you even add new groups I can't find a way to do this in the ocntacts.

    Hello

    1. what version of Windows is installed on the computer?

    2 are. what groups you referring?

    3. What mail client do you use?

    If you use Hotmail, you can post your request in the Windows Live Forum.

     

    http://answers.Microsoft.com/en-us/windowslive/Forum/Hotmail

    You can check the link:

    http://Windows.Microsoft.com/en-us/Windows-Live/Mail-import-backup-restore

     

    Please get back to us with the above information so that we can help you accordingly.

  • restore display setting - how can manage view like forms option or brightness?

    How can manage the option to display as forms or brightness?

    Hi Hekmat,

     
    1. what exactly mean you by forms?
    2. What is the operating system installed on your computer?
     
     
    I suggest you to visit the links below and check if it helps.
     
     
     
     
     
     

     
  • How to manage the tv after hdmi to hdmi connection

    I want to connect to my computer windows 7 with tv on my Vizio tv hd tuner. I intend to use the hdmi to hdmi connections. After that I made the connection how to manage the tv without going back to the computer. My TV is in another adjacent room to my computer, sbout 20 ft away. Can I use a wireless mouse to manage the tv? The monitor and tv both appear at the same time? What are other options? Thank you for taking my question and to meet others, I put in the forum. Donnie

    I guess that the xbox 360 is a must for my setup. Thanks for your reply, Donnie

  • IEEE1394 IMAQ, how to manage a buffer in he'S 'ring '.

    When you change the code for IMAQ HE Ring example, there doesn't seem to be a version of IEEE 1394 of the IMAQ "configure the VI buffer." The existing VI does not connect with "Configure VI acquisition IMAQ1394". Can you please advise on how to manage the buffers to allow the acquisition of images at high speed with camera IEEE1394 (Basler A602fc). Alternatively, you could point me to an example that illustrates the acquisition of images HE RING with IMAQ1394 VI. We have already purchased the NOR-IMAQ for IEEE 1394 1.5.2 cameras.

    See you soon
    Greg

    With NEITHER-IMAQ for IEEE 1394 2.0 cameras, the concept of buffer ring is supported. During the configuration, you specify the number of buffers that you want to run a loop on. By default, the acquisition of high-level allocates a ring of 3 buffers for a life-long. Using the low level get Image VI, you can ask any number of buffer during the acquisition. The driver follows a basic 0 buffer number (0, 1, 2,...) for the transferred images.

    Assuming we have a ring buffer n and is the last issue of transferred buffer I and queries the user buffer number x, we can have one of the following scenarios:

    (1) buffer should always be acquired (x > I)
    The driver will wait and buffer number return x

    (2) buffer is available (I > = x > i - n)
    The driver returns x number of buffer

    (3) buffer is overwritten (x<= i="" -="">
    The driver returns one of the following values based on the requested crushes policy:
    (a) most recent buffer - the driver will return the number of buffers I
    (b) more former buffer - the driver will return the number of buffers i - (n - 1)
    (c) fail - the driver returns an error

    This is supported on Windows and LabVIEW RT.

    Hope this information helps.

    JohannS

Maybe you are looking for