Help with a basic trigger to capture OS_USER

Here are the trigger and it doesn't - help much appreciated
CREATE OR REPLACE TRIGGER trg_master_tab_aft
AFTER INSERT OR UPDATE OR DELETE
ON master_tab
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW
DECLARE
BEGIN
     IF INSERTING THEN
     INSERT INTO master_tab_hst values (:NEW.col1,
     :NEW.OSUSER := SELECT SYS_CONTEXT('USERENV', 'OS_USER')  FROM dual
     ,'I'
     ,SYSDATE);

     ELSIF UPDATING THEN
     INSERT INTO master_tab_hst (:NEW.col1,
     :NEW.OSUSER := SELECT SYS_CONTEXT('USERENV', 'OS_USER')  FROM dual
     ,'U'
     ,SYSDATE);

     ELSIF DELETING THEN
     INSERT INTO master_tab_hst (:OLD.col1,
     :NEW.OSUSER := SELECT SYS_CONTEXT('USERENV', 'OS_USER')  FROM dual
     ,'D'
     ,SYSDATE);

     END IF;

EXCEPTION
     WHEN OTHERS THEN
       -- Consider  the error and then re-raise
       RAISE;

END ;

Srini Ramaswamy wrote:
Jeenesh, now am getting a different error - apologies for having so sticky

I'm not coding for a living; :)

TRIGGER INVTST.TRG_MASTER_TAB_AFT
On line:  12
PL/SQL: ORA-00928: missing SELECT keyword
SQL> CREATE OR REPLACE TRIGGER trg_master_tab_aft
  2  before INSERT OR UPDATE OR DELETE
  3  ON master_tab
  4  REFERENCING NEW AS NEW OLD AS OLD
  5  FOR EACH ROW
  6  DECLARE
  7   lc_osuser varchar2(100);
  8  BEGIN
  9       lc_osuser := SYS_CONTEXT('USERENV', 'OS_USER');
 10       IF INSERTING THEN
 11       INSERT INTO master_tab_hst values (:NEW.col1,
 12       lc_osuser
 13       ,'I'
 14       ,SYSDATE);
 15       elsiF UPDATING THEN
 16       INSERT INTO master_tab_hst values (:NEW.col1,
 17       lc_osuser
 18       ,'U'
 19       ,SYSDATE);
 20       ELSIF DELETING THEN
 21       INSERT INTO master_tab_hst values(:old.col1,
 22       lc_osuser
 23       ,'D'
 24       ,SYSDATE);
 25       END IF;
 26  EXCEPTION
 27       WHEN OTHERS THEN
 28         -- Consider  the error and then re-raise
 29         RAISE;
 30  END ;
 31  /

Trigger created.

SQL> insert into master_tab values(1);

1 row created.

SQL> update master_tab set col1=2;

1 row updated.

SQL> delete from master_tab;

1 row deleted.

SQL> select * from master_tab_hst;

      COL1 COL2                           C DT
---------- ------------------------------ - ---------
         1 D-219015333                    I 05-APR-13
         2 D-219015333                    U 05-APR-13
         2 D-219015333                    D 05-APR-13

Tags: Database

