Why he uses always old value, when I already have 'delete' the variable?

Hi all

Simply do this exercise and through sql book.

undefine &tax_rate
undefine &employee_id
define &tax_rate
define &employee_id
select &employee_id, first_name, salary, (salary * 12) as  "Annual Salary",(&tax_rate*salary*12) as "Tax Rate" from hr.employees where employee_id=&employee_id;

and even I run what it gives out always with employee_id 105? output is the following:

105 David 4800 57600 2880000

No explanation?

You use & when referencing the substitution variables, not when you define / undefine them. So get rid of & to set/remove.

SY.

Tags: Database

Similar Questions

  • When to use it: old.value &: new.value and when to use after and before in trigge

    Hi all

    I have a base table and a table of newspaper. Whenever I insert values in the base table can immediately update the table of the journal with some of the columns in the base table. To do this, I wrote the code. It looks like this:

    CREATE OR REPLACE
    Temp_log_track RELAXATION
    AFTER INSERT OR DELETE ON temp_list_cmpgn_hist_dtl
    FOR EACH LINE
    DECLARE
    v_partition_name varchar2 (20);
    v_num_records varchar2 (20);
    BEGIN
    v_partition_name: = to_char (: new .campaign_start_date, "YYYYMM");
    SELECT v_num_records FROM list_campaign WHERE program_id = num_records: new.program_id
    AND program_child_id =: new.program_child_id;
    IF the insertion
    INSERT INTO temp_list_cmpgn_bkup_log
    (campaign_start_date, load_date, program_child_id, program_id, partition_name, num_records)
    VALUES (: new .campaign_start_date,: new.load_date,: new.program_child_id,: new.program_id,)
    "list_cmpgn_" | (v_partition_name, v_num_records);
    DBMS_OUTPUT. PUT_LINE ('INSERTED');
    ON THE OTHER
    DELETE FROM temp_list_cmpgn_bkup_log
    WHERE program_child_id =: old.program_child_id / * AND campaign_start_date =: old.campaign_start_date AND load_date =: old.load_date
    AND program_id =: old.program_id
    AND nom_partition = 'list_cmpgn_ ' | v_partition_name AND num_records = v_num_records * /;
    END IF;
    EXCEPTION
    WHILE OTHERS THEN
    DBMS_OUTPUT. Put_line ('Error');
    END;

    (1.) I am able to insert values into the table of the journal whenever I insert values in the base table, but I'm not able to delete the values in the table of the newspaper whenever delete is performed on the base table.
    2.) when to use it: OLD.value and: NEW.value?
    (3.) when to use AFTER and when to use BEFORE?

    As sb90275, you should really use the actual dates, no strings, in your query. You can use the TO_DATE function to convert a date string, i.e.

    DELETE FROM table_name
     WHERE program_id = :1
       AND program_child_id = :2
       AND load_date = to_date( '30-NOV-84', 'DD-MON-RR' )
       AND campaign_start_date = to_date( '20-NOV-85', 'DD-MON-RR' )
    

    If you store data in LOAD_DATE or CAMPAIGN_DATE where the component "hour" is something else that at midnight, you would need to TRUNC (load_date) or TRUNC (campaign_start_date).

    If you look at the error stack, you'll see that the error is thrown to line 6 of your relaxation. Line 6 of your trigger is the statement

    SELECT num_records
      INTO v_num_records
      FROM list_campaign
     WHERE program_id = :new.program_id
       AND program_child_id = :new.program_child_id; 
    

    If you delete data, there is none: new.program_id or: new.program_child_id. Both values are NULL. This means that the SELECT statement retrieves no data, which means he raises an ORA-01403 error. I don't know why you do this query in the first place. You may delete it. Maybe you should do inside the INSERT IF statement. Maybe you need to change to select the COUNT (*) BOF the: old.program_id and: old.program_child_id if you are deleting lines.

    Justin

  • Old values of CLOB not stored in the CSF

    Hello, we have configured Oracle Streams such as unidirectional replication (source v11.1.0.7.0 destination v11.2.0.3.0). We use a dml procedure managers to ensure history, in any case, we are not able to get an old values for replicated for UPDATE/DELETE dml operation CLOB columns. New values get properly:

    ...

    v_clobcol_new CLOB.

    v_clobcol_old CLOB.

    ...

    v_clobcol_new: = SYS. ANYDATA.accessClob (lcr.get_value ('NEW', 'CLOBCOL'))

    ...

    In any case, for the command:

    v_clobcol_old: = SYS. ANYDATA.accessClob (lcr.get_value ('OLD', 'CLOBCOL'))

    How to get:

    "ORA-26785: object has a NULL value.

    ORA-30625: shipping method on the argument NULL SELF is not allowed

    ORA-06512: at "DESTINATION. REPLICATED_TABLE', line 23

    ORA-06512: at line 1

    "

    We cannot see the old value for the CLOB, updated in the message column while LCR impression as well.

    How can we get the old value please?

    Any help appreciated.

    Best regards

    TukanTeam

    For any CRL including the command type is UPDATE or DELETE , old LOB values are ignored.

    Management of the logical change records (ADR)

    Thank you

  • Why should I enter a password when item is moved to the trash

    Why should I enter a password when item is moved to the trash

    All items from anywhere?  If you try to trash system files, they can have special permissions.

  • Windows XP Pro. Svchost use 100% system resources when starting. What is the purpose of svch.exe?

    Windows XP Pro. Svchost use 100% system resources when starting. What is the purpose of svch.exe? RWM

    Hi r_miller,
     
    Follow the suggestion given in this article to resolve this problem:
  • Why does it say I have to install XP sp2 when I already have XP sp3?

    I have an aol active monitor which scans when I connect and it says I need to install sp2 when I already have sp3?

    Hello

    I am assuming you are using Windows XP, please correct me if I'm wrong. Also, assuming that by active monitor, you mean AOL Serrenti Security Monitor's Active. Unfortunately, Active Security Monitor Serrenti of AOL receives more updates and this is most likely the problem. The most likely culprit is that it has not been updated in order to receive support for Service Pack 3 and because you do not have SP2 separately, it does not detect installed SP2. Because Active Security Monitor Serrenti of AOL is no receiver more support updates, you cannot get rid of the notification of SP2. Hope this helps.
  • He keeps sayingi need adobe flash more recent version of the player when I already have the end that is available

    t keeps saying that I need newer Adobe flash player version when I already have the end that is available

    The cause is often that there is always a file from a previous version which should have been deleted, but was not perhaps because Flash was in use at the time.

    Please navigate to this folder:

    C:\WINDOWS\system32\Macromed\Flash

    In the Flash folder, there should only be a .ocx type file, which should be as follows for the latest version:

    Flash32_11_3_300_271.ocx

    The figures in bold represent the version: 11.3.300.271

    If you have a different 'Flash32_xx_x_xx_xxx. ocx"file which the numbers correspond with earlier versions of flash, and then delete this file and restart the machine.  The new version should then recognized.

  • When I try to delete the mail from the Inbox I get the message that says: "the selected message could not be copied to the destination, UID copy failed."

    UID copy failed

    I have windows vista.  When I try to delete the mail from the Inbox I get the message that says: "the selected message could not be copied to the destination, UID copy failed."

    Hello

    ·          What mail client do you use?

    If you use Microsoft Outlook, please post your questions in the Forums of Microsoft Office.

    If you use Windows Live mail, please post your questions in the Windows Live Forum.

  • Error 0 x 00000709 when you try to delete the print job and/or pritner.

    Original title: error 0 x 00000709.

    I have a dell laptop running windows vista Home premium SP1 with a 64-bit operating system.  I tried to remove a printer HP 1310 on my computer and it is stuck on "suppression of 1", I stop, then restart the printer spooler and now I have error 0 x 00000709 when you try to delete the print job and/or pritner.   What can I do to remove this printer.   I installed a Canon MX330 printer, but due to the printer HP being locked, I can't print with a PictBridge compatible printer.

    Hi LauraD,

    You can try to remove the printer from the safe mode and check.

    Step 1:

    You can read the following article to start in safe mode:

    Start your computer in safe mode

    Step 2: Remove the printer.

    You can read the following article to remove the printer.

    Add or remove a printer

    After deleting the printer, you can start in normal mode and try to install Canon printer.

    Hope this information is useful.

  • I accidentally loaded a .iso file on my PC and can not get rid of it. When I try to delete the file it says that the file is opened by the system. Also the file created 3 virtual drives like E:, F: and G: __Please let me know how I can remove this .iso

    I accidentally loaded a .iso file on my PC and can not get rid of it.  When I try to delete the file it says that the file is opened by the system.  Also the file created 3 virtual drives like E:, F: and G:
    Please let me know how I can remove this .iso file.

    Try Safe Mode. Repeatedly press the F8 key as the computer starts getting the menu diagnosis. Use the arrow key to select Mode without failure. MS - MVP - Elephant Boy computers - don't panic!

  • 42 error code when you try to delete the file

    PDF file which can be opened and read.  However, when you try to delete the file, error file not found 42 made its appearance.  MacBook Pro computer

    Please relaunch the Finder , and then try again. If there is no change, restart the computer.

  • How can I prevent subfolders are deleted when I try to delete the parent folder which I did not have permission to delete?

    There is folder (I have a total control except "delete")

    There are some folders and files in A folder.
    When I try to delete the folder it said "access denied." That's what I wanted.
    But after having done this, when I check inside the notebook has, I saw subfolders and files have been deleted.
    How can I set the permissions to prevent this?
    (I also want to have the permission to delete subfolders or files in folder A when I'm in it. I just want to avoid file one himself from deletion)
    Thanks in advance...

    Hi fenarena,

    Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT Pro TechNet public. Please post your question in the TechNet forum.

    http://social.technet.Microsoft.com/forums/en/category/windowsxpitpro

  • When I try to delete the message in the "Deleted items" folder I get an error message "some items in the folder"Deleted items"could not be deleted." year error has occurred. Any Suggestions?

    I get to see all the messages that I deleted in my "Deleted items" folder and when I try to delete the message in this folder I get an error message 'some items in the folder "Deleted items" can not be deleted.' an error has occurred.  Also when I try to delete my Inbox it won't move message from 'deleted items '.  Any suggestions?

    This is probably due to a mismatch between what is in the message store and which think that the database is in the message store.  Try to compact and repair the database and see if that fixes the problem.  See www.oehelp.com/WMUtil/

    Steve

  • When I try to delete the remaining files, I get error 0 x 80004002

    Original title: error 0 x 80004002

    I just uninstalled the free NITRo pdf Reader worm, however I still see running.

    When I try to delete the remaining files, I get the above message,

    Help, please.

    Thank you

    Mr. Zaid has S has

    Hey Zaid,

    ·         Do you see Nitro pdf reader running in the Windows Task Manager?

    This problem occurs if the program is not uninstalled properly. Follow these methods and check if that helps:

    Method 1: I suggest to remove the files in safe mode and check.

    Start settings for Windows (including safe mode)

    http://Windows.Microsoft.com/en-us/Windows-8/Windows-startup-settings-including-safe-mode

    Method 2: Try ending the Nitro pdf reader process in Windows Task Manager and see if it helps:

    1. open the Task Manager by right-clicking on the taskbar and then click on Task Manager.

    2. If you see Nitro pdf reader in Task Manager right click it and click end task.

    3. click on more task and complete the process associated with Nitro pdf reader.

    You can also try the Nitro cleaning tool from the link below and check if it helps. If the cleanup utility does not remove Nitro Reader please try install Nitro Reader and then uninstall and check if it helps:

    http://SupportTools.nitropdf.com/

    Hope this helps, if the problem persists we know that we will be happy to help you.

  • Where can I download Acrobat Professional 10.0 when I already have a license?

    Where can I download Acrobat Professional 10.0 when I already have a license?

    Hey heatherl28478704,

    You can download Acrobat X from the link mentioned below:

    Download Acrobat products | Standard, Pro | DC, XI, X

    Start the trial version of the software. In the Activation dialog box, click enter serial number.

    Enter the serial number of the product and activate your license.

    Try on your side and let me know how it goes.

    Kind regards

    Ana Maria

Maybe you are looking for