"PLS-00405: subquery not allowed in this context" when compiling.

Hi gurus,


Please provide your suggestions how to handle this compilation error.

Instead of coding hard the hor trying to select in the table.

What do - to trigger an error # in the output if any dit_rec.hor not in to hor_ref table where the method is like '%c %', but I make a

"PLS-00405: subquery not allowed in this context" when compiling.

Please help me how to re - write it.

Dit_rec.Hor IF NOT IN (select hor_ref hor where method like '%c %')
THEN
Dbms_output.put_line ('#0725 error');
END IF;


Hor_ref / / desc:
Hor number (2)
method varchar2 (8)

Specimen:

HORMETHOD
4CAILLET,
11CAILLET,
14CAILLET,
17C, D, M
19CAILLET,
23P, M

/ / DESC said

dit_id VARCHAR2 (9 bytes) Pk constraint.
Hor NUMBER (2)

Specimen:

DIT_idHOR
6724
143511
15352
153610
15382
15394

Try this:

-etc.

V_Cnt NUMBER;

BEGIN

-etc.

SELECT COUNT (*)

IN V_Cnt

OF Hor_Ref

WHERE method LIKE '%c % '.

AND Dit_Rec.Hor = Hor;

IF V_Cnt = 0

THEN

DBMS_OUTPUT. Put_line (' error #0725' ");

END IF;

-etc.

END;

Tags: Database

Similar Questions

  • The reference to the table, view, or the sequence is not allowed in this context

    Hello

    I am triying to run the SP that I describe below and the OS gives me an error:
    CREATE OR REPLACE PROCEDURE DWARE.P_CSCV_AGR_MONTH_REVENUE
    (
        TBL_NAME VARCHAR2,
        START_DATE DATE,
        RESULT_ OUT NUMBER
      ) AS
      BEGIN
      
      DECLARE 
      
        v_tbl_name VARCHAR2(30);
        v_start_date DATE;
        v_result NUMBER := 0;
        
        v_select_aux VARCHAR2(32767) := ' ';
        v_temp_table VARCHAR2(30);
        v_exists NUMBER;
    
      BEGIN
        v_tbl_name := TBL_NAME;
        v_start_date := START_DATE;
      
        v_temp_table := 'temp_' || v_tbl_name;
        
        SELECT count(*) INTO v_exists FROM tab WHERE lower(tname) = lower(v_temp_table);
        IF (v_exists = 1) THEN
          v_select_aux := '
            DROP TABLE ' || v_temp_table || ' CASCADE CONSTRAINTS PURGE
          ';
          EXECUTE IMMEDIATE (v_select_aux);
          COMMIT;
        END IF;
        
        v_select_aux := 'CREATE TABLE ' || v_temp_table || ' AS 
                                  SELECT ch.date_ month_revenue,
                                       s.date_sub month_sub,
                                       s.codpromoter,
                                       u.OPERATOR,
                                       SUM (ch.total) AS TOTAL_OK
                                       FROM cscv_sub_charges_' || to_char(v_start_date, 'YYYY_MM')|| ' ch
                                       INNER JOIN cscv_subs s
                                       ON ch.id_sub = s.ID
                                       INNER JOIN cscv_users u
                                       ON s.id_user    = u.ID
                                WHERE ch.STATUS = 0
                                GROUP BY ch.date_, s.date_sub, s.codpromoter, u.OPERATOR';
                                
        EXECUTE IMMEDIATE (v_select_aux);
        COMMIT;  
         v_select_aux := '
     INSERT INTO ' || v_tbl_name || ' (
             month_revenue,
             month_sub,
             codpromoter,
             operator,
             TOTAL_0,
             TOTAL_1,
             TOTAL_2,
             TOTAL_3,
             TOTAL_4,
             TOTAL_5,
             TOTAL_6,
             TOTAL_7,
             TOTAL_8,
             TOTAL_9,
             TOTAL_10,
             TOTAL_11
          )
            SELECT 
             month_revenue,
             month_sub,
             codpromoter,
             operator,
             TOTAL_0,
             TOTAL_1,
             TOTAL_2,
             TOTAL_3,
             TOTAL_4,
             TOTAL_5,
             TOTAL_6,
             TOTAL_7,
             TOTAL_8,
             TOTAL_9,
             TOTAL_10,
             TOTAL_11
            FROM 
            (
               SELECT 
                  month_revenue,
                  month_sub,
                  codpromoter,
                  operator,
                  sum(total_ok) total_0,
                  0 total_1,
                  0 total_2,
                  0 total_3,
                  0 total_4,
                  0 total_5,
                  0 total_6,
                  0 total_7,
                  0 total_8,
                  0 total_9,
                  0 total_10,
                  0 total_11
                 FROM '|| v_temp_table ||'
              WHERE to_char(month_sub,''mm/yyyy'') = to_char(sysdate,''mm/yyyy'')
              GROUP BY month_revenue,month_sub,codpromoter, operator
              UNION ALL
              SELECT 
                  month_revenue,
                  month_sub,
                  codpromoter,
                  operator,
                  0,
                  sum(total_ok),
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0,
                  0
                 FROM '|| v_temp_table ||'
              WHERE to_char(month_sub,''mm/yyyy'') = to_char((to_date(sysdate,''dd/mm/yy'') - INTERVAL ''1'' MONTH),''mm/yyyy'')
              GROUP BY month_revenue,month_sub,codpromoter, operator
              ) 
            GROUP BY month_revenue,
             month_sub,
             codpromoter,
             operator
               ';    
        
        EXECUTE IMMEDIATE (v_select_aux);
        v_result := v_result + SQL%ROWCOUNT;
        COMMIT;
        
        v_select_aux := '
          DROP TABLE ' || v_temp_table || ' CASCADE CONSTRAINTS PURGE
        ';
        EXECUTE IMMEDIATE (v_select_aux);
        COMMIT;
        
        RESULT_ := v_result;
      END;
      END P_CSCV_AGR_MONTH_REVENUE;
    /
    ------------------------------
    BEGIN
    DWARE.P_CSCV_AGR_MONTH_REVENUE(CSCV_AGR_MONTH_REVENUE,'01/01/2010');
    END;
    /
    and the output is:
    Error at line 1
    ORA-06550: líne 2, column 32:
    PLS-00357: The reference to the table, view or sequence 'CSCV_AGR_MONTH_REVENUE'  is not allowed in this context
    ORA-06550: líne 2, column 1:
    PL/SQL: Statement ignored
    What could I do to fix the problem?

    Thanks in advance...

    Hello

    Signature of the procedure is

    CREATE OR REPLACE PROCEDURE DWARE.P_CSCV_AGR_MONTH_REVENUE
    (
    TBL_NAME VARCHAR2,
    START_DATE DATE,
    RESULT_ OUT NUMBER
    ) 
    

    either he's expecting two input parameters, tbl_name in VARCHAR2 and the other START_DATE date format format. Also you need a variable with the number data type to store the value of the PARAMETER RESULT_

    Now, look at the way you call this procedure

     BEGIN
    DWARE.P_CSCV_AGR_MONTH_REVENUE(CSCV_AGR_MONTH_REVENUE,'01/01/2010');
    END;
    /
    

    first parameter must be a VARCHAR2, so place CSCV_AGR_MONTH_REVENUE in single quotes.
    second parameter must be a date, so use to_date() function.
    Finally declare a variable with the data type of number to maintain the value of the parameter RESULT_

    Something like this:

    declare
    t_num number;
    begin
    a('CSCV_AGR_MONTH_REVENUE',to_date('01/01/2010','MM/DD/YYYY'),t_num);
    dbms_output.put_line(t_num);
    end;
    

    Vivek L

  • How I can corect the following protocols (rtsp) is not associated with any program or is not allowed in this context

    The address was not included

    Firefox doesn't know how to open this address, because one of the following protocols (rtsp) is not associated with any program or is not allowed in this context.

       You might need to install other software to open this address.
    

    I'm not a Curmudgeon, so please keep it simple.

    Thank you

    Firefox 32.0.3 has this security update.
    You can check the version in "> about".

  • I am installing CC on an iMac late 2015. I get the following error message: Firefox doesn't know how to open this address, because one of the following protocols (aam) is not associated with any program or is not allowed in this context.      You mi

    I am installing CC on an iMac late 2015. I get the following error message: Firefox doesn't know how to open this address, because one of the following protocols (aam) is not associated with any program or is not allowed in this context.      You may need to install additional software to open this address. "Someone knows what's going on?

    Please try to download from: https://helpx.adobe.com/creative-cloud/help/install-apps.html. You can also try to download using the different browser.

  • The area is blocked: * siteremoved * is not allowed on this network.

    I go to a site that I go to every day and all of a sudden, I'm being re-directed to http://block.opendns.com/main, and the page reads:

    THIS DOMAIN IS BLOCKED.
    Www.xxxxxx.com site is blocked is not allowed on this network. OpenDNS

    I checked my router settings and nothing is blocked. I checked this first because I recently opened Upnp to allow a game.

    I do not use a DNS service and I can't understand how to 'allow' this site on my network.

    Can someone tell me where to click to allow a site on my network?

    original title: THIS FIELD IS BLOCKED.__Site blocked www.xxxxxx.com is not allowed on this network. OpenDNS

    192.168.1.1 is the local address of your modem or router.  In turn, your router or modem gets its information from your ISP DNS, unless ignore you it with a manual setting.
     
    I have a Vista computer handy, but on my computer Windows 7 I would right-click on the connection in the task bar icon, select "Open network and sharing Center." Then click "edit card settings. Right-click on the adapter used (without wireless or LAN), select Properties, then 'Protocol Internet Version 4 (TCP/IPv4)', then properties. Instead of "Obtain DNS server address automatically" click "use the following DNS server address". Enter 8.8.8.8 and 8.8.4.4 in two spaces, click OK and restart. Did that fix the problem?

    Gary van, Microsoft MVP (Mail)
    ------------------------------------------------------

    "LanCyfer" wrote in the new message: * e-mail address is removed from the privacy... *

    ... DNS server: 192.168.1.1

    "LanCyfer" wrote in the new message: * e-mail address is removed from the privacy... *

    where should I click to check the settings of the DNS on my PC?

    Vista

    Gary van, Microsoft MVP (Mail)

  • Log on to the method not allowed on this computer

    original title: Error Window Vista.

    You cannot connect because the logon method, you use is not allowed on this computer. Please, see your network administrator for more information. This is the response I get when I try to log on my Windows Vista computer on a domain. I removed all the newspapers deny on policies affecting the comments. Always the same. Can anyone help.

    Hello

    I suggest you to ask your question at the following link.

    http://social.technet.Microsoft.com/forums/en-us/w7itpronetworking/

    I would also ask you to contact your IT Department.

  • Windows Mail error 0x800CCC92: Operation of Pop is not allowed for this user

    Split of: ' "windows mail error code: ox800CCC0E, error code 10060".

    Account: 'mail.bigpond', server: 'mail.bigpond.com', Protocol: POP3, server response: '-ERR pop operation is not allowed for this user.', Port: 110, secure (SSL): no, Server error: 0x800CCC90, error number: 0x800CCC92

    It's what keeps appearing on my Windows Mail when I go in there. BigPond say they have problems with Windows Mail and try to fix it.  Any ideas please?

    Thanks LyndaBeresford

    If they have problems, then it is not that you can do about it until they solve these problems.

    You can access your e-mail via webmail: https://signon.bigpond.com/login?site=chw&goto=http%3A%2F%2Fmessaging.bigpond.com%3A80%2F%3Fref%3DNet-Head-Webmail

    Steve

  • My error says "modification is not allowed because this selection is locked", how to unlock this or what I can do to fix my windows.

    When I try to go into my Windows Word and type something, it won't allow me.  He told me that this modification is not allowed because this selection is locked.  How can I fix it.  Miss me a lot of homework, so for this reason.  It allows me to remove the program from the Control Panel Add/Remove program also.

    -You can publish the same query in the office community
    http://www.Microsoft.com/Office/Community/en-us/FlyoutOverview.mspx

  • You cannot connect because the logon method, you use is not allowed on this computer. Please, see your network administrator for more information.

    Whenever I enter my correct password in my windows account it rejects a message and it comes up saying: "you cannot connect because the logon method, you use is not allowed on this computer." See your network administrator for more information. "I can't seem to be able to enable or disable anything because the profile I'm using on my computer is the profile of"Guest ".

    Karima,

    Applicable to Windows 7.

    The following steps require administrator credentials.

    • Use the Windows + R or "Run" in the start menu, then type gpedit.msc.
    • Navigate to Computer Configuration > Windows settings > local policies > user rights assignment > consider all policies "prohibit the newspaper on" to check if your guest account is listed. Remove account from the list, and you should be fine to continue using your guest profile.

    Good luck.

    James

  • can not connect because the logon method, you use is not allowed on this computer.

    I have a new computer that is joined to the domain, but in trying to have a user login, I get the following error:

    can not connect because the logon method, you use is not allowed on this computer.

    The only way for him to connect is to change its parameters from the user to the administrator. I tried power users and other options and did not work.

    is there any solution for this?

    Hi Snidera,

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the TechNet Forums.

    http://social.technet.Microsoft.com/forums/en-us/category/w7itpro

    It will be useful.

  • No content found or you are not allowed to this component

    Hi all

    I was getting 'content not found or you are not allowed to this pane"in my site tree. But then I gave everything to my user and I am able to see the pages unplaced, but still don't see places pages.

    Can someone help me out here.

    Kind regards

    NJ

    I am able to solve the problem. To help others, just delete the files in your server temp folder and it will work.

  • Why the NDP module says "you are not allowed for this operation?"

    Hello world

    I hope you can help me with this problem!

    I'm playing with the NDP module has a message saying 'you are not allowed for this operation.

    This happens when I try to create a new project and try to open the window to select a project type. It also happens when I go to the ADMIN and add new types of projects?

    Is there a role limiting me or does some other underlying problem?

    Thank you in advance.

    Hello

    I think that you might miss an active project type category.

    Go to Admin-> NDP-> categories of project types.

    You must have at least one category that is active (which is indicated by a green check mark).

    Once at least one is activated, you will need to go to the Cache and rinse the taxonomy of cache (just to be sure, I would empty Admin Data Cache Group as well).

    Then you can go to the Admin and configure your project types.

    Let me know if you have any questions,

    Dmitriy

  • With the help of VM Workstation 8. error when restoring from instant snapshots are not allowed on this virtual machine.

    Hello

    I have takena instant and then try to turn on the machine and get a message:
    "Snapshots are not allowed on this virtual machine!

    When I try to start the snapshot form, I get an error:
    "snapshot restore error, snapshots are not allowed on this virtual machine.

    Can you please help?

    It seems that the configuration (.vmx) file has been deleted (zero byte). I recreated a new you have attached log files. Please replace the file corrupted with VMware Workstation (or at least tab of the virtual machine) closed in order to ensure that the replaced file gets read.

    André

  • recently I formatted my windows XP PC. after update to show that it does not allow the genuine.but when I brought it was authentic. I have the product key with me.Please,help help find the solution

    recently I formatted my windows XP PC. after update to show that it does not allow the genuine.but when I brought it was authentic. I have the product key with me.Please,help help find the solution

    Please visit http://www.microsoft.com/genuine/ and click the Validate Windows button, then restart your computer.

    If you were not able to validate, follow these steps:

    1. Download this diagnostic tool, save it to your desktop: http://go.microsoft.com/fwlink/?linkid=56062

    1B. double-click the executable file to run the tool.

    2. after running the tool, click the Windows tab, and then click copy in the Clipboard.

    NB: You can open a new file in Notepad, paste the contents of the Clipboard in it & keep for future reference.

    3 start a new thread in the following forum and paste the results of the WGA diagnostic data in a post detailing the problem: http://social.microsoft.com/Forums/en-US/genuinewindowsxp/threads

    4 Troubleshooting specialist will analyze the data and recommend an appropriate solution.

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • I can't use the link 'Check the seats' on Delta when I use Firefox, but Safari works fine. I get the message "not available at this time" when you use Firefox, but when I go on Safari it works just fine.

    I can't use the link 'Check the seats' on the website of Delta Airlines when I use Firefox, but Safari works fine. I get the message "not available at this time" when you use Firefox, but when I go on Safari it works just fine. I love Firefox but it sucks!

    This problem may be caused by corrupted cookies.

    Clear the cache and cookies from sites that cause problems.

    "Clear the Cache":

    • Firefox > Preferences > advanced > network > storage (Cache) offline: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Firefox > Preferences > privacy > Cookies: "show the Cookies".

Maybe you are looking for

  • Question on the percentage of meter works - M40X-119

    I have problem on the battery indicator, when I plug in AC, charge indicator power off batteries decreases too quickly to 7, but when it comes to 7, it does not change until about 2 pm. So there is no problem on my battery I think. No matter what sof

  • My PC play Blu-Rays?

    I plan to buy a Blu - Ray to my PC drive but I don't know if my PC can handle Blu - Ray. My PC Specs are:OS: Win Vista Business 32-bit SP2RAM: 2.0 GBPROCESSOR: Processor Dual Core T3400 2.17 GHz by heartVIDEO: nVidia GeForce 9400 M GSCREEN: display 1

  • Mobile Windows without reformatting.

    I recently had a very malicious virus attack my computer and it caused a near system failure.  A friend of the family is a certified technician computer and reformatted my computer for free.  However, in doing so, he reinstalled Windows on drive C an

  • Vista installation problems

    I have a Pavilion a6334f running Vista 32 bit.  I ran into problems with the Western Digital hard drive and replaced one in October and now do the same thing in December/January (replacement of WD drive showed error.).  I had HP recovery discs that I

  • Alignment error!

    Hi, I have a HP Photosmart C6380 all-in-one printer, scanner and copier.  For a while it did not work - repeatedly had "alignment error" on the screen.  But it would print, simply not good - as if it was out of ink.  So got more ink (replaced just bl