Cannot call member function on object type

On 8.1.6 I cannot call a member function from SQL in the way described in the manual.
The following example is almost copied from the manual:
create or replace TYPE foo AS OBJECT (a1 NUMBER,
MEMBER FUNCTION getbar RETURN NUMBER);
create or replace type body foo is
MEMBER FUNCTION getbar RETURN NUMBER is
begin
return 45;
end;
end;
CREATE TABLE footab(col foo);
SELECT col,foo.getbar(col) FROM footab; -- OK
select col,col.getbar() from footab; -- ERROR
The second select is the way it should be, but I get an error "invalid column name".
Using the first select, I get the result. This is strange because this is more or less the 'static member' notation (filling in the implicit self parameter myself).
Is this a known bug in 8.1.6, maybe fixed in later versions?

Konstantin,
Did you use loadjava to load the compiled class into the Oracle Database?
Regards,
Geoff
Hello!
I need to write a member function for object type with java.
for example:
create type test as object(
id number,
name varchar2(20),
member function hallo return number);
create type body test as
member function hallo return number
as language java
name 'test.hallo() return int;
create table test of test;
My java-file is:
public class test {
public int hallo() {
return 5;
select t.hallo() from test t;
It's does not run. Why?
I get always an error back. Wrong types or numbers of parameters!!
please help me.
thanks in advance
Konstantin

Similar Messages

  • How to call a function having OBJECT type as Return type

    Hi,
    I've the following function returning OBJECT type.
    Pease advice me how to call this function
    CREATE OR REPLACE TYPE GET_EMP_OBJ is object
       ( emp_name varchar2(50) ,
         mgr_id   number,
         dept_id  number
    CREATE OR REPLACE FUNCTION get_emp(P_emp_no NUMBER )
      RETURN GET_EMP_OBJ  IS
      t_emp_info GET_EMP_OBJ ;
      v_ename  EMP.ename%TYPE;
      v_mgr    EMP.mgr%TYPE ;
      v_deptno EMP.deptno%TYPE;
      v_ename1  EMP.ename%TYPE;
      v_mgr1    EMP.mgr%TYPE ;
      v_deptno1 EMP.deptno%TYPE;
    BEGIN
      FOR rec IN ( SELECT ename , mgr , deptno
                     FROM emp )
      LOOP
         v_ename := rec.ename ;
         v_ename1 := v_ename1||'|'||v_ename ;
         v_mgr   := rec.mgr   ;
         v_mgr1  := v_mgr1||'|'||v_mgr ;
         v_deptno:= rec.deptno;
         v_deptno1 := v_deptno1||'|'||v_deptno ;
      END LOOP ;
      t_emp_info  := GET_EMP_OBJ (v_ename,v_mgr,v_deptno ) ;
      RETURN t_emp_info ;
    EXCEPTION WHEN OTHERS THEN
      DBMS_OUTPUT.put_line ('Error'||SQLCODE||','||SQLERRM ) ;
    END;The above function got created successfully.
    And i'm confused how to call this functions. I tried like below but didn't work
    DECLARE
      t_emp_info_1  GET_EMP_OBJ ;
    BEGIN
       t_emp_info_1 := get_emp(7566) ;
       for i in 1..t_emp_info_1.COUNT
          LOOP
             DBMS_OUTPUT.put_line ('Values are'||i.emp_name ) ;
         END LOOP;
    END;  

    SQL> CREATE OR REPLACE TYPE GET_EMP_OBJ is object
      2     ( emp_name varchar2(50) ,
      3       mgr_id   number,
      4       dept_id  number
      5     );
      6  /
    Type created.
    SQL> ed
    Wrote file afiedt.buf
      1  CREATE OR REPLACE FUNCTION get_emp(empno NUMBER )
      2    RETURN GET_EMP_OBJ  IS
      3    t_emp_info GET_EMP_OBJ ;
      4  BEGIN
      5    begin
      6      select get_emp_obj(ename, mgr, deptno) into t_emp_info
      7      from emp
      8      where empno = get_emp.empno;
      9    exception
    10      when no_data_found then
    11        t_emp_info := new get_emp_obj(null,null,null);
    12    end;
    13    return t_emp_info;
    14* END;
    SQL> /
    Function created.
    SQL> set serverout on
    SQL>
    SQL> declare
      2    t_emp_info  GET_EMP_OBJ ;
      3  BEGIN
      4     t_emp_info := get_emp(7566);
      5     DBMS_OUTPUT.put_line ('Values are: '||t_emp_info.emp_name||', '||t_emp_info.mgr_id||', '||t_emp_info.dept_id);
      6  END;
      7  /
    Values are: JONES, 7839, 20
    PL/SQL procedure successfully completed.
    SQL>

  • Cannot call AS3 Function from JavaScript

    Hi,
    I am trying to call an ActionScript 3 function with JavaScript. The problem I cannot seem to get any of the browsers to trigger this AS3 function. The debuggers say that the function is undefined when I call it on the flash object. 
    What is supposed to happen is - the javascript function calls the AS3 function, and passes it an integer value.   That integer is then used to pull one of 20 swfs, and load that into the flash movie.
    Please let me know if you guys can think of anything that I can do to make this work!  I've been stuck for hours, and can't seem to make it happen.
    Here is my actionScript:
    import flash.net.URLRequest;
    import flash.display.Loader;
    import flash.external.ExternalInterface;
    var movies:Array = ["idle-ok.swf", "idle-good.swf"];
    // It first loads this "hello swf".
    var helloLoader:Loader = new Loader();
    var helloURL:URLRequest = new URLRequest("idleAvatar.swf");
    helloLoader.load(helloURL);
    addChild(helloLoader);
    var setAvatar:Function = loadAvatar;
    ExternalInterface.addCallback("callSetAvatar", setAvatar);
    // Then, this function should be called by JavaScript to load one of the other swfs.
    function loadAvatar(indx:Number){
        var url:URLRequest = new URLRequest(movies[0]);
        var ldr:Loader = new Loader();
        ldr.load(url);
        addChild(ldr);
    Here is my JavaScript:
    <script type="text/javascript">
    function callExternalInterface(val) {
              document.getElementById("loader").callSetValue(val);
    </script>
    Here is my embed code:
    <div>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="250" height="350" id="loader" name="loader">
    <param name="movie" value="loader.swf" />
    <param name="allowscriptaccess" value="always" />
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="loader.swf" width="250" height="350">
    <param name="allowscriptaccess" value="always" />
    <!--<![endif]-->
    <a href="http://www.adobe.com/go/getflashplayer">
    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
    </a>
    <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
    </object>
    </div>
    <a href="#" onClick="callExternalInterface(1)">CLICK</a>

    You don't appear to be calling any function in your actionscript.  The names between and within do not agree. 
    document.getElementById("loader").callSetValue(val);
    should be calling a function identified with the string "callSetValue" in your actionscript, but you only have a function identified with "callSetAvatar"  and the function associated with that on your AS3 side is specified to be setAvatar...
    ExternalInterface.addCallback("callSetAvatar", setAvatar);
    but you do not have a function named setAvatar, you have one named loadAvatar
    Here's a link to a tutorial that might help you to see how the functions are specified between javascript and actionscript using the ExternalInterface class.  It gets confusing so I suggest you copy the code to a word processing file so you can clearly highlight where they have the same language between them.
    http://viget.com/inspire/bi-directional-actionscript-javascript-communication

  • Can Evaluate function return object type

    Hi
    Evaluate function can be used to call db functions in OBIEE. I have a function which returns an object ( pl/sql table).
    Created a simple report in Oracle Answers and added following in one of the columns
    evaluate( 'get_ccid(%1)' as t_ccid , @{p_request})
    When I try to run this in Oracle answers, getting syntax error. If same function returns varchar or number it works well.

    evaluate( 'get_ccid(%1)' as t_ccid , @{p_request})Eakta, You syntax seems to be wrong here. What type of data your presentation variable contains here ?? You are saying its working fine with Number datatype..so can you try..somthing like below with some default value..
    EVALUATE('get_ccid(%1)',@{p_request}{2})
    OR
    EVALUATE('get_ccid(%1)' as varchar(250),@{p_request}{ABC})
    Also, refer
    Syntax for Evaluate function in OBIEE
    http://108obiee.blogspot.com/2009/04/using-presentation-variable-from-first.html
    Hope its useful

  • DB Adapter - Calling Stored Procedure with Object Type

    So, we are using JDeveloper 10.1.3.3
    We are trying to create an ESB process that invokes a SP with an object type. However, the owner of the package / SP, is NOT the owner of the object type. When going through the DB Adapter wizard, it gives us the following error:
    When attempting to use the DB Adapter in JDeveloper to create a partner link to execute a stored procedure. JDeveloper returns the following error:
    Unable to import WSDL.
    Error while writing wsdl file
    Database type is either not supported or is not implemented.
    Check to ensure that the type of the parameter is one of the supported datatypes or that there is a collection or user defined type definition representing this type defined in the database.
    However, if I create a wrapper package / SP, it works just fine. I'd really like to not be having to create wrapper code for these SPs to work. Is this resolved in 11g? Is there a patch available for 10.1.3.3?
    I think this is a JDeveloper Wizard issue, but thought I'd post this here as well.
    Thanks,
    BradW

    This problem can be resolved by granting execute permission on the object type to the caller. For example, if the stored procedure is in schema1 and the object type is in schema2 then you would connect as schema2 and execute
    SQL> grant execute on <object type> to schema1
    Referencing object types defined in other schemas is documented. This is the described method for accessing object types in other schemas.

  • Is it possible to call dll-functions with records/types as arguments?

    or must I use the fixed preselection of types

    LabVIEW must call DLLs with data types it is compatible. Therefore, you must use the types available through LabVIEW.
    I have two pieces of advice on this matter:
    First, contact NI and get their advice on how to call your data type. They may be able to offer a very quick solution.
    Second, if you cannot call these data types, and you have a compiler, I would suggest "wrapping" the DLL inside another, and 'translate' the data type from something LabVIEW can handle, to the type needed by your DLL in this 'wrapper' DLL.

  • Labview 6.0 cannot call ActiveX functions after upgrading to Teststand 2

    I'm running on Win2K on my development system. I have been running fine with Teststand ver 1.0.3 and Labview 6.0 with several VI's using ActiveX to work with the TestStand engine. I tried installing TestStand 2.0 (dated Aug 2001) next to 1.03 (not on top of it) to start upgrading and all those ActiveX VI's no longer functioned.
    NI's documentation says Teststand 2 installs the LV RTE 6.02 on the system and to run a "REPAIR" on the LV RT Server 6.02 if installing LV 6.0 after Teststand (not my case). I ran the "repair" anyway to no avail.
    I tried running NI's ActiveX example "Write Table to XL.vi" and it also does not run (Error -2147024891, "Access is denied.
    in Open Excel and Make Visible.vi->Wr
    ite Table to XL.vi"). I have run this before just fine.
    I've even tried re-installing LV 6.0 and re-running the repair to no avail, also mass compiling everything in site. Always the same error!
    Please help, anyone. My system is DOWN!.....

    We have not seen this exact problem before with TestStand 1.0.3, 2.0, and LabVIEW 6.0. If your system is still down, please give us a call and we can talk through getting everything working. You can make a phone support request online by going to Request Support and choosing "Phone NI" from the Communication Method Pull Down menu.
    Regards,
    Shannon Rariden
    Applications Engineer
    National Instruments

  • Linux: JS cannot call Applet functions

    I was wondering if anyone else has had this problem:
    Our platform is RedHat Linux 7.2 with Mozilla 0.9.7 and 0.9.8 as well as NS 6.2.1 (I have tried JRE 1.3.1_01 and 1.4 rc1)
    Whenever I load our applet in a frame and try to call the applet functions I get a JS error stating "Applet.xxx() is not a valid function"
    Loading the same applet in a standard page (no frames) works fine. Also the framed applet works fine on the windows platform.
    I'm guessing this is more of a Mozilla/NS problem that a Java problem, but I have foudn little information elsewhere and this forum seems to be filled with lots of great info.
    I have submited this as a Mozilla bug:
    http://bugzilla.mozilla.org/show_bug.cgi?id=121641
    The URL has case code examples.
    Thanks, Jesse

    If your applet requires a Java plugin, you have to realize that Netscape's LiveConnect has not been fully ported to JRE1.4 rc1 and neither Mozilla nor NN6.2.1 has its own JVM. Altho I have NN6.2, I seldom use it because it's still very buggy and extremely slow.
    V.V.

  • Object view  with nested table and member functions????????????????

    HI frds:)
    I need some help regarding writeing soem queries..
    I have to use view in retreving data and by useing member functions of object.
    1) i have to create a nested table by useing type object.
    2) i have to create a object wtih member functions inorder to create view of taht nested table,.
    3) by useing this objectt view and by useing methods i have to write soem queries ...
    If any one know or any information regarding this please reply me... as i have searched in net alot but i was unable to figure out..
    Thanks....

