Error no valid identifier when you try to create a trigger

Hi all

I get this weird error when you try to create a trigger. Basically, it updates a table of different relationship on INSERT or UPDATE.

The error I get is:
* PL/SQL: ORA-00904: "cid": invalid identifier *.
SET SERVEROUTPUT ON
CREATE or REPLACE TRIGGER UPDATE_REL_TABLE 
     AFTER INSERT OR UPDATE ON XF_PROJECT_CODE
FOR EACH ROW 
DECLARE
     customer_count NUMBER;
     n_cid NUMBER;
BEGIN 
     -- CHECK if company exist
     SELECT COUNT(*) INTO customer_count FROM XF_CLIENTS WHERE UPPER(client_name) = UPPER(:NEW.company);
     
     CASE 
     WHEN customer_count > 0 THEN
          -- GET CUSTOMER ID
          select t.cid INTO n_cid FROM XF_CLIENTS t WHERE t.CLIENT_NAME = :NEW.company;   // ERROR HERE!!
          
          -- UPDATE relationship table
          INSERT INTO XF_CLIENT_CODE_R (PROJECT_CODE_ID, cid) VALUES (:NEW.project_code_id, n_cid);
     
     ELSE
          -- customer does not exist
          n_cid := XF_CLIENTS_SEQ.NEXTVAL;
          
          -- Create client
          INSERT INTO XF_CLIENTS(cid, client_name) VALUES(n_cid, :NEW.company);
               
          -- update relationship table
          INSERT INTO XF_CLIENT_CODE_R(project_code_id, XF_cid) VALUES (:NEW.project_code_id, n_cid);
          
     END CASE;
END; 
/
SHOW ERRORS;
The column exists and matches the data type (number). Any help appreciated. bit at loss where I'm wrong.

Good fishing! Who'd do all right.

Tags: Database

