How to do a check without having to type all the names of columns?

Hi all

I want to create a trigger on other tables (suppose that it contains 50 columns) to record operations data DML thereof on another table (table_name, FIELD_NAME, OLD_VALUE new_value)

If I want to, I can write in the trigger (before insert, update, delete):

If the update can

insert into audit_tab (FIELD_NAME, OLD_VALUE, TABLE_NAME, new_value) values ('TRACKED_TABLE', 'COL1': OLD.) COL1,: NEW. COL1);

and repeat 50 times this insert statement for all 50 columns!

Is it possible to get the name of the column and its value (using data dictionary views for example all_tab_columns or other means) to write the insert statement once especially, I have to create this trigger on a large number of tables too which means repeat the insert of hundreds of times maybe!

Is this clear?

Note: I use Oracle DB 10 g

Thank you

example:

SQL > select ' insert into audit_tab (field_name, old_value, table_name, new_value) values ("' |) TABLE_NAME | " ','' ' || column_name | " ',: ANCIENT.' | column_name |',: NEW.'. column_name |') ; "
user_tab_columns 2
3 where table_name = 'EMP '.
4 order of column_id;

' INSERTINTOAUDIT_TAB (TABLE_NAME, FIELD_NAME, OLD_VALUE, NEW_VALUE) VALUES('''||) TABLE_NAME | " ','' ' || COLUMN_NAME | " ',: ANCIENT.' | COLUMN_NAME |',: NEW.'. COLUMN_NAME |') ; "
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
insert into audit_tab (field_name, old_value, table_name, new_value) values ('EMP', 'EMPNO',: OLD.) EMPNO,: NEW. EMPNO);
insert into audit_tab (field_name, old_value, table_name, new_value) values ('EMP', 'ENAME',: OLD.) ENAME,: NEW. ENAME);
insert into audit_tab (field_name, old_value, table_name, new_value) values ('EMP', 'JOB': OLD.) JOB: NEW. JOB);
insert into audit_tab (field_name, old_value, table_name, new_value) values ('EMP', 'MGR',: OLD.) MGR,: NEW. MGR);
insert into audit_tab (field_name, old_value, table_name, new_value) values ('EMP', 'HIREDATE',: OLD.) HIREDATE,: NEW. HIREDATE);
insert into audit_tab (field_name, old_value, table_name, new_value) values ('EMP', 'SAL',: OLD.) SAL: NEW. SAL);
insert into audit_tab (field_name, old_value, table_name, new_value) values ('EMP', 'COMM',:OLD.COMM,:NEW.COMM);
insert into audit_tab (field_name, old_value, table_name, new_value) values ('EMP', 'DEPTNO': OLD.) DEPTNO,: NEW. DEPTNO);

8 selected lines.

Tags: Database

