ORA-22806: not an object or REF on the reserved word FROM, how to debug?

I am honestly confused on this one...
When I run the following in sqlplus:
SQL> SELECT a.fname, a.lname
FROM h_user_m a
WHERE a.id IN
(SELECT UNIQUE m.user_id
FROM h_user_role m
WHERE m.role_id =
(SELECT UNIQUE id
FROM h_role_n
WHERE LOWER (name) = 'wc-ismp-admin')
OR m.role_id =
(SELECT UNIQUE id
FROM h_role_n
WHERE LOWER (name) = 'wc-ismp-user'))
AND a.id NOT IN (SELECT user_id
FROM ip_user);
ERROR at line 2:
ORA-22806: not an object or REF
I run the same query in Toad for Oracle v9.7.2.5 and it returns the same error, but highlights the reserved word FROM. I googled the error, but I'm not for sure why the reserved word FROM would be causing the error?

Thank you for the quick response.
I tried your query and I still receive the same 'ORA-22806: not an object or REF' error & in Toad, it does highlight the reserved word FROM.
Oddly enough, I went back and ran the first sub-query from both of our SQL statements and no errors returned.
Only when I added the sub-query back to the main query I receive the error as mentioned.
So, the following worked:
select m.user_id
from h_user_role m
where m.role_id in
(select id
from h_role_n
where lower (name) = 'wc-ismp-admin'
or lower (name) = 'wc-ismp-user'
minus
select user_id
from ip_user)
but added back to:
select a.fname, a.lname
from h_user_m a
where a.id in(...)
The error returns - the same steps apply to my statement as well...
Looking at the 10g Release 2 (10.2) documents, I don't see any restrictions to the IN reserved word, in terms of number of sub-queries, etc...