    // first createing object
    create type emp_det as object
    (empname varcahr2(20),start_date date,end_date date);
    // creating table of that object
    create table emp_detai_table as table of emp_det;
    // creating nested table
    create table empl (emp_no number,emp_detail emp_detail_table,dep_no number)nested table emp_detail store as s;
    //now i want to create view.. inorder to create view i need to create object. in that object i want to create methods.. these methods should work with date attributes..
    after creating object view i need to select or write some queries by useing member methods..
    This is the tast i have to perform.,. i have no materials ...if u have any link ..forward me..
    i have to do it as soon as possible..
    waiting for your reply...

  • Calling a Function Within a For-Each in Powershell

    Error:
    Unexpected token 'in' in expression or statement.
    At :line:1 char:22
    + ForEach-Object ($i in  <<<< $fs_size_info) { $i.Name.Name, GetGB($i.Sum)  }
    Code:
    foreach ($i in $fs_size_info) { $i.Name.Name GetGB($i.Sum) }
    If I omit the function from inside this foreach, it works perfectly, and I can access $i.Sum within the foreach as well. The problem arises when I try to call a function from inside the foreach. GetGB simply returns a more readable format e.g. GetGB(1024)
    will return "1 K" etc...
    I don't understand what I'm doing wrong, unless you cannot call a function inside a foreach statement.... am I missing something?
    Thanks