Similar Questions

  • How to make photo albums without having to download all the pictures of the computer

    I just bought a macbook pro as my old iMac has been very slow. I want to make photo albums, but don't want to put all my photos on the macbook to save space. What is the best way to do this? I am owner of a machine of Tower as well

    Try to put the library on an external drive. The article below is also applicable to the Photos.

    iPhoto: move your iPhoto library to a new location

  • Microsoft Lync 2010: When you add users to the Conference for the first time without having to type anything, the chat window is grayed out.

    Hello

    Microsoft Lync 2010: When you add / invite users to the Conference for the first time without having to type in the chat window, the chat window is grayed out. I am not able to type anything in the chat window to continue the Conference.

    Thank you
    Rajeev G C
    Phone: 9886540640

    Hello Rajiv Iyer,

    There is a forum for questions about Microsoft Lync 2010.
    Click here for a link to repost your questions in forums Microsoft Lync.

    Thank you

    Marilyn

  • How to remove specifically a user name and password without having to remove all the others.

    I don't want to delete my saved names of users or passwords for multiple sites on my computer. BUT, when I was signing on my bank account I typed the username AND password in the username by accident block. Now as soon as I type the first number in, it shows my number user name and password in the menu dropdown. Is - it there anyway I can delete this without losing my other saved names of users and passwords for other sites? Also, I have the 10.0.2 Firefox and I can't seem to find where are the tools. Please be specific. I didn't understand this version again and I sorta new computers. Thank you for your time.

    If you want to delete the data stored in a drop-down list, and then use the following steps:

    1. Click on the (empty) input field on the web page to open the drop-down list
    2. Select an entry in the drop-down list
    3. Press the DELETE key (on a Mac: shift + delete) to remove it.
  • How can I view or load a flash drive without having to download all the content.

    Previously, with assistant, there was an option to do NOTHING to DO when you plug in a device (USB, CD key or camera), but I don't see this option now?  The program automatically downloads all of the volume that makes multiple copies if you keep a few pictures on your device.  Often, I want only the low load one or two images to work with photoshop.

    It won't automatically download/run except in the AutoPlay window origonal you had selected an option and then clicked allways this.

    Reset the auto run settings

    http://www.globinch.com/Windows-7-How-to-enable-or-disable-AutoPlay-Autorun/

  • Could not open the file with. EXTENSION of ICA, where can I download this from without having to install all the other stuff that common sites ask you to

    looking for a download that will allow me to run a file with a. Extension of the ICA... There's sites but they all want to download their "registry fix" or "speed up your computer" etc.. .i want just the .ica ability... distant help you?

    Hi Trevorcollinge,

    File of the Independent Computing Architecture (ICA) used by the Citrix application servers; contains configuration information to connect to different servers; can be connected to a published application or a server's desktop environment.

    ICA files can be created with the ICA file creator program or a basic text editor.

    You can double-click an ICA file to open the virtual application remote or referenced by the file desktop environment. Note that you must have a Citrix client installed for the file to open correctly.

    Let us know if this information is useful.

  • How can I MOVE buttons on taskbar to a new location without having to close all programs and resume in the order I want?

    I like to keep the buttons in my taskbar has organized with the browser and messaging on the left, followed by Windows Explorer and other items. If they get out of order or programs are loaded into a different order, how can I MOVE the buttons to a new location without having to close all programs and resume in the order I want? In addition, sometimes, one of program buttons seems in itself to migrate out of place and I need to get back to where it should be: same problem.

    Hi shohareZohre

    Thank you for using the Microsoft Answers Forums!

    The task bar is the horizontal bar at the bottom of your screen time. In contrast to the office, which can get obscured by the windows on top of it, the taskbar are visible nearly all the time. It includes four main sections:

    ·         The Start button, which opens the start menu.

    ·         The Quick Launch bar, which allows you to start programs with a single click.

    ·         The middle section, which shows you what programs and documents you have open and allows you to quickly switch between them.

    ·         The notification area, which includes a clock and icons (small pictures) that communicate the status of certain programs and computer settings.

    Add or remove programs on the Quick Launch toolbar

    The Quick Launch toolbar is located on the task bar and is a convenient way to open programs. You can add or remove program icons in the Quick Launch toolbar so that you have easy access to the programs that you use frequently.

    To add a program icon to the Quick Launch toolbar

    Click the icon for the program to add (you can find most icons of programs on the start menu or the desktop) and then drag it to the Quick Launch toolbar.

    Note: If you don't see the toolbar tools quick launch, right-click on an empty area of the taskbar, click Toolbars, and then click quick launch.

     

    To remove a program to the Quick Launch toolbar icon

    Right-click on the icon of the program and then click Remove.

    Notes: ·         Delete an icon from the taskbar does not remove its corresponding computer program.

    ·         If you want to stop showing a toolbar on the taskbar, right-click an empty area of the taskbar, point to toolbars, and then click the item that you want to stop broadcasting.

    NOTE: The ability to move the programs in the taskbar is not possible in windows Vista but the same functionality is available in Windows 7. Please see the link below.

    http://www.Microsoft.com/Windows/Windows-7/features/Windows-taskbar.aspxand

    Check out these links for more information:

    http://support.Microsoft.com/default.aspx/KB/253679

    http://Windows.Microsoft.com/en-us/Windows-Vista/add-or-remove-programs-on-the-Quick-Launch-toolbar

    http://Windows.Microsoft.com/en-us/Windows-Vista/show-or-hide-icons-in-the-taskbar

    Hope this information was useful.

    Let me know if it worked.

    All the best!

    Thank you and best regards,

    R uma - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • My mouse stops working after 30 minutes of inactivity. How can I fix this without having to reboot my PC?

    original title: MY MOUSE STOPS WORKING AFTER PC IS IDEAL for 30 minutes. How can I fix this without having to reboot my pc

    I hang the mouse up to the wrong computer

    Suggestions:

    1. If you use a wireless mouse, check the battery.

    2. use a different mouse and see if you have the same problem in the SAME conditions (idle for 30 minutes). If you have not, then your mouse may be defective.

  • My 2 year old somehow gave a password on our computer and now we can get in our office. Without having to return to the default settings, anyone have a suggestion on how to solve this problem?

    My 2 year old somehow gave a password on our computer and now we can get in our office.  Without having to return to the default settings, anyone have a suggestion on how to solve this problem?

    If you have a different user account with administrative privileges, Panel you can connect that account and change the password of your account of origin of the user accounts applet in Control Panel. If you do not have another account like this set upwards or that you do not have the password which you will need to log on to the built-in Administrator account. In XP Home, start the computer in Mode safe. This, by repeatedly pressing the F8 key as the computer starts. This will put you in the right menu. Navigate using your arrow up; the mouse does not work here. Once in safe mode, you will see the normally hidden administrator account. The default password is white.

    In XP Pro, you don't need to go to Safe Mode. In the home screen, do Ctrl-Alt-Del twice to get the classic Windows logon box. Type in "Administrator" and the password that you assigned when you set up Windows.

    MS - MVP - Elephant Boy computers - don't panic!

  • How can I get my mouse to grab things without having to click on the buttons, if I have the touch mouse on my laptop?

    How can I get my mouse to grab things without having to click on the buttons, if I have the touch mouse on my laptop?

    You will need to go to the control panel > hardware and sound > mouse and see if the settings for the mouse pad have a function called "Tap-to-click" or something similar in the description.  The exact name of this feature differs depending on the manufacturer of the software for the mouse.

    If you do not see this option to be available, you will have to probably go to the support site for the manufacturer of your PC and download the latest drivers for your model computer mouse pad and install.  Once installed, go back to the mouse settings in the Control Panel, where you will most likely available additional settings after the driver installed.  I hope that the "Tap-to-click" function will be available to turn on or off.

  • How to remove system tool without having to pay for anything anyone to remove it?

    original title: remover tool system

    How to remove system tool without having to pay for anything anyone to remove it?

    The first three ways I listed:

    • Do a web search for the name of the program, which should be implemented in sites that show how to remove.  For example, there are many guides of withdrawal to BleepingComputer.com
    • Update and run your antivirus program.
    • Download and run Malwarebytes' Anti-Malware , a malware removal program specialist who is particularly good to remove rogue security programs .

    Boulder computer Maven
    Most Microsoft Valuable Professional

  • How can I install again without having to download it?

    A few days ago I installed windows 10 successfully. The download was a pain because I had several errors, but it finally worked. I discovered later that I liked windows 7 better because it was easier, then I demoted. I regret this because my friend showed me an easier way to use win10. How can I install again without having to download it?

    If not create you the installation media for Windows 10, you will need to download it again.

    If you need to install or reinstall Windows 10, you can use the tools on this page to create your own installation media by using a flash DRIVE or a DVD drive.

    Create your own media for a new installation:

    http://Windows.Microsoft.com/en-us/Windows-10/media-creation-tool-install

    Installation Windows 10 using the media creation tool

    The media authoring tool can be used to upgrade your current PC to Windows 10 or to create a USB or DVD and install 10 Windows on another PC.

    Note

    • If you want to upgrade to Windows 10 for free, select upgrade this PC now in the tool.

  • I have the FBI Cyber Virus on my administrator account my pc & need to know how to remove it immediately without having to pay to do so?

    I have the FBI Cyber Virus locked on my administrator account my pc & need to know how to remove it immediately without having to pay to do.  I already know that he is infected with this virus, even if Microsoft Securities said that the pc is in green.  When I log on my administrator account, it stops at my opening page & load the page of the virus, which claims to be the FBI Cyber Division, & demanding pay me $300.00 to unlock my ACCT.

    I need help right away, because I don't know how to remove this virus, without getting ripped off for pay records, etc. to remove.

    Hello

    Please go to the Microsoft Community Forums.
    From the description of the question, we understand that you want to remove the virus from the computer.
    We can imagine the inconvenience you encountered.
    Let me go ahead and help you with the issue.
     
    You did changes to the computer before the show?
     
    I suggest for the link and follow the steps in the article:
    How to remove a computer virus?
    Note: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.
    To do: Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:
    How to back up and restore the registry in Windows
    http://Windows.Microsoft.com/en-in/Windows7/back-up-the-registry
     
    Hope this solves the problem. If the problem persists, you can write to us and we will be happy to help you further.
  • Software of lost funds. How can you re - download without having to go through "choose your plan?"

    Software of lost funds. How can you re - download without having to go through "choose your plan?"

    If it is creative cloud consult, download and install Adobe Creative Cloud applications

    If it's any other product please see other downloads

    Hope this will help you.

    Kind regards

    Hervé Khare

  • I have a subscription to Captivate 8 and you want to upgrade to 9, how can I do this without having to pay again and simply continue with my subscription?

    I have a subscription to Captivate 8 and you want to upgrade to 9, how can I do this without having to pay again and simply continue with my subscription?

    Please visit: https://helpx.adobe.com/captivate/faq.html

    Adobe Captivate Guide of purchase-9

    I hope this helps.

    Concerning

    Megha Rawat