Similar Questions

  • need help with something basic, rename pages, made in muse

    Hi all

    can someone help me with a basic task,

    I need to rename a page ivve Muse containing slide shows or forms,

    When I download via FTP on writing the page index.html of Web sites

    any suggestions on what I'm doing to rename Ive tried everything

    Thank you in anticipation

    Julie

    Hi Julie,.

    To rename a page in Muse name, please right-click on the page and access the properties of the page. "You can rename the name of the page of all pages, as well as the 'file name' of Muse, but you cannot change the ' file name ' Muse index page. Please refer to the following screenshot:

    If you choose to export the site in HTML format, you can then change it so but links of menu items will be broken and you must manually link all the elements menu outside the muse.

    I hope this helps.

    See you soon!

    Aish

  • Need help with a basic host script?

    All I recently started using Powershell scripts and as big a language it is that I'm still learning at the 'very' early stages. All I would do is create a script that reads some hosts from a text file, and then it receives some info on all the virtual machines associated with this host. I know that the get - vm command can do for ALL the virtual machines in VC but when I run my script it seems to get the information for the VC together and NOT on a per-host basis. (We have several hosts within the domain and require info VM only a couple). Ive checked some samples but nothing that allows me to get the info I need Heres my script so far (very basic, I know!)  $hostlist = (get-vmhost-name (get-content c:\hosts.txt) | select name) #Get VMs for each host foreach ($esx in $hostlist) {$VMs = get - vm foreach ($vm in $VMs) {Write-host $vm. Write-host $vm name. $vm.numcpu MemoryMB Write-host Write-host $vm. Guest}} I know its really basic so far, but all I'm trying to achieve is just get some info on some VMS and report to the console (I know that I can send the information to a spreadsheet myself so now worries it) thank you very much for you help in advance

    You can limit the virtual machines, you receive chaining cmdlets Get-VmHost and Get - Vm together like this

    $hostlist = (get-vmhost -Name (get-content c:\hosts.txt) | select Name)
    
    #Get VMs for each host
    foreach ($esx in $hostlist) {
      $VMs = Get-VMHost $esx | Get-VM
      foreach ($vm in $VMs) {
        Write-host $vm.Name
        Write-host $vm.MemoryMB
        Write-host $vm.numcpu
        Write-host $vm.Guest
      }
    }
    
  • PremierePro4 help with some Compression Options video Capture

    Last week, I started to convert my old tapes VHS using a Canopus ADVC 110 box, a Mac with os x 10.4.11 and PremierePro 4.0.0.

    Everything went well until last night when I lost my choice of compression in first - Capture - Video - Compression settings.

    Previously, I had plenty of compression type and used DVCPro or DVCPro50. Also, there are many others available.

    Now, I only see DVCPro50 when my Canopus is attached to the source. If I remove the canopy my iSight becomes the source and the only type of compression is y ' Y'CbCr 4:2:2 - uyvy.

    So far, I rebooted and everything replugged, checked the permissions and unloaded and reloaded first. None of this works.

    I suspect there is something running interference somewhere that I have to delete or reset.

    Assistance is greatly welcomed. Thank you

    You know, had not thought of that, because of the Mac. However, that would affect all things MPEG and should not affect the DVPRO50, or at least, I don't think he would. Still, worth the detour.

    To the OP, can import you a single MP3 or MPEG AV in PrPro? When you look at Help, see Activation of transfer (or similar syntax), or is it gray?

    Good luck

    Hunt

  • Need help with the basic steps to create ebook

    I have a confession: I use constantly solutions instead of stop and learn the right way to use Indesign to create ebooks. I wouldn't say that I'm doing it because I'm lazy, but because I'm simply inept lol. Here are some of the basic steps I take:

    1. create the document: include the block of text type (because I want the page numbers to display)

    2 paste the unformatted document text

    3. adjust the size of the main frame to produce the text of the appropriate margins (because its an ebook, left/right margin even opposing pages.)

    4. highlight all of the text, set the spacing before and after the paragraph halfway through the character before (the bottom text is at the same point for each page)

    5. go in the titles of chapters; do jumps from title page has its own page; Highlight the title, choose the font, the size; create the new character style; apply the style to other chapter titles (it is possible to create a ctrl + number shortcut to apply character styles?). Note that I did not create a character for the body text style. I'm just doing the first?

    6 Insert markers page number on both master pages, then cover page number with a white box on the first page of the chapters.

    7. remove photos in textbox so that if more text is added, the photos move with the text.

    That's basically what I do when I create an ebook. Any suggestions as to best/way to do these things would be very appreciated.

    1. the master text blocks have nothing to do with page numbers and in most cases are completely unnecessary. Set the margins of appropriately and place your text.

    2. without knowing what you leave on it is impossible to tell if it's a good idea or not. My stomach says is not. See number 1.

    3 see number 1.

    4. it's what paragraph styles are for.

    5. see number 4.

    6. This is what the multiple master pages are for. Stop doing that.

    7. well, you finally have a right. As my people... would say mazel tov.

    Now, it's time to stop being inept (your Word, not mine) and start learning the right way to do it. First thing we do, is buy Visual Sandee Cohen of Quick Start Guide. It's the best InDesign book market for beginners. http://AMZN.to/plsvxy

    Second, check out the video training on Lynda.com. This link will get you a free one week trial: http://bit.ly/fcGpiI

    Bob

  • The GPS metadata - please help with some basic questions

    I have a GPS (from GiSTEQ) encoder which I use to collect location data. I use GeoSetter to encode the image files. I have a set of jpg of my camera that I've already imported into LR 3 (under Win7 64-bit). After importing, I loaded GPS data using GeoSetter and collected the device GPS data. I know, I should have updated the jpg files before import.

    * Now that the jpg files are there, I can't figure out how to make visible the GPS metadata. I tried to update the metadata of the file and looked at various metadata views of the Panel in the library, including "EXIF and IPTC" module (my default), 'Place', "Default" and "All plug-in metadata", but nothing seems to resemble GPS fields. What I am doing wrong?

    * How can I easily I updated all jpg files of this collection to include their GPS data and not lose the metadata, develop settings, etc I already applied for in LR?

    * I usually shoot RAW - what I would do differently if I had coded the location of RAW files is coded import before or after?

    Thank you!

    Dilip

    I run Geosetter and LR but only with RAW files, but I'm guessing that the same steps are necessary for JPEG files.

    1 open Geosetter and open the folder containing the images

    2. synchronize images with the GPS log file - check Geosetter finds a match for the images.

    3. get location data

    4. save results - Geosetter should prompt you if you leave without it.

    5. in LR select images and metadata for files read - this will import data from co - ADR and the location of the GPS from the image or sidecar file.

    If an image is a not all GPS areas data do not show in LR so it seems that your images do not have the data.  You can check by opening Geosetter and looking at a picture in the list of files - it will show GPS data

    I hope this helps.

    Colin

  • Please help with a basic javascript syntax

    Can anyone help me please with an installation of 'remove from Favorites', I'm working.

    I have query to get all the favourites, and then I pulled out the Favorites to the bottom of the page

    Each favorite has a link 'remove from Favorites' - I want to make sure that when a user clicks on this link, they get a javascript confirm box pop up saying "are you sure you want to delete #favourites name # of your Favorites?

    So I have...

    function remove(profile,name) {}
    If (confirm ("are you sure you want to delete #name # your Favorites?")) {
    Window.Location = "remove_from_favourites.cfm? deleteFavID = #profile # & removedName = #name #
    }
    }

    and

    < div onClick = "remove(#rs_favs.favouriteeID#,#rs_favs.firstName#)" > remove from Favorites < / div > "

    but it does not work - I think that there are 2 problems...

    problem 1 - I used CF # in the suppression works as I don't know what we're doing in javascript for "output" a variable (see where it says "Are you sure you want to remove #name # favorite") what should I use instead of ' # '?

    problem 2 - I tried to pass to the function variables > > onClick = "remove(#rs_favs.favouriteeID#,#rs_favs.firstName#)" and I separated the but a commercial "," but I suspect that it is an incorrect syntax "


    If someone could please help me I would be very grateful to be honest, I like coldfusion - but javascript hurt just my head! :(

    Thank you very much.

    PS how I wrapped my text 'remove from Favorites' in a div rather that to make a link real 'a href' - is that correct or is there a better way (ideally I want the text to look like all my other links (ie they emphasize on mouse over))

    It's because you pass a value of string without single quotes in your onclick() function.

    To take

    Remove Favorites

  • Need help with the basic graphics

    Hi all

    I started trying to familiarize themselves with the development on the Blackberry. It seems

    easy just use the standard of review, but becomes frustrating when I try to

    paint the screen exclusively from the Graphics object.

    My test program extends from the screen. The screen has a background

    and the moving objects, but flickers (at least in the Blackberry JDE 4.7).

    The flicker is reduced more when I work with the Graphics object

    directly. If I write an object buffer Bitmap, drawBitmap back to the

    main screens, flickering Graphics object is ridiculous.

    I've seen other discussions where people told of using MIDlets or extend from BlackBerryCanvas or GameCanvas.

    Try one of those who seems to make everything harder than it should be.

    Is there a single best way to do a screen play?

    Pointers, links, tips, samples,... would be greatly appreciated.

    Thank you!

    Hi, I had the same problem with twinkle. What you need to do is to synchronize threads. and the problem disappeared!

    Kind regards

  • Help with the basic model of the Ireland

    Hello
    I'm new to the forum. Just trying to save my index page as a model for the rest of my site. Get this message ' there is an error at line 76, column 7 (absolute position 2186) Website:www_root:index.html "nested Nested editable regions.»
    Can someone please advise what I should do, or is there another way around this problem? Thanks for any help you can give me

    Hi Murray,

    I know, my English is not the best, BUT wasn't the issue "while trying to save my index as model page"? You know, caring is not my type, but what I misunderstood?

    However, I can still guess your general recommendations on models apply again, just?

    Hans G.

  • Need help with Flash - really basic!

    Hi, I really need help with Flash and quick. I have to create an auto-run cd, but before I can create that, I have to make everything works! I took a class in College Flash, which up to 1 1/2 ago so im kind of knowledge missing!

    My first problem is as follows:
    I have the homepage, and it contains a button English and french.
    When you click on buttons, it brings you to the next page, either resourcesFr or resourcesEn.
    I tried to use the loadMovie script but and it works but the new page loads on the home page you can still see the English/french under buttons. How can I fix? I know its simple but I am short on time... Should I still use the loadMovie script?

    My other problem is that im trying to have another button to link to a folder. Use the script for getURL for this as well?

    Help!

    I was able to solve my problem... it was only the forward slash that were in the wrong way... so the correct code is:

    on (release) {}
    DRV = _url.substr (8.1);
    getURL (drv + ": / English/brochures");
    }

    Only took me 5 days... I think I need to buy a script book action! Laughing out loud

  • Help with multiple locations on a XY graph under certain conditions

    Hi, I have a question about manipulating a XY Chart.

    (1) whenever the plot crosses the x-axis for value go to the top, I want the plot to change color, so that it crosses 0 will go back to the top, and I want that specific portion having a different color. It's really hard to explain, so I'll post a picture:

    [URL =http://img691.imageshack.us/i/xygraphexample.jpg/] [IMG] http://img691.imageshack.us/img691/4540/xygraphexample.jpg [LINE] [URL]

    As you can see, if the graph we cross the x-axis by decreasing, it should not change color. Only increase.

    I can't understand how to do this. I know it will take more than one location, but how would I randomly change the color as well as detect if its path that goes to the top or not.

    Any help would be appreciated.

    Thank you

    OK - chance I'm not too busy today...

    Usually, I use either screw express, but was looking for a quick solution for you.

    Here's the sample made with only the basic trigger function - no express VI.

    Also added a selectable threshold by the user.

    Then, on the space between the plots, if there is no data in the original, there no data in the colors either.

    See second attachment

  • Help with my animation film...

    Hello

    I know this can be annoying, or whatever, but I'm stuck with this project, which must be done in Flash and I can't just deal.

    I can only do the basics really motion, tween, etc..

    http://24.media.tumblr.com/tumblr_mbye4wq1qU1qe31lco1_r1_1280.jpg

    I wish that the heart of the animation that gun shot of the pencils.

    So I need help with two things that I think; How to make the gun appear as if he is shooting itself? I would like to make the trigger slightly and the top bit move backwards and then turned to create the shot.

    Then I would like to follow the 'miracle' as his driving, so I was thinking of this sort of background blur/running to make it appear as if she steals the pencil?

    How possible are these things to do?

    Can you please help me:

    Thank you.

    Each pencil must be a separate movieclip.  You then animate just like any other object using the interpolation of the timeline or actionscript of flash.

  • NB100 - need help with Toshiba Eco Utility to advanced user

    I want to ask the advanced user (knowing regedit, windows services and processes) and Eco Utility installed to help me with Toshiba Eco Utility.

    (1) I need the registry branch where Eco Utility to store preferences.
    (2) screenshot for TecoService services. With params.
    (3) screen capture of process. Looking for TPCMpwr.exe it

    Why I need?
    I have Toshiba NB100 netbook where Toshiba has not released Eco Utility.
    NB200 there, but not for NB100.
    I don't know why... It will work, only I need the registry and services information.

    P.S. If Toshiba engineers will read this post.
    Why Toshiba release Eco Utility for NB100?

    Hi Lrrrr,

    Just a simple question: what installation Eco Utility on your NB100?

    But normally you don't need this utility of Eco. As much I know this tool only changes power settings Windows you can do it yourself too. It s a nice tool where you can reduce the energy consumption in a single click, but you can do it yourself if you create the own power profile or change.

  • help with NI 9751

    I am generating the signal using the module 9751 OR but couldnot understand. Could someone help me with some basic examples?

    No September panle front controller? When you opened the corresponding example? I think that the module can control the output voltage and the duty cycle of the pulse. You can find the DAQ (related to your NI9751) controller on the panle program.

  • "Several times I am receving the dialog box with" visual basic command-line compiler.

    "Several times I am receving the dialog box with" visual basic command-line compiler.

    Hello

    1. This occurs when you use a specific application or all applications?

    2 did you a recent software or changes to the material on the computer?

    3. have you installed all versions of Visual studio?

    4. What is the finished message, that you have found?

    You can try to perform a clean boot and see if it helps.

    A clean boot to check if startup item or services to third-party application is causing this issue.

    You can read the following article to put the computer in a clean boot:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7

    After the troubleshooting steps, please refer to clean the boot link to put the computer to normal startup mode.

    Hope this information is useful.

Maybe you are looking for

  • PDF files more open by Waterfox. They launch Adobe Reader instead.

    I use the current version of Waterfox (v13) on my system Win7/64. As soon as I converted from previous version of Firefox, stopped PDFs open in a browser window, instead raising Acrobat as standalone application. I have never known this before and I

  • 412592 bug in Labview FPGA

    Can someone provide details on this known bug Labview? I can't find someone else who has experienced, and I would like to know what is the solution. http://www.NI.com/PDF/manuals/374737a.html 412592 Cannot run VI FPGA in interactive mode (run button

  • KB257203, KB2633880, AND KB2518864

    KB2572073, KB2633880 AND KB218864 all the problems with automatic updates installation. The guarded icon reappear after clicking on install and watch the progress bar so-called complete. I rebooted several times without success. Then I went to instal

  • my dvd/cd drive is missing... help!

    I have a hp Pavilion 6500 laptop w / a cd/dvd lightscribe drive. The problem is that the computer no longer recognizes. I tried every patch and driver, download softerware I can think and nothing works. He always ends the same, "no disk drive not det

  • 4-1101ea storage driver feel like?

    I'm desperate to get the abomination that is Windows 8 out of my want and install it on my copy of Windows 7, but could not find the necessary driver to copy on a USB pen to the storage/RAID driver? I downloaded the Intel Rapid Storage driver from th