Similar Questions

  • Error PLS-00103 when you try to create a trigger

    Hello people,

    I am trying to create a trigger, but I encounter this error saying that Oracle waited a ';' but found support "(" on line 7. I have yet to find what is the problem. It would be much appreciated if someone could one give me a clue on this. As a result the code used to create the trigger.

    CREATE OR REPLACE TRIGGER TriggerIns BEFORE INSERT OR update ON registration
    FOR EACH LINE
    DECLARE
    NUM INTEGER;
    BEGIN
    IF: new.ni < 1000 THEN
    SELECT COUNT (*) IN the number OF athletes WHERE ns =: new.ni;
    IF num = 0 THEN
    REVIVAL (abandonment, 'foreign key violation');
    END IF;
    END IF;

    IF: new.ni > 1000 THEN
    COUNT (*) of SELECT INTO num From teams WHERE nequipe =: new.ni;
    IF num = 0 THEN
    REVIVAL (abandonment, 'foreign key violation');
    END IF;
    END IF;
    EXCEPTION
    END;

    Thanks in advance

    Sebastian

    user2019788 wrote:
    Hello people,

    I am trying to create a trigger, but I encounter this error saying that Oracle waited a ';' but found support "(" on line 7. I have yet to find what is the problem. It would be much appreciated if someone could one give me a clue on this. As a result the code used to create the trigger.

    CREATE OR REPLACE TRIGGER TriggerIns BEFORE INSERT OR update ON registration
    FOR EACH LINE
    DECLARE
    NUM INTEGER;
    BEGIN
    IF: new.ni< 1000="">
    SELECT COUNT (*) IN the number OF athletes WHERE ns =: new.ni;
    IF num = 0 THEN
    REVIVAL (abandonment, 'foreign key violation');
    END IF;
    END IF;

    IF: new.ni > 1000 THEN
    COUNT (*) of SELECT INTO num From teams WHERE nequipe =: new.ni;
    IF num = 0 THEN
    REVIVAL (abandonment, 'foreign key violation');
    END IF;
    END IF;
    EXCEPTION
    END;

    Thanks in advance

    Sebastian

    Don't know why he complains of line 7 but your RECOVERY declaration syntax is incorrect. I think what you want instead of "RAISE" is "RAISE_APPLICATION_ERROR. You should also put something between the EXCEPTION and the END or remove the "EXCEPTION".

     CREATE OR REPLACE TRIGGER TriggerIns BEFORE INSERT OR UPDATE ON Inscriptions
       FOR EACH ROW
       DECLARE
         num INTEGER;
       BEGIN
         IF :new.ni < 1000 THEN
           SELECT COUNT(*) INTO num FROM Sportifs WHERE ns = :new.ni;
           IF num = 0 THEN
             RAISE_APPLICATION_ERROR(-20101,'foreign key violation');
           END IF;
         END IF;
    
         IF :new.ni > 1000 THEN
           SELECT COUNT(*) INTO num From Equipes WHERE nequipe = :new.ni;
           IF num = 0 THEN
             RAISE_APPLICATION_ERROR(-20101,'foreign key violation');
           END IF;
         END IF;
    --   EXCEPTION
    --     WHEN OTHERS THEN RAISE;
       END;
    
  • Get the error (0 x 8078119) when you try to create a system image in Windows 7

    Original title: shadow copy volume
    Hello

    I currently have problems with creating a system image, because it comes back with the error (0 x 8078119) now I know it's, it's to do with the lack of disk space of 100 MB (startup disk or something like that) but with mine I have 62% of free space that is 63 MB available space for me (Please note the 100 MB drive for me is 102 mb)
    so I was wondering if anyone can help, because I had a virus before and ended up losing everything, that I don't really want to breed

    Hi Jugganourt,

    Please see the troubleshooting following thanks Divya R:

    Step 1: Check if the shadow copy Volume service is running.

    1. Click Start and type services.msc in the search box

    2. double-click on the Volume Shadow Copy Service.

    If you receive a Configuration Manager message, click OK.

    3. in the Startup Type list, clickAutomatic, and then click OK.

    4 services nearby.

    5 restart the computer.

    Step 2: Open Event Viewer to check the exact error message:

    Event Viewer is a tool that displays detailed information about the events important (for example, programs that don't start as expected or updates are downloaded automatically) on your computer. The event viewer can be useful when troubleshooting problems and errors with Windows and other programs.

    For more information, see:

    What are the information contained in the logs of the event (Event Viewer)?

    http://Windows.Microsoft.com/en-us/Windows7/what-information-appears-in-event-logs-Event-Viewer

    Check out this link to open the event viewer:

    Open event viewer

    http://Windows.Microsoft.com/en-us/Windows7/open-Event-Viewer

    Open event viewer and navigate to the following location: applications and services Logs\Microsoft\Windows\WindowsBackup\ActionCenter.

    Step 3: You can also generate a log file by following the instructions below and send us the details.

    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 the following windows Help article.

    Back up the registry
    http://Windows.Microsoft.com/en-us/Windows7/back-up-the-registry

    1. Click Start-> Run-> type regedit.exe.

    2. navigate to HKEY_LOCAL_MACHINE NT\CurrentVersion\Asr, create a new key called LogFileSetting.

    3. under LogFileSetting, create a new DWORD value called EnableLogging.
    Right click on this value, click on edit and then type 00000001 (hexadecimal)
    or 1 (decimal).

    4. under LogFileSetting, create a new string value called LogPathName.
    Right click on this value, click on edit and then enter C:\asr.log.

    5. then, to reproduce the error. You should have a file called asr.log in c:\

    6 copy the content and after us.

    Thank you!

  • Satellite U205-S5034 - error when you try to create the recovery disks

    Hello world

    I have problems with the TOSHIBA recovery disk creator. When you try to create the recovery disks this error pops up:
    An unexpected error has occurred. Exit this application and start it again. (Error code: F1-0F00FE-00000002)

    The machine is a Satellite U205-S5034 under XP Pro SP3.

    Any help will be greatly appreciated. Thank you and have a nice day.

    DaveMatt44

    Hello

    What kind of DVD that you use to create a Toshiba Recovery disk? I have tried Verbatim DVD-R and TDK DVD-R and never had a problem with these discs. A friend tried DVD + R and he couldn t create a recovery disk. After he tried DVD-R and everything was fine but I do not know why this happened.
    So please try other discs.

    Also, check the Toshiba page for an update of the firmware of the CD/DVD drive. Maybe it will help you.

  • Get "communication error with kernel" message when you try to run a virus scan program

    Get "communication error with kernel" message when you try to run a virus scan program

    Hello

    What antivirus do you use?

    Follow the steps in the article mentioned below and check if this solves the problem.


    The error message "error communicating with kernel":

    http://KB.eset.com/esetkb/index?page=content&ID=SOLN2280

  • I have 5 "MY BACKUP" folder on my drive C in 2008. How can I remove the old ones. Receiver error MSG "Access denied" when you try.

    I have 5 "MY BACKUP" folder on my drive C in 2008. How can I remove the old ones. Receiver error MSG "Access denied" when you try.

    Hi PJG_918,
     
    To resolve this problem, you must turn off Simple file sharing and then take over the folder.
     
    Here is an article that will explain the procedure to the same thing:
     
  • details of error: code 80071a 91 when you try to install the 'a security update for windows vista (kb2855844).

    details of error: code 80071a 91 when you try to install the 'a security update for windows vista (kb2855844).

    does anyone know how to go beyond this error?

    Thank you.

    Moved from Vista to install, upgrade and activate Forum.

    Take a look at this thread:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-windows_update/unable-to-install-updates-getting-error-code/27a21977-F964-4376-BFAB-2f29ea127c6a

  • 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.

  • When you try to create a system image, receive the error code 0 x 81000019

    Get the error code when you try to create a system image on a 900 + GB hard drive with 900 GB of free space. Keeps telling me that there is not enough space to create the image of the shadow. I'm trying the disk image has only 40 GB of data. What is going on? Using Windows 7 64 bit Pro.

    Many hours of searching the Web for answers about a year ago, said that relatively few people have this problem and proposed solutions in the forums have been complex, machine dependent and seem to fail for most of the people who have tried a fix...

    So when I gave up and called Microsoft... they told me to take my problem to anyone assembled my computer...

    The man who built my machine told me not to worry, simply store all my files on the cloud, as he does...

    So now I store my important stuff on a spare drive, we have installed in the box, go to live with the inability to make appropriate backups and restore points...

    All my old computers is standard backups without any hassle... Just this new machine with Win7.

    (The only "new" thing was a disc SSD C... can't believe it would make one difference either, other than speed... and many people use them in 2011...)

  • Version of Photoshop elements Windows 14 - error when you try to create a Photomerge Panorama "documents must be registered before they can be merged. I tried a few of the fixes mentioned in these forums such as Edit-&gt; Preferences-&gt; general-&gt; res

    We know the fix for the bug "documents must be registered before they can be merged" when you try to create a Photomerge Panorama in PSE 14?

    I think I have found workarounds to the question "documents must be registered before they can be merged" (no thank you lack of Adobe customer support):

    Solution #1

    My workflow template is to take pictures with my SLR and save on the memory in the form of RAW files, download the images on my PC, then open the RAW files in Adobe Camera Raw and then save the images to jpeg using PSE. I wasn't able to create Photomerge Panorama with jpeg images I've saved, but I was able to create Photomerge Panorama with the images I have saved IF I save as TIFF 8-bit files in EPS. A condition for this workaround was that I had to save the pictures at their original resolution and not at a reduced resolution.

    Solution #2

    If I have a right-click on an image and selected open with 14 and observed PES Editor (RGB/8) * to the right of the file changes its name, which means PSE think he has not saved to the file. The solution is to go to file-> Save-> Save (replace existing file-Yes)-> OK. You can then use this file and others you perform the same steps to create a Photomerge Panorama.

    Solution #3

    The way to save JPEG files in PSE is to go to file-> save for Web-> Save-> Save. The workaround is to select the file-> save for the Web and then check the box include the color profile , then click on save and then save again. Then I'm able to merge JPEG files using Photomerge Panorama and I don't get the error message "Documents must be registered before they can be merged". I looked back 11 of PSE that is still on my PC and found that the Embed checkbox color profile did NOT have to be checked to get Photomerge to work for jpeg files. So it appears with PSE 14 Adobe changed the Photomerge Panorama script to require the image file the color profile embedded in the image. If the color profile is not embedded, PSE think the image file has unsaved changes. BTW, this bug, or "feature" has not changed with PSE 14.1.

  • I run pc photoshop CS6 on my windows 7 (mac). I have stupidly? the Applications Adobe Manager to update all my Adobe apps. Since that time I now get the following error message when you try to create the Contact Sheet II in my SP6 or 64 PS5.5

    Greetings


    I run Photoshop CS6 on my windows 7 Ultimate (MacPro 2008 via Bootcamp). 12 GB of ram, 512 on the video card. A lot of disk space. None of the questions of knowledge, viruses, malware, etc.


    I have stupidly? the Applications Adobe Manager to update all my Adobe apps. Since that time I now get the following error message when you try to create the Contact Sheet II in any of my SP6 or PS5.5 64-bit or 32-bit versions. «Cold is not complete the plug of command because Photoshop was unable to locate the plugin JavaScript» Re, I installed the latest update, but no change. My installation is built on CS4 extended, then with a version Standard 5, 5.5 and 6 facilities upgrade.


    The Contact Sheet function was working well, until I ran the updates.


    I'm in a bad place, as I am in the middle of multiple projects, everything I need to create Contacts for.  I thank any help or give advice on how to fix this...


    Help, please!

    Try to run Photoshop with the SHIFT key is pressed and skip loading part tird plug-in and try to use the Board contact II.  A version of plug-ins from third parties have been known to break Photoshop Scrippting.

  • Error when you try to create the Contact form PSE13

    I get two error messages when you try to create a contact sheet

    "The operation could not be completed. The file or directory is not found. »

    then

    "Could not complete the command II Board contact because of a program error"

    I'm on iMac OSX Yosemite 10.10.2

    Updated for PSE12 when PSE13 is released

    No problems with PSE12

    If you go to

    (user) Library\Preferences\Adobe\Plugins\Adobe Board Contact II PSE12\Elements

    and remove the

    Adobe Board Contact PSE12 Pref.


    If all goes well, you should be able to use the plugin Contact Sheet II again.

    To view your library, the user in the menu go to the Finder press the Option key, then you should see library listed in the menu to reach.

  • Error code: 0xC0AA020F when you try to create recovery disks

    I get a message from "error code: 0xC0AA020F" when you try to create recovery discs. How fixit?

    Hi t - 1 s,

    What part of creation that encounter you the error? Thank you.

  • Access denied message when you try to create a zip folder windows 7 Home premium

    I reinstalled windows yesterday and now get an access denied message when you try to create a zip file

    If you are still having the same problem with your zip files, please see the thread below for assistance.
    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-files/issue-can-not-create-zip-folders-in-Windows-7-home/4eeba066-e741-4267-AA5D-910e4bf43b82

    Thank you!

  • I don't have a blank page option when you try to create a new page

    I don't have a blank page option when you try to create a new page, what should I do?

    When questions about the user interface, it helps if you say that you are using which version of Dreamweaver. It sounds as if you are using the latest version of Dreamweaver CC, but try to follow instructions written for an older version. This is the new Document dialog box in Dreamweaver CC 2015:

    New Document has replaced the White Page in older versions. To get a blank page, select New Document in the left column, HTML as a Type of Document and there is no tab for framework.

Maybe you are looking for