Maybe you are looking for

  • Some intensive sites CSS is not completely load images or lack of formatting since the update to v9.0.1; Why?

    Sites worked correctly with previous versions of Firefox and still work well with MS - IE v8.0 and Safari v3.1.2, but now are not images or / and are not properly formatted. Check http://www.apostlesofjesusmissionaries.com for the image problem and h

  • WLAN on Satellite Pro L770-12R after upgrade to Windows 10 has lost

    OK, first of all, I must admit that I know very little about computers so be gentle! I have some cleaning on my laptop and uninstall programs I didn't need. All of a sudden my WiFi stopped working and there is no wireless option when I try to connect

  • Laptop 7100 protected prevents Cup.

    HelloI have an old laptop 7100 protégé. If I watch a DVD on the computer with the battery and not the outlet, after about 10 minutes, the laptop to cancel just like it is running out of power. If I turn it on again, I can watch the DVD for about 3 mi

  • Problem with e1-531 fan Acer Aspire

    Hi, I have an acer aspire e1 - 531 for quite awhile now, but lately its been heating too much I had cleaned it, but it does nothing the fans to run so slow even if I have it on assets Recently, when I was playing in the bios I discovered that fans wo

  • HP Deskjet 3070 will not print black.

    I have a HP Deskjet 3070 and recently brought a few pack hp ink 364 ink combo from Amazon. The well installed ink cartages. When I try to print in black continues leaving as Faded or not at all. It's strange look I just made them. The printer seems t