trigger after import table

Hi all
 CREATE TABLE  "T_EGREE" 
   (     "LIDER" NUMBER(5,0), 
        "TYPE NUMBER(1,0)
 CONSTRAINT "T_EGREE_PK" PRIMARY KEY ("LIDER", "TYPE") ENABLE)
CREATE OR REPLACE TRIGGER  "AI_T_EGREE" 
after insert or update on T_EGREE
for each row
begin
if inserting then
insert into t_sum  (lider,type,AMOUNT)
values (:NEW.lider,:NEW.type,0);
end if;
if updating then
insert into t_sum (lider,TYPE,AMOUNT)
values (:NEW.lider,:NEW.type,0);
end if;
exception
when others then
RAISE_APPLICATION_ERROR (-20505,'insert/update on t_egree failed ,
due to unique constraint on table t_sum');
END;

suppose that t_egree contains 34 rows .
-------------------------------------------------------------
CREATE TABLE  "T_SUM" 
   (     "LIDER" NUMBER(5,0), 
     "TYPE" NUMBER(1,0),
        "AMOUNT"  NUMBER(3), 
     CONSTRAINT "T_SUM_PK" PRIMARY KEY ("LIDER", "TYPE") ENABLE)
I have a scenario that t_sum of the table will be empty and t_egree table will be created by importing the file.
in this case, after you import the table of t_egree, the t_sum table will be blank.
is there a solution to overcome this problem?
Thanks in advance
Naama

Don't do the following:

when others then
RAISE_APPLICATION_ERROR (-20505,'insert/update on t_egree failed ,
due to unique constraint on table t_sum');

You are hiding the real error, which are not necessarily always an ORA-00001...
Get rid of these three lines in your code.

Tags: Database

Similar Questions

  • I get an error message after importing a table through Dreamweaver in a page developed by Muse.

    I get a few messages after importing a table through Dreamweaver in a page developed by Muse. I compared the code of the page with the table on page until I inserted table and cannot find anything missing. the web address is http://gourmetdreams.com/weekly-menu.html

    How can I erase this upward?

    I also noticed that when I downloaded the file there was a mistake: "- error - access denied."  The file exists may not be not on-site, can be opened in another program, or there might be a problem of local authorization. »

    Screen Shot 2014-10-30 at 1.53.15 PM.pngScreen Shot 2014-10-31 at 4.39.09 PM.png

    I'm working on a project were I am importing to Dreamweaver html code. I just do all of my changes in Dreamweaver and then re-import the file.

    You can make changes in the file inside Muse. Just right click on your imported html file and select "edit HTML" in the menu list.

    It will bring to the top of the dialog box where you can change the text/code

  • trigger after insert in tables MASTER DETAILS, adding bonuses to employees

    Hi Experts, I am a beginner in PL/SQL and triggers
    =========================
    I have two tables:
    MASTER (DOC_NO, DOC_DATE, BONUS)
    DETAILS (EMP_NO, EMP_NAME, EMP_BONUS)

    I need to distribute the (BONUS) column in table (MASTER) to column (EMP_BONUS) in DETAILS

    by equal parts.

    I need it in (trigger after insert)


    EMP_BONUS: is BONUS count (EMP_NO);.

    example:
    BONUS = 100
    No EMP_NO = 20

    This means (EMP_BONUS = 100/20 = 5).


    I use the 6.0 with 9i DB form
    Help, please

    RARA says:
    Hi Experts, I am a beginner in PL/SQL and triggers
    =========================
    I have two tables:
    MASTER (DOC_NO, DOC_DATE, BONUS)
    DETAILS (EMP_NO, EMP_NAME, EMP_BONUS)

    I need to distribute the (BONUS) column in table (MASTER) to column (EMP_BONUS) in DETAILS

    by equal parts.

    I need it in (trigger after insert)

    EMP_BONUS: is BONUS count (EMP_NO);.

    example:
    BONUS = 100
    No EMP_NO = 20

    This means (EMP_BONUS = 100/20 = 5).

    I use the 6.0 with 9i DB form
    Help, please

    If you want to do after insertion and forms... You can use the trigger to insert after and try something like this

    declare
     a number;
    begin
    select count(emp_no) into a
    from master;
    update details
    set emp_bonus=:bonus/a;
    commit;
    end;
    

    Hope this helps

    If someone useful or appropriate, please mark accordingly.

  • RAW of Nikon D810 images appear darker after importation develop mode - why?

    Hello

    I have a problem with the LR. I shoot in raw, and after copying the files on my pc, I choose several pictures and import them into LR. After this step, I want to continue with the mode of development. Subsequently the following problem: the image in the develop mode has changed - it's much darker and the colors aren't the samet. Even if I change the example flat camera mode I get the same resuslt as the original raw file. I do not understand the problem - maybe you can help me?

    Thanks in advance

    Jurek

    Camera: Nikon D 810

    LR version 5.7

    The color space, running on the development module and the library module is completely indifferent to what looks like your image. It is not serious, and the difference is extremely subtle and really visible only on the screens of the range very high-end. In addition, color space in develop is not prophotoRGB, it is once again a linear gamma with primary prophotoRGB but space called MelissaRGB which is quite different, not important for this.

    He must know one thing more to diagnose your problem: when you return to the library, the images are dark or do they go back to the Lite version? If so, you are dealing with several possibilities. The first is as already mentioned a monitor profile. You should re - calibrate your monitor with hardware calibration. If you don't have that, test that possibility by assigning the sRGB profile to your monitor in the monitor properties pane. If this fixes it, you must get a puck of calibration to calibrate your monitor, the problem is caused by a bad monitor profile that has been installed by an update of the system. These are very common on the windows platform and even if other applications behave normally, that is the question.

    Second option is that your graphics card is not dealing with well GPU acceleration and omitting the color management. Test by going in the Lightroom preferences, selecting the tab performance and power of the graphics card acceleration off. Restart Lightroom and check. (update: I see that you are on LR 5.7: this option does not exist here so ignore this notice)

    If none of these fix the problem, and after that you spent to develop, the image is too dark in the library, that several other issues could occur. First is that you may have set a default value for the camera. Make sure the settings are zero on your images after importation. They could be zero if you apply a preset to the importation, or when you set a default development setting. Reset it by going to preferences-> presets, and then click 'reset all settings default development. " You see the change of the image when you go in develop because the library, firstly the jpeg preview the generated camera is shown and only when you are going to develop is the actual raw image get rendered by Lightroom.

    Another issue that could happen is that you use dynamic lighting on your camera modes. Nikon calls these active D-lighting. You must completely disable those. What the camera does when you have those active is to underexpose the image by a stop or two and then highlights the tag of the raw image with an indicator that shows the Nikon software to increase exposure compensation and make an HDR processing on the image to trigger shadows and bring down. Lightroom can not read these tags and just makes the image from raw data (which are underexposed!). In the library first see you the jpeg in-camera image and that the image was made by the camera using the HDR technique. You are better expose properly and leaving these modes if you want raw data of highest quality.

  • Trigger after insert

    After an insertion in table 1, I want to take the value of the transaction and use it in a custom to insert trigger in an another datbase 2 values. One is the primary key of the table 1 transaction value and the other is a variable of the connected user's session. I can get the value of the user of the session, but I can't get the value of the transaction field.

    $updateRequestDate = "INSERT INTO request_notify (id_request, username) Values ({rsrequest.id_request}," ".). $_SESSION ["kt_login_user"]. "')";
    $update_result = $tNG-> connection-> execute ($updateRequestDate);
    {if(!$update_result)}
    $updateError = new tNG_error ("' error affecting the logged in State to N ', array(), Array();")
    Return $updateError;
    } else {}
    return null;
    }

    I have the custom trigger after insert transaction.

    How do you get the value of a transaction for a custom trigger field?

    Please try with the help of the

    $tNG-> getColumnValue ("column_name")

    method instead.

    See you soon,.

    Günter

  • You can use a trigger to disable another trigger after 30 events

    Dear All;

    Is this possible... you can implement a new trigger to disable another trigger after 30events. If so, how

    Hello

    user13328581 wrote:
    Dear All;

    Is this possible... you can implement a new trigger to disable another trigger after 30events. If so, how

    It depends on what you mean by "disable".

    Trigger may start by querying a table that saves the State of relaxation. This could possibly be a table with one column and one row (at most), or it could be a larger table.
    If the trigger is a line with a certain value, it can end immediately. In other words, might be the trigger

    ...
    BEGIN
        SELECT  COUNT (*)
        INTO    disable_cnt
        FROM    trigger_state
        WHERE   txt     = 'TRIGGER A DISABLED';
    
        IF  disable_cnt = 0
        THEN
            ...     -- The real work of the trigger goes here
        END IF;
    END     trigger_a;
    

    Trigger B could count to 30 and then to insert a row in the trigger_state table.

    Trigger is "disabled" in the sense that it does not really something. The trigger still exists and it is still valid and it is always drawn, and it works again (at least SELECT it... IN the part above).

  • Create the trigger after insert

    Hello

    I would like to ask how to create a trigger after insert on a table. Basically, what I wanted to do are when an insert to table1 it will insert the records to table2. But the problem is that folders that will be inserted in the new tables are entries/fields, who lived in NEW York City (on table of ld)

    after insertion, I wanted to add another field in table2 as status


    create table table1)

    Name varchar2 (55),
    City varchar2 (55)

    );

    create (table2)

    Name varchar2 (55)
    status int (1)
    )

    Hope you could help me.

    Thank you

    Best regards

    antok1015 wrote:
    Hello

    I would like to ask how to create a trigger after insert on a table. Basically, what I wanted to do are when an insert to table1 it will insert the records to table2.

    It's easy...

    SQL> create table table1(
      2    Name varchar2(55),
      3    City varchar2(55)
      4  );
    
    Table created.
    
    SQL>
    SQL> create table table2 (
      2    Name varchar2(55),
      3    status number(1)
      4  );
    
    Table created.
    
    SQL>
    SQL> create or replace trigger trg_tbl1 after insert on table1
      2  for each row
      3  begin
      4    insert into table2 values (:new.name, 1);
      5  end;
      6  /
    
    Trigger created.
    
    SQL> insert into table1 values ('Fred','Bob');
    
    1 row created.
    
    SQL> select * from table2;
    
    NAME                                                        STATUS
    ------------------------------------------------------- ----------
    Fred                                                             1
    
    SQL>
    

    But the problem is that folders that will be inserted in the new tables are entries/fields, who lived in NEW York City (on table of ld)

    after insertion, I wanted to add another field in table2 as status

    This is not sensible. Please explain what you mean.

  • What will my optimizer after import 9iR2 to 10 gr 2 CBO or RBO?

    Friends,

    OS: RHEL AS 3

    What will my optimizer after import 9iR2 to 10gr 2?
    will it be RBO and CBO?
    What are the precautionary measures should I follow to the part of the optimizer?

    Thank you

    + 1. Can I change the = 9iR2 All_rows optimizer_mode now? +
    Yes. Another change in the session with alter session or change the setting to the same optimizer_mode.
    + 2. After changing the to in 9i all_rows optimizer_mode what should I do? Should I analyze all tables? +
    You must be already doing and not with analyze, command but with dbms_stats package.
    + 3. What's going to happen, if I import to 10g without changing the = all_rows optimizer_mode in 9iR2? is the default 10g optimizer_mode will apply to this import? +
    With import, you can import your image into a 10g database where the setting mode is all_rows only.
    HTH
    Aman...

  • iPhoto removes more after importation

    Obviously, Apple are trying to destroy iPhoto and you must use the abomination that is pictures (hideous interface and useless feature - seriously you're hiding a photo and it is still displayed in the photos - what's the point!).

    Anyway, iPhoto is still far superior, but after sierra * update * (is it really an upgrade, which makes it sound as if it was top!), in any case, after the passage at sierra when I plug my idevices in it transfers the pictures, but offers more delete them. So now I have to open iphoto, then unlock the idevice, then transfer the stuff in iphoto, then return to the idevice to remove photos ensuring that they transferred first, then quit iphoto.

    Apple, it's just works *, although probably no where near as simply as any other solution and that if you want to how Apple (trying to get rid of albums of places and/or people who popped in iOS 10!).

    (* Apple defines "works" means that the function may or may not work and may or must not cause a significant waste of time and/or loss of content.)

    Is it possible to transfer/delete functionality works correctly?

    So now I have to open iphoto, then unlock the idevice, then transfer the stuff in iphoto, then return to the idevice to remove photos ensuring that they transferred first, then quit iphoto.

    You can launch the Image Capture.app and import the photos in a folder in the Finder and then import this file into iPhoto.  If you use the transfer of images, you can always remove distributed after importation.

    But in fact, it is not recommended to remove the pictures from the camera before convince you yourself, that the imported photos have been transferred without transmission mistakes and make the first backup. I've seen quite a few posts here, where iPhoto crashed during importation or imported photos have been corrupt and if that happens, you will not be able to resume the transfer, if you let iPhoto delete photos immediately.

    The way you describe it is best practices, and how you should be important, even if the delete after import option was still available.

  • photos version 1.5 "delete after import" is no longer an option

    Can someone tell me where the option of deleting the photos after the importation of the iphone is spent in the latest version? I can take more than 100 photos per day for work and remove them manually from the phone after import is a major pain in the *.

    Thank you

    He did not go - when you connect the front phone import you can check the deletion after import box to the right of the phone in the picture source list

    However it is not a workflow recommended as an inappropriate phone accident or the Mac may lose pictures - it is much better import and make sure that the photos are safe and that at least a complete backup cycle and then use Image Capture to remove

    LN

  • What is happening in the original file of the photo when I import it in Photos and I have the "Delete after import" box checked?

    What is happening in the original file of the photo when I import it in Photos and I have the "Delete after import" box checked?

    When organizing photos for Photos for Mac app, I find that the Photos makes "copies" of files within the library of Photos and must reference a file if your settings are such that you do not copy the original files in the Photos app.

    Trying to manage the disk space for the Macbook Pro.

    The delete after import is available only when you import a device - a camera, card, an iPhone, but not when you import files from a folder on the system drive.

    You can delete the local image files of your system drive yourself, once you have imported the Photos and they were copied in the photo library.

    I would never use the option "delete after Import. The files will be deleted until you can check if the files have been imported correctly. If you find out later, that some of the imported files are corupted and illegible, it will be repeated o toolate import, because the files have been deleted from the device. Or worse, if pictures should plant a reason any during the import, all the pictures will be lost, if you have enabled "delete after import.

  • "Remove item after importation" of Photos is activate but failed to import! Both devices (iPhone and Macbook) have no pictures!

    I'm trying to import my photos iPhone Macbook pro, I activate the function "delete after import" photos.

    However, the process fails, and both devices have no pictures I selected.

    How could I come back all these pictures?

    This is exactly why it is not recommended to never delete after import: always wait at least a backup has not completed

    What happened exactly?

    Depending on what happened, you might be able to recover the photos by launching Photos while holding down command and iptin keys and repair the database - which does not then you will need recovery software as media recover http://freshcrop.com/photo-recovery/image-recovery-software-for-apple/

    LN

  • Automator lack of place in the trash after import option

    I will put in place action folder to import photos from a dropbox folder in the Photos app ideally I'd like to make these photos to be moved to the trash after importation, but the box which doesn't seem to be an option more. Is there a solution to this problem?  I am running El Capitan 10.11.5. Any help would be greatly appreciated. Thank you.

    https://macosxautomation.com/Automator/photos/import-action.html

  • El captain cannot remove photos from the iPhone after importation

    I opened the Photos App and imported my photos. It helps to have an option to remove photos from my phone once they have been imported. What happened to this option? Is there a way to remove photos from my iPhone after importation?

    ShamikasiPhone wrote:

    What happened to this option?

    iCloud

    Is there a way to remove photos from my iPhone after importation?

    Discover >delete photos from the iPhone after import - Photos

    then > deleting photos to iPhone but not iCloud

    and > OS X Photos App: remove already imported from iOS Device

  • photos of the iPhone will not erase after importing

    I have an iPhone 6 Plus. I don't sync them to iTunes library pictures, I just plug my phone from time to time and load all my photos in the Photos app and check the box to delete after import. He never removes my pictures, and now I'm starting to have problems of storage. There is no way I'm manual removal more 1 500 photos. Is there a way to automatically remove all just these? I did some research on it, but everything I see guess you sync iTunes I'm not. Thank you!

    have you tried the next change where it says albums?