    The code you've posted and the error message don't seem to go together, unless the line before that "foreach" keyword happens to have ended with a pipe character.  There's a difference between how you use the foreach statement (help about_Foreach)
    and the ForEach-Object cmdlet (help ForEach-Object).
    Either way, it looks like inside the loop body, you've got two statements:  ($i.Name.Name) and (GetGB($i.Sum).  Those statements need either a line break or a semicolon between them.

  • Using an external DLL with "Call Library Function"

    Hi!
    I am trying to use an external DLL which is used from Visualbasic & Delphi:
    http://www.keb.de/common/tools/KEBCOMDriver.zip
    the protKEB.dll accesses the serial port to control an KEB frequency
    inverter.
    Unfortunatly there is no prototype header file for the DLL (no help on that
    from KEB).
    I only have a VisualBasic example program which works with the DLL.
    (Unfortunatly I am no Visual basic expert)
    To initialize the com port I have to use the function: setprotproperties &
    getprotproperties
    they are declared as:
    'Setting the protocol properties
    'ctrl is a pointer to a data structure of type tProtProperty
    Declare Sub setprotproperties Lib "protkeb.DLL" (ctrl As Any)
    'Reading the protocol properties
    'ctrl is a pointer to a data structure of type tProtProperty
    'the desired protocol is entered in ctrl.prottype before calling
    Declare Sub getprotproperties Lib "protkeb.DLL" (ctrl As Any)
    and tProtProperty is:
    Public Type tProtProperty
    ProtType As Long 'Type of Protocol (tProt)
    TimeOut As Long 'ALL protocols
    Baudrate As Long 'ANSI, HSP5
    Comport As Long 'ANSI, HSP5
    Flag As Long 'ANSI, HSP5: 01 = Sendslow
    / IP: 01 = UDP
    Port As Long 'IPort number
    Txtlen As Byte 'IP : length of following
    text or 0
    txt As String * 100 'IP : IP-Address or name
    (maximum length)
    End Type
    I already tried to use a cluster with tProtProperty entries as an Input for
    the function
    setprotproperty in a call library function with:
    Parameter Type : Adapt to type
    Data Format: Pointer to Handle
    but I always get an "exception within external code....."
    What am I doing wrong?
    How does a cluster & a "call library function node" look like that works?
    Any help is really appreciated!
    thanks
    tom
    ,-Thomas Kerberger Physikalisch-Technische Bundesanstalt-.
    | Abbestr.2-12 D-10587 Berlin fon: +49-30-3481338 |
    | mailto:[email protected] fax: +49-30-3481386 |
    `--------Labor 7.33 Messung thermischer Energie---------'

    Thomas,
    LabVIEW cannot call a DLL that has structures directly, you will need to create either a wrapper DLL or CIN that will take in all of the data individually construct the structure, and send it to the DLL function.
    For more information on what a cluster looks like in native code, I would suggest creating a simple cluster, creating a Call Library Function Node on the block diagram with a cluster input. Then right-click on the Call Library Function Node and choose "Create .c file". This will generate the data structure for the cluster and give you a better feel for it. I would then suggest going to the Using External Code in LabVIEW manual that can be found in the LabVIEW Bookshelf (Start»Programs»National Instruments»LabVIEW 6»LabVIEW Manuals or »LabV
    IEW 6.1»Search the LaBVIEW Bookshelf).
    There is also the following: Developer Zone: Passing a Variety of Data Types from DLL to LabVIEW.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Calling a Function Pool inside a Class

    Hi,
        I want to call a Function Pool inside a Class Method. I am getting an Error that 'Report or Program Statement already exists' when I call the function pool in the method. can anybody help me on how to call a Function Pool inside a class method.

    Hello Krish
    Based on your error description I assume that you have tried to "insert" the function pool program (e.g. function group ZFUNC -> SAPLZFUNC) into your class.
    You cannot do that. The explanation for the error message is a following:
    - The class contains already a program statement (CLASS-POOL). If there is somewhere in the class an additional program statement (e.g. FUNCTION-POOL) you will get the error.
    In addition, you cannot "call" a function pool. Instead you can always call the function modules of your function group.
    Regards
      Uwe

  • Calling supply function

    Hi
    Can we call supply function explicitly in any other method of the view using wd_this->supply function name( ) ?.
    In case the supply function is local to the view and when it is defined in component controller ?

    hi vishal........
          you cannot call supply function explicitly.......
          what you can do is.... invalidate the node that has the supply function. so the supply function will be called again.
    ---regards,
       alex b justin

  • Getting a error when Muse Website is viewed in browser:MuseJSAssert: Error calling selector function

    Every time I open any  .html  file in a browser I recieve this error message; MuseJSAssert: Error calling selector function: TypeError: Object does'nt support property or method 'museMenu'

    I have a similar problem that seems to have come up since the latest upgrade. My error is:
    "JavaScript Alert
    MuseJSAssert: Error calling selector function:SecurityError:Blocked a frame with origin "null" from accessing a cross-origin frame."
    The strange part for me is that there's no error at all when using File>Preview Page in Browser. I only get the error when I File>Export Page as HTML and then try to view the output.
    I can post a zip file of the HTML output to Adobe, but not publicly. Also, where is the Preview Page stored? If I don't get error on that, why can't I just use that as my HTML output?
    Thanks!

  • Calling Methods from Business Object BUS2032

    Hi all,
              Is it possible to call methods from the Business Object BUS2032.
       If so, how can it be done?? 
    Regards,

    Hi Marv,
    you sure can. Here is an extract from the SAP Help. I found it at http://help.sap.com/saphelp_46c/helpdata/en/c5/e4ad71453d11d189430000e829fbbd/frameset.htm
    <b>Programmed Method Call</b>
    Call (fictitious) method Print of object type VBAK (sales document). The method receives the parameters Paperformat and Printertype as input.
    * Call method Print of object type VBAK
    * Data declarations
    DATA: VBAK_REF TYPE SWC_OBJECT.
    SWC_CONTAINER CONTAINER.
    * Create object reference to sales document
    SWC_CREATE_OBJECT VBAK_REF 'VBAK' <KeySalesDoc>
    * Fill input parameters
    SWC_CREATE_CONTAINER CONTAINER.
    SWC_SET_ELEMENT CONTAINER 'Paperformat' 'A4'.
    SWC_SET_ELEMENT CONTAINER 'Printertype' 'Lineprinter'.
    * Call Print method
    SWC_CALL_METHOD VBAK_REF 'Print' CONTAINER.
    * Error handling
    IF SY-SUBRC NE 0.
    ENDIF.
    Cheers
    Graham

Maybe you are looking for

  • Creating Iweb seperate domains for multiple sites DIDNT WORK

    Hi! Any help would be much appreicaited! I am creating mutiple websites in iWeb 09'. All 3 of my websites have been stored under 1 domain file on my mac. I have read numerous discussion boards stating the steps of how to seperate each of the created

  • RFC Error in Webdynpro Abap...

    Hi,    Im Using one FM SRM_DOCUMENT_CHECKIN_VIA_FILE...Inside that Fm it is usng some RFC Connection..while debugging Im  getting an internal error in the FM as 'RFC server sapftp cannot be started - 1: Program no longer started via RFC'...    Can An

  • When i plug my iphone in to my laptop it does not show up in devices

    i have tried to plug my iphone in to my laptop and download a memo.  however, my iphone does not show up in the devices.  any thoughts on the glich?

  • Need help printing pagefooter conditionally based on page number

    In the layout I'm working on, there is a <?call:footer?> in footer section. I want to avoid call it for certain pages. Eg. not print it on the first page. Is there a page-variable available that can be used to conditionally test and print this? (in e

  • FORM & encodeURL - can it be done?

    I can't find an answer to this on the forum but it seems like it would be a very common problem. How do you encodeURL from a FORM? It's straightforward from an A REF but how do you pass the session id when the only obvious information sent to the ser