Similar Messages

  • PL/SQL: ORA-22806: not an object or REF  when Using Record in Package

    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0
    I have declared a record type in my package
    create or replace
    PACKAGE MYPKG AS
      TYPE MYREC IS RECORD (VAL1 varchar2(20), val2 date);
      PROCEDURE display_error (pSQLERRM number);
      PROCEDURE P_LOAD_DATA (pStartDate Date, pEndDate Date);
      FUNCTION  F_EPI(refno1 in NUMBER,  refno2 in NUMBER) return MYREC;
    END MYPKG;
    --In My Package Body
    FUNCTION  F_EPI(refno1 in NUMBER,  refno2 in NUMBER) return MYREC is
            F_param MYREC;
            BEGIN
            select myvarchar2, mydate into MYREC from MYTable
              where myrefno1 = refno1
              and myrefno2 = refno2
            Exception
              when others then
              display_error(SQLERRM);
              RETURN F_param;
            END F_EPI ;
      PROCEDURE P_LOAD_DATA (pStartDate Date, pEndDate Date) IS
    insert into atable(myvarchar, mydate)
    select F_EPI(refno1,refno2).val1,F_EPI(refno1,refno2).val2 from tab2;
    END P_LOAD_DATA;
    I get errors
    Error(187,7): PL/SQL: SQL Statement ignored
    Error(225,7): PLS-00382: expression is of wrong type
    Error(225,7): PL/SQL: ORA-22806: not an object or REF
    When I compile the package.
    When I try to call the function from SQL I get an Invalid datatype error.

    Hi,
    Before posting any query/plsql blocks, please ensure that you have written it clean and complete with less syntax errors. ( at least general syntax errors, you can avoid). Then somebody can have an interest to check your logical error.
    About your posting, refer below solution step-by-step. It may help you, about what you are looking for? By the way, you must be knowing, what you are going to to do with. I haven't concentrated about your requirement; as it was not missing in your posting.
    drop table test;
    create table test(myvarchar varchar2(20), mydate date);
    create or replace
        package mypkg as
          type myrec is record (val1 varchar2(20), val2 date);
          --procedure display_error (psqlerrm in number); -- if you are passing sqlerrm, then parameter needs to be string type
       procedure display_error (psqlerrm in varchar2);
          procedure p_load_data (pstartdate in date, penddate in date);
          function  f_epi(refno1 in number,  refno2 in number) return myrec;
       end mypkg;
    Package created.
    --in my package body
    create or replace 
    package body mypkg as -- added
    procedure display_error (psqlerrm in varchar2) -- if you are declared a proc/func in spec, it needs to define in pkg body
    is
    begin
         null; -- you should know, what to do here
      dbms_output.put_line('Err -'||sqlerrm);
    end display_error;
    function  f_epi(refno1 in number,refno2 in number)
    return myrec
    is
    f_param myrec;
    begin
       -- select myvarchar2, mydate into MYREC from mytable
      --  where myrefno1 = refno1
      --  and myrefno2 = refno2;
        select ename, hiredate into f_param from emp -- added demo logic by using emp
        where empno = refno1
         and  mgr  = refno2;
        return f_param;  -- added
    exception
       when others then
         raise; -- if you are using OTHERS then, just raise it
       display_error(sqlerrm);  
       --return f_param; -- what is this?
    end f_epi;
    procedure p_load_data (pstartdate in date, penddate in date) -- you must be knowing the use of 2 params ???
    is
        v_rec myrec; -- added
    begin -- Added
       --insert into atable(myvarchar, mydate)
      -- select f_epi(refno1,refno2).val1,f_epi(refno1,refno2).val1 from tab2;
       -- demo logic added with static params to call f_epi
       v_rec:= f_epi(7499,7698);
       insert into test values v_rec;
        --null; 
    end p_load_data;
    end mypkg;
    Package body created.
    SQL> exec mypkg.p_load_data(null,null);
    PL/SQL procedure successfully completed.
    SQL> select * from test;
    MYVARCHAR            MYDATE
    ALLEN                20-FEB-81
    Thanks!

  • ORA-22806: not an object or REF

    Hi!
    My query encountered error:ORA-22806: not an object or REF.
    select LOGINNAME from (
    select ID_.LOGINNAME
    from TEST_IDENTIFICATIONDEVICE ID_
    join TEST_CONTRACTPARTNER CP
    on (CP.ID=ID_.ID_PERSON)
    join TEST_CONTRACT gc on (gc.ID_PARTNER=CP.ID)
    inner join car_reflists cr on (EXTRACTVALUE(gc.XMLEXTENSION,'/data/shop-identification')
    = cr.listitemid)
    where loginname like '%pos%'
    But inlined SELECT works Ok. Please help me to solve this problem. Thank you in advance.

    Is any of the object in "inlined SELECT" a view? Is the view doing another EXTRACT?

  • ORA-22806 not an object or REF, Query for XMLType

    Hi,
    i am using this query :
    select centre||compte, sum(cout) from (
    SELECT o.INDICE_CENTRE as centre, substr(o.champs.extract('//compte/text()').getStringVal(),1,8)
    as compte,to_number(substr(o.champs.extract('//cout/text()').getStringVal(),1,17)) as cout
    FROM canevas o)
    group by centre||compte;
    i have got this error ORA-22806 not an object or REF.
    any sugestion please?

    Problem resolved.

  • ORA-22806 : not an object or reference in 10gRel2

    Hi,
    We have recently successfully upgraded our oracle 8i database to 10.2.0.1
    database is up and running fine, but
    one of the user created procedure is giving error as below :
    ORA-22806 : not an object or reference
    See the below code :
    =============
    v_cnt:=0;
    Check_Str := 'SELECT COUNT(*) FROM P_EMP_HOLIDAY_DATE
    WHERE company_id=:p_Comp_id
    AND branch_id = :rec_branch.branch_id
    AND employee_id =:rec_emp.employee_id
    AND :v_nxt_date IN holiday_date';
    EXECUTE IMMEDIATE Check_Str INTO v_cnt USING p_Comp_id,rec_emp.branch_id, rec_emp.employee_id,v_nxt_date;
    Put_Any_Line('v_cnt : ' || v_cnt);
    when we run the procedure it gives the error at line 186 .i.e the line with EXECUTE IMMEDIATE statement in above
    so where is the problem ?
    this procedure was running fine without any problem in our oracle 8.1.7.0 version now showing error in 10.2.0.1
    is there any syntax problem that is not being suported in the upgraded version i.e. 10.2.0.1
    how to get it solved ?
    As this is very urgent to solve so any immediate support would be appreciated.
    with regards

    What is Put_Any_Line ? Why are you using dynamic sql here ?
    As this is very urgent to solve so any immediate support would be appreciated.Ok, then please, do not hesitate to use the Oracle support, and see how it can be immediate support.
    Nicolas.

  • Error: JNI does not require stubs, please refer to the JNI documentation.

    Hi
    Using JNI I need to call the JAVA methods..
    i am following the tutorial that is given below..
    http://docs.rinet.ru/JavDev/ch19.htm#BuildingNativeMethodsforWindows95N
    but when i am trying to execute the javah -stubs UserExample
    i am getting an error like the below
    Error: JNI does not require stubs, please refer to the JNI documentation.
    Someone can explain how to solve this problem....
    Thanks
    Ram.K.Maddela
    [email protected]
    93827 39948

    Wow, that tutorial is many years out of date. What it describes it totally obsolete. Ignore it.
    I suggest you restart by reading this book:
    http://java.sun.com/docs/books/jni/

  • HT1925 Can't update iTunes because of error message "iTunes.msi is not a valid installation package for the produce iTunes".  How can I fix this?

    I can't update iTunes because of error message "iTunes.msi is not a valid installation package for the product iTunes". How can this be resolved.  I am using a PC with Windows XP

    If you can, uninstall and reinstall itunes..... Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    Hope this helps.

  • I recently updated to the OSX 10.8.3 Operating Sistem.  I am writing a book and now cannot open any word document I've created.  Could not find a newer version of the Microsoft Word Processing Program.  Is Pages the next thing? Can I recover my documents?

    I recently updated to the OSX 10.8.3 Operating Sistem.  I am writing a book and now cannot open any word document I've created with the old system.  Could not find a newer version of the Microsoft Word Processing Program.  Is Pages the next thing? Can I recover my documents?  How?

    I'm in the same boat: new to OS X and Mac, and in the middle of a book. I switched because I heard about the the ease of using Mac, but so far, for me, it's been a nightmare. I bought 2011 Office Mac and hate everything about it, the most recent being the inability to open or cut or paste any of my original word files. I understand that this could have easily been done with earlier versions, but not Mountain Lion (which I learned is what OSX is.) Since I work with language, I am amazed at the assumptions of the Apple community. It helps to use common language and explain even the basics.  
    So all the helpful hints to use the latest version of Office Mac are to no avail. Now what?

  • I am changing from an iphone 3 to an iphone 3g and i was not offered an option to restore the new device from a backup of the old device - how do i reset the new device to do this?

    i am changing from an iphone 3G to an iphone 3GS and i was not offered an option to restore the new device from a backup of the old device - how do i reset the new device to allow me restore the data from the old one to the new one?

    Go to Settings>General>Reset>Erase All Content and Settings.  This will return it to its new out of the box condition.  Go through the setup screens again and you will be given the option to restore from a previous iTunes or iCloud backup (see http://support.apple.com/kb/HT2109).

  • ORA-22979: cannot INSERT object view REF or user-defined REF

    I'm getting this error when trying to insert a parent_type object into an object table. The parent object contains a nested table of parent object references.
    CREATE TYPE cl_ArgList AS TABLE OF REF cl_Expression
    CREATE TYPE cl_Expression AS OBJECT (
    args cl_ArgList;
    Somehow the system-generated parent object REF that is returned from one STATIC function (using MAKE_REF) turns into a incompatible REF by the time it is passed to aother STATIC function and used in the constructor of the nested table for a new args instance.
    Does anybody know how this might be happening?
    Is there any way to test if a REF is a valid system-generated REF vs. a user-defined REF?
    I don't even know what a user-defined REF is, how I might be getting one, and what's wrong with it anyway. Shouldn't strong-typing ensure that the REF is okay if it is of the appropriate type?
    Glenn.

    Okay, solved that.
    FYI the problem is that the nested table arguments (REF cl_Expression) have to be SCOPED REFs, ie. constrained to refer only to objects in a particular table (although I don't really understand why).
    Then of course the trick is how to constrain the arguments in the nested table, because you can't do it in the CREATE TYPE statement. You also can't do it when you create the containing table, when you define how the nested table is stored:
    CREATE TABLE <containing table> OF cl_Expression (
    NESTED TABLE args STORE AS t_args
    Instead you have to modify the nested table properties after it has been created:
    ALTER TABLE t_args ADD (SCOPE FOR (column_value) IS t_Induhvidual);
    'column_value' is the actual syntax, not your own column name.
    But you probably knew that ;-)

  • How to refer to the same JComboBox from object from different panels

    Dear All, i have a question which i could not solve for a past one week.
    In my program i have three panels. In the first panel i have created JComboBox component and throught textfield i add values to it. In my other two panels i make a reference to the JComboBox object which is in my first panel, so that whenever i enter values to it, the same values must be visibile in the other references in second and third panel comboboxes my problem is:
    1. In my second panel JComboBox component reference doesnot appear at all
    2. Can we refer to the same swing component or can we add same swing component in several places
    2.1 If not how to make notify other reference objects when referee' s object state changes.
    thank you in advance

    I'm not PhHeid, but then neither is PhHein.
    Read the API for DefaultComboBoxModel and you'll find how to construct and to modify the state of your model.
    Read the API for JComboBox and you'll find there's a constructor which takes a model as an argument.
    Pass the same model to the constructors of all the JComboBoxes.
    db

  • RMI call back - How to refer to the client project from the server project?

    Hi, I am working on an RMI assignment which basically needs me to use the RMI call back for the server to notify the clients.
    I have 2 projects , one for the client and another for the server.
    In the client project, I have a client interface and the main client class implements this interface.
    In the server project, I have a server interface and a class that implements this interface.
    I can use the server interface in the client project's code by adding the server project in the path of the client project. it lets me use the server interface in the code if I put "import.." statement.
    But the issue is I can not do the same to access the client interface from within the server project's code. Since that will be a circular reference, the compiler does not let me use the client interface from within the server's code. This is putting me in a great difficulty and I am stuck here. What should I do so that I can use the client interface and the compiler won't complain?
    Thanks for any help..
    Regards.. js

    Let me explain what I tried: I manually generated stub class of the client using the Eclipse IDE as mentioned in my previous message. The StockMSClient_Stub.class got created in my client project.
    The common project has the 2 interfaces - one from the client and one from the server.
    I have added reference to the common project from the client and server projects to use the interfaces.
    With the above mentioned in place, when I run the server project, the registry binding of the server objects is very fine. But I am getting error in the applet at the line where I am passing the client object to the method provided by the server interface. The following is the code snippet in the applet where I am getting the error.
    specifically the line: String response = objs.login(userId, password, smsClient);     ====================
    public void login() {
                Registry reg = null;
                String userId = "test";
                String password = "test";
                this.smsClient = new StockMSClient();
                try {
         reg = LocateRegistry.getRegistry(rmiHost,rmiPort);
                          UserInterface obj = (UserInterface) reg.lookup(rmiStrings
                                                                                                                        [1]);
         User u = obj.find(userId);
         if (u == null) {
              System.out.println("This user is not valid");
         } else {
                         UnicastRemoteObject.exportObject(smsClient);
         reg = LocateRegistry.getRegistry(rmiHost, rmiPort);
         LoginLogoutInterface objs = (LoginLogoutInterface) reg
                                   .lookup(rmiStrings[0]);
                        //getting error at the following line.
                        String response = objs.login(userId, password, smsClient);     
                         System.out.println("response :" + response);
               } catch (AccessException ae) {
                       System.out.println(ae);
               } catch (NotBoundException nbe) {
                      System.out.println(nbe);
               } catch (RemoteException re) {
                      System.out.println(re);
    } //end login()====================
    Error is:
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
         java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
         java.lang.ClassNotFoundException: sms.rmi.graphics.StockMSClient_Stub (no security manager: RMI class loader disabled)================
    I don't know why this is happening..Please help.
    thanks & regards, js
    Message was edited by:
    jsitaraman

  • Refer to the document class from another class?

    There is a function in my document class that I need to call from inside another class. How can I call myFunction from inside OtherClass? Or refer to myVariable from inside OtherClass?
    package {
    import flash.display.Sprite;
    public class DocumentClass extends Sprite {
    public function DocumentClass():void {
    _init();
    private function _init():void {
    var myVariable:int = 0;
    function myFunction():void {
    //The function I need to access
    var myClass = new OtherClass();

    There's many ways to do it. On a case by case basis a strategy has to be chosen.
    In your case, is there literally just one child class that's trying to ask the root class to run the function? Are a bunch of other classes also trying to get at this same function? Flesh out a really good description of what you want to do for a few suggestions.
    For fun I'm going to assume other classes may want to call this function and at the same time be really simplistic in the approach by assuming the project is simple and bubbled events won't hurt performance. It doesn't sound like this is a particle situation.. In that case I'd send a simple bubbled event Main can read.
    e.g.:
    Main:
    package
      import flash.display.Sprite;
      import flash.events.Event;
      public class Main extends Sprite
           private var _a:Sprite;
           public function Main():void
                addEventListener(Event.ENTER_FRAME, onEF);
           // Called from BClass after added to stage (for event to propagate)
           public function SomeFunction():void
                // now that this is called, do what you want..
                // I'm just going to remove _a (for no special reason)
                trace("Main.SomeFunction() - called, removing _a (_b will GC eventually as well)");
                removeChild(_a);
                _a.removeEventListener("OMGEvent", _handleOMGF);
                _a = null;
           private function onEF(e:Event):void
                removeEventListener(Event.ENTER_FRAME, onEF);
                trace("Main.onEF() - Instantiating AClass");
                // instantiate a new child, which also will load a child
                _a = new AClass();
                // listen for events bubbling
                _a.addEventListener("OMGEvent", _handleOMGF);
                // add to stage
                addChild(_a);
           // listen to _a to invoke function
           private function _handleOMGF(e:Event):void
                trace("Main._handleOMGF() - child sent OMG to Main, running Main.SomeFunction()");
                SomeFunction();
    AClass:
    package
           import flash.display.Sprite;
           import flash.events.Event;
           public class AClass extends Sprite
                private var _b:BClass;
                public function AClass():void
                     addEventListener(Event.ADDED_TO_STAGE, _onAddedF);
                     addEventListener(Event.REMOVED_FROM_STAGE, _onRemovedF);
                private function _onAddedF(e:Event):void
                     removeEventListener(Event.ADDED_TO_STAGE, _onAddedF);
                     trace("AClass._onAddedF() - Instantiating BClass");
                     // first child on stage, load second child, which
                     // after it hits the stage will dispatch an event
                     _b = new BClass();
                     // we'll listen here for the event just for fun
                     _b.addEventListener("OMGEvent", _handleOMGF);
                     // trigger the ADDED_TO_STAGE
                     addChild(_b);
                // listen to _b just for fun
                private function _handleOMGF(e:Event):void
                     trace("AClass._handleOMGF() - Just heard OMG!");
                // clean up
                private function _onRemovedF(e:Event):void
                     removeEventListener(Event.REMOVED_FROM_STAGE, _onRemovedF);
                     removeChild(_b);
                     _b.removeEventListener("OMGEvent", _handleOMGF);
                     _b = null;
                     trace("AClass._onRemovedF() - I cleaned up");
    BClass:
    package
          import flash.display.Sprite;
           import flash.events.Event;
           public class BClass extends Sprite
                public function BClass():void
                     addEventListener(Event.ADDED_TO_STAGE, _onAddedF);
                private function _onAddedF(e:Event):void
                     removeEventListener(Event.ADDED_TO_STAGE, _onAddedF);
                     trace("BClass._onAddedF() - Created, dispatching 'OMGEvent' with bubbles");
                     // dispatch (I extend Sprite, it supports events)
                     // Note: I set bubbles to true to bubble back to Main (default is false)
                     dispatchEvent(new Event("OMGEvent", true));
    For ease, Example Source (saved down to CS5).
    All parents of that child will receive the dispatched event. To use that tactic you'd need to be sure your event is unique (hence using 'OMGEvent') and not have a fiercly complex display list because all those parents of this child will receive this event as well. I find in 99% of the non-particle usage of this, it really just doesn't matter. It's quick and simple.
    If you wanted to really direct it rather than bubble, you'd just remove the 'true' parameter from the dispatchEvent() and then each parent of that child would need to be told to listen for the event so it can keep relaying it up the display chain.
    I do the latter quite often when a child affects the display of each parent in some way all the way up the display list, capturing custom events at each level, doing what's necessary.
    Trace:
    Main.onEF() - Instantiating AClass
    AClass._onAddedF() - Instantiating BClass
    BClass._onAddedF() - Created, dispatching 'OMGEvent' with bubbles
    AClass._handleOMGF() - Just heard OMG!
    Main._handleOMGF() - child sent OMG to Main, running Main.SomeFunction()
    Main.SomeFunction() - called, removing _a (which marks _b for cleanup as well)
    AClass._onRemovedF() - I cleaned up
    Man, Adobe really needs to get a <pre lang="as3"> with some color coding/formatting.

  • HT5824 hi..i m not sure if i have used the icloud before..how do i know if my iphone has been backed up by icloud?

    hi....i m very blur at this...not sure if i have used icloud before...how do i know if my iphone has been backed up ?
    it all happened 2 days ago when my iphone lost everything after updating to ios7. I couldn't even restore back up even i have done my back up before updating...
    just trying my luck here , if anyone can help he to retrieve my photos and notes.

    Access iCloud.com on a computer to check
    http://support.apple.com/kb/PH2702
    Lost or Stolen iOS device  >  http://support.apple.com/kb/HT5668

  • Undefined is not an object error when using the Output Generator with Glossary Restyling script to create WebHelp

    When I use the Glossary Hotspot Wizard to create links within my topics to the terms, I then generate the project using the script (because I want to use popups instead of having the text display in-line). I did not edit this script before running it - do I need to? If so, where does the script reside? Any suggestions would be appreciated so that I can get this working as intended :-).

    The error occurs during the WebHelp generation. If I generate the project
    without using this script, there is no error.
    The error indicates
    Line no: 395
    Thanks!
    Julie
    Julie Haddon-Cook
    Senior Specialist
    Messaging Engineering   
    Direct:      +1 770 303 3507
    CVS:         224 3507
    Address:   SITA | 3100 Cumberland Blvd | Atlanta, GA 30338 | USA
    Website:   www.sita.aero

Maybe you are looking for

  • Can't run Ableton Live 8 as slave with Logic 9 in 64bit (Melodyne error)

    Hi, Just downloaded Melodyne Editor 2.01 and installed on Mac Book Pro and iMac. I loaded Logic 9 in 64bit and then Ableton Live 8 as a slave. I was met with the following message: An error has occurred while opening "Melodyne singletrack" via ReWire

  • Bookmarks in webhelp generated from Framemaker

    Hi all We're using the trial version of Framemaker 12 as part of the TCS5 suite. I've been experimenting with the Publish pod to create WebHelp and am wondering how to specify which Framemaker headings appear in the Webhelp TOC? I thought it might us

  • 100% CPU usage

    Hello Every one, Users are complaining CPU is using 100% on the server with some process? How do we check which is using most of the CPU? What made them feel it that way?

  • Objects Used

    Hello, I have a  bunch of infoobjects and I want to know if they are being used in queries? how can I? thanks

  • Urgent help plz plz plz plz..........

    i 4got the  security key guard  of  nokia3110..i cant use it now..plz help me 2 unlock.... i hope sum1 reply soon