Maybe you are looking for

  • Downloaded adobe shockwave and player and now web page bookmarks don't work

    working on the ning site and has been invited to download pluginsShockwave Flash Player: install_flashplayer11x32_mssd_aaa_aihdrive: install_reader11_uk_mssd_aaa_aihand now web page bookmarks don't work in IE, Firefox and chrome. What should do?

  • design of circuit problem

    Hello I created a R - 2R ladder network (joint it photo below) to convert digital-to-analog and I used an op amp to amplify the output of the R - 2R ladder somelevel network. The problem here is that I'm not able to generate ouput when I connect the

  • Problem-solving with Windows 8.1

    I just changed my HDD for one SSD and re-downloaded Windows 8.1 and I have problems with my resolution. It does give me only 2 options for resolution, 3200 x 1800 and 1024 x 768 (which it says is recommended). When I turn it to 3200 x 1800, everythin

  • Could not go to the text login screen in Windows 7

    Operating system is Windows 7. Fujitsu lifebook T 1010 arrives at Ctrl Alt Delete, but won't get a logon text box. Just keeps going back to Ctrl Alt Del. Is there any solution for this? Original title: Ctrl Alt Del

  • bddel.exe program not found - skipping autocheck

    This message appears whenever I start my computer just after the "Starting Windows" screen My OS is Windows 7 Home Premium 64-bit. Help, please.