Ever used the Designer Table API (TAPI) with object type in the DB?

Hi all,
We are trying to generate the Oracle Designer table API of a table that has a column defined by an object type. It works without problems if that column always has a value (is instantiated in object term). The problem is when we update a row where the column is null (all attributes of the object are null thus the object is not instantiated).
The "before update row" trigger of the Table API fails with error "ora-30625-method dispath on NULL SELF argument is disallowed".
The code that fails is the following:
cg$ind.TFO_DESCRIPTION :=(:new.TFO_DESCRIPTION IS NULL AND :old.TFO_DESCRIPTION IS NOT NULL )
OR (:new.TFO_DESCRIPTION IS NOT NULL AND :old.TFO_DESCRIPTION IS NULL)
OR NOT(:new.TFO_DESCRIPTION = :old.TFO_DESCRIPTION) ;
In this example, cg$ind.TFO_DESCRIPTION is a boolean and the TFO_DESCRIPTION column is based on an object type.
Thanks for any feedback or suggestions

For a solution to this problem: I set down to write a relatively simple and small piece of code that we can use as post compiler or post generator. After we generated one or more TAPIs, we can run this post compiler to remedy the problem the TAPI has with Merge operations. The post compiler will fix the PL/SQL inside the database. It reads the TAPI objects using dbms_metadata, makes the simple change by manipulating the PL/SQL source and then recreates the objects using execute immediate. Using this post compiler, it takes but a few seconds to fix the merge flaw in all TAPIs in your application.
http://technology.amis.nl/blog/index.php?p=842

Similar Messages

  • Ever used the Table API (TAPI) with object type in the DB?

    Hi all,
    We are trying to generate the table API of a table that has a column defined by an object type. It works without problems if that column always has a value (is instantiated in object term). The problem is when we update a row where the column is null (all attributes of the object are null thus the object is not instantiated).
    The "before update row" trigger of the Table API fails with error "ora-30625-method dispath on NULL SELF argument is disallowed".
    Any of you guys made it work? If so, how?
    Thanks

    user8879206 wrote:
    Hi friends,
    I have a procedure with object type IN OUT parameters which is used for fetching status. We are calling this from Java. But I want to call it from oracle for testing purpose. I am trying from my end but not able to do it as of now. This is the first time I am dealing with object type.We need more information. What is wrong? Your code looked okay and you did not mention any Oracle errors. What is happening that should not be or not happening that should be?
    You can call the procedure with a simple call in PL/SQL but will not be able to use it in SQL because 1) it is a procedure and 2) it has an OUT argument. A sample call should look something like (untested)
    declare
       x rec2;
       y rec3;
    begin
      --use the arguments rru was defined with as the arguments in the same order: types rec2 (x), rec3 (y)
      rru(x,y);
    end;>
    Any help would be appreciated.
    Details are given below.
    CREATE OR REPLACE TYPE REC1 AS OBJECT
    (RELAY_USAGE VARCHAR2(30)
    ,STATE VARCHAR2(1)
    TYPE REC AS TABLE OF REC1;
    CREATE OR REPLACE TYPE REC2 AS OBJECT
    (GSRN VARCHAR2(18)
    ,METERING_POINT_NAME VARCHAR2(80)
    ,RELAYS REC)
    CREATE OR REPLACE TYPE REC3 AS OBJECT
    (INFO VARCHAR2(2000)
    ,STATUS NUMBER
    PROCEDURE RRU(
    rcRelayControl IN OUT REC2
    , rcResp IN OUT REC3)
    IS
    BEGIN
    APKG.GetDetails(rcRelayControl, rcResp);
    IF rcResp.Status = BPKG.iStatusFailure THEN
    rcResp.Info := BPKG.Get_Message('20889', rcResp.Info);
    END IF;
    END RRU;
    How to call this procedure in oracle?
    Thanks.

  • Designer Table APIs

    Hi All,
    Anybody has done projects using Designer Table APIs? We are currently in dilemma if we would implement the Table API or just create our own database triggers. We'll be deploying oure application thru 9iAS.
    What are the advantage and disadvantages with the Table APIs?
    Any feedback would be highly appreciated.
    TIA,
    Remar

    I have recently completed a large project for a government department using Design with the Table API (TAPI). While this approach has many advantages, there are some problem spots. The main one is that error handling performed by cg$errors package is not very intuitive. It can be difficult to troubleshoot code imbedded in the TAPI.
    That being said, I do like using the TAPI, I could not imagine coding for a large project that is Designer based without it now. It just may not be for everyone.
    Steve Brown

  • My iPhone 4s was stolen this weekend and I did the Remote Lock.  What exactly does that do?  Also, if i do the Remote Wipe will that erase all of my data and impede anyone from ever using the phone?

    My iPhone 4s was stolen this weekend and I did the Remote Lock.  What exactly does that do?  Also, if i do the Remote Wipe will that erase all of my data and impede anyone from ever using the phone?

    The remote lock locks the iphone with a passcode that you set. By remote wiping the device it will simply restore it and clear it of all its data, but by doing this it will prevent you tracking it and communicating with it (e.g. remote locking it) in the future

  • Latest operating system that I can use on a Power Mac G5 with CPU type Power PC 970 (2.2)

    What is the latest operating system that I can use on a Power Mac G5 with CPU type Power PC 970 (2.2).  This is not an intel chip.  Thank you.

    10.5.8 without Classic, or 10.4.11 with Classic.

  • Mapping refcursors with object types in a procedure

    Hi all,
    I need some help regarding the mapping of refcursors with object types .
    Example: Procedure "A" has object types as input/output parameters which lies in the Web Method Application as a API.
    We are creating a procedure "B" which has ref cursors as input/ouput parameters
    which will map to the Procedure "A"'s object type parameters.
    It will be highly needful for the solution.
    Regards
    Saugata

    Your pseudocode has a lot of steps in it, but you didn't say which step you need help with. Since I already covered going from a nested table type to a refcursor, I'll assume you want an example that goes the other way now, like from a refcursor to a nested table type. Here's one ...
    SQL>
    SQL>
    SQL> set serveroutput on
    SQL>
    SQL> create type nested_table_type as table of varchar2(14) ;
      2  /
    Type created.
    SQL> show errors
    No errors.
    SQL>
    SQL>
    SQL> create function func
      2    ( p_cursor in sys_refcursor )
      3    return nested_table_type
      4  as
      5    v_nested_table nested_table_type ;
      6  begin
      7
      8    fetch p_cursor bulk collect into v_nested_table ;
      9    return( v_nested_table );
    10
    11  end;
    12  /
    Function created.
    SQL> show errors
    No errors.
    SQL>
    SQL> select func( cursor( select dname from dept ) ) as nested_table from dual ;
    NESTED_TABLE
    NESTED_TABLE_TYPE('ACCOUNTING', 'RESEARCH', 'SALES', 'OPERATIONS')If your cursor selects objects instead of simple data types, the code is pretty much the same.
    SQL> create type object_type as object ( c1 varchar2(14), c2 varchar2(13) );
      2  /
    Type created.
    SQL> show errors
    No errors.
    SQL>
    SQL> create type nested_table_type as table of object_type ;
      2  /
    Type created.
    SQL> show errors
    No errors.
    SQL>
    SQL>
    SQL>
    SQL> create function func
      2    ( p_cursor in sys_refcursor )
      3    return nested_table_type
      4  as
      5    v_nested_table nested_table_type ;
      6  begin
      7
      8    fetch p_cursor bulk collect into v_nested_table ;
      9    return( v_nested_table );
    10
    11  end;
    12  /
    Function created.
    SQL> show errors
    No errors.
    SQL>
    SQL> select
      2    func( cursor( select object_type( dname, loc ) from dept ) ) as object_table
      3  from dual ;
    OBJECT_TABLE(C1, C2)
    NESTED_TABLE_TYPE
      ( OBJECT_TYPE('ACCOUNTING', 'NEW YORK'),
        OBJECT_TYPE('RESEARCH', 'DALLAS'),
        OBJECT_TYPE('SALES', 'CHICAGO'),
        OBJECT_TYPE('OPERATIONS', 'BOSTON')
      )(NB I manually reformated the query results for clarity).

  • Restrictions with object types

    Hello
    Among other restrictions Oracle 8.1.7 does not support (1) change of definitions of types that have dependent data and (2)replication of object columns and object tables.
    (1) While it is possible to add columns to existing relational tables and even change the size of columns it is not possible to do so with object types. This may expose a significant limitation for schema migration and maintainance. Is there any other support for those requirements, any workarounds other than crafting table copy scripts from scratch?
    (2) This seems to make a couple of good things in Oracle unavailable with objects. No fault tolerance through replication? No standby database? What (development and runtime efficient) options remain with objects in that category?
    Do the limitations persist in Oracle 9i?
    What about tool support in Oracle 9i? DBA Studio, for example, is rather poor in dealing with objects in 8.1.7 - no browsing and management of object schema and data, you cannot even select an existing object type for a table column.
    Are there other restrictions one should be aware of before touching objects?
    Any experiences and information greatly appreciated.
    Thanks,
    Thomas
    null

    Thomas,
    Do you have some specific applications that you have in mind to use Oracle Objects? Do you plan to use type evolution and replication?
    Oracle9i Object-Relational Technology has reached a major milestone with several 'completeness' features. As Arvind pointed out, in Oracle9i, type evolution can propogate changes to dependents. Object replication is also supported in Oracle9i.
    Although Enterprize Management tools do provide easy-to-use GUIs, there are some limitations in handling Objects, especially when there are nesting involved. Fortunately, SQL*Plus can be used to remedy some of these limitations.
    Regards,
    Geoff

  • Any experience with Object Types and Forms6i / 9i ???

    Has anyone got any experience in working with Object Types and Object Views together with Forms 6i or 9i???
    TIA
    Rob Zoeteweij

    Hi AnneCarmen,
    Check this small video, http://project02.businesscatalyst.com/Jing/2012-07-13_0508.swf
    This is just an example where I am trying to demonstrate how the html embedded into the frame sticks to only one image and not to all the other images. Also, how to keep the thumbnails. Under menu options you can modify the transition and speed option as per your need.
    Regards,
    Abhishek Maurya

  • Do you ever use the Ignore Sequence Rendering Errors preference? If so, why?

    There is a hidden Ignore Sequence Rendering Errors preference in After Effects that is untested, unsupported, and potentially dangerous to your rendered video---but still maybe useful in some rare cases. If you ever use this preference, tell us here why.
    This preference makes After Effects continue rendering an image sequence, even when errors are encountered that would otherwise stop the render. Of course, this means that you'll end up with bad frames... but maybe you're OK with some bad frames that you can patch later, as long as the render continues for the remaining frames.
    If you do ever use this preference, note that any time that you need to do so, you should also be submitting a bug report so that we know about the errors that you're encountering and can look into fixing them.

    I have absolutely used this, and at times it's been a life-saver!  The principle use case is this:
    Tight deadline, late night.  Delivery is tomorrow.  I've got a complex composite with a number of layers (maybe 4k r3ds) and I'm going to render a dpx image sequence overnight.  It's going to take several hours.   Sometimes the render fails because a 3rd party plug in (say something from Re:Vision or Cycore) throws an error randomly every now and then.
    If I chose Ignore Sequence Rendering Errors, maybe I'll get a bad frame or two, which I can patch in the morning.  But at least 99% of the render is done.  If the render crashes and it stops in the middle of the night.  I'm up a creek.
    Very useful feature which I don't use often, but comes in very handy when I need it.
    Cheers,
    Ari

  • Anyone ever use the global plan for an 5c

    Going to France next week with a iPhone 5c.  Has anyone used the global plan?  How's it work, dialing numbers both in France and US?

    Roger1968,
    Traveling is always an exciting time! And being able to use your phone while traveling is definitely important.
    Our Global plan are awesome! You can get 100 minutes, 100 text to send, and 100MB for only $40. If you only want to use data you can add the $25 and receive 100Mb to use.
    While in France and you want to call the USA, just dial Plus Sign then 1 then ten digit U.S. number. To call a number in France just dial Plus Sign then Country Code then Local Number with Area Code (if applicable). For complete details you can visit http://www.verizonwireless.com/b2c/tripplanner/tripplannercontroller. Once there enter the country you will be visiting and your phone model. It will provide all the info you need. Keep us posted of you need further assistance.
    JohnB_VZW
    Follow us on Twitter @VZWSupport
    If my response answered your question please click the "Correct Answer" button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!

  • Type attribute with Object type or Nested table?

    I have been creating lot many threads around the same problem, however i thought i knew but realized I do not know or else do not know how to..
    I have created object type with an attribute READINGVALUE NUMBER(21,6)...How can i use type attribute on this object while declaring variable.....can we use type attribute on NESTED TABLES, similar to the db tables?
    example
    CREATE TYPE READING AS OBJECT(READINGVALUE NUMBER(21,6));
    CREATE TABLE INTERVALREADINGS OF TYPE READING;

    meghavee wrote:
    Thanks Solomon, however this approach does not preserve precision/scale of number data type.....What you can do is create placeholder tables:
    SQL> create table reading_type_placeholder of reading
      2  /
    Table created.
    SQL> desc reading_type_placeholder
    Name                                      Null?    Type
    READINGVALUE                                       NUMBER(21,6)
    SQL> declare
      2      v_var reading_type_placeholder.readingvalue%type;
      3  begin
      4      v_var := 123456789012345;
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> declare
      2      v_var reading_type_placeholder.readingvalue%type;
      3  begin
      4      v_var := 1234567890123456;
      5  end;
      6  /
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error: number precision too large
    ORA-06512: at line 4
    SQL>And if you modify type attribute:
    SQL> alter type reading modify attribute readingvalue number(26,6) cascade;
    Type altered.
    SQL> desc reading_type_placeholder
    Name                                      Null?    Type
    READINGVALUE                                       NUMBER(26,6)
    SQL>SY.

  • How to insert with select in table with object types

    I am in the proces of redesigning some tables, as i have upgraded from
    personal oracle 7 to personal oracle 8i.
    I have constructed an object type Address_type, which is one of the columns
    in a table named DestTable.
    The object type is created as follows:
    CREATE OR REPLACE TYPE pub.address_type
    AS OBJECT
    Street1 varchar2(50),
    Street2 varchar2(50),
    ZipCode varchar2(10));
    The table is created as follows:
    CREATE TABLE pub.DestTable
    (id INTEGER PRIMARY KEY,
    LastName varchar2(30),
    FirstName varchar2(25),
    Address pub.address_type);
    Inserting a single row is ok as i use the following syntax:
    Insert into DestTable(1, '******* ', 'Lawrence', pub.address_type(
    '500 Oracle Parkway', 'Box 59510', '95045'));
    When i try to insert values into the table by selecting from another table i
    cannot do it and cannot figure out what is wrong
    I have used the following syntax:
    Insert into DestTable
    id, name, pub.address_type(Street1, Street2, ZipCode))
    select
    id, lastname, firstname, street1, street2, ZipCode
    from SourceTable;
    I have also tried the following syntax:
    Insert into DestTable
    id, name, pub.address_type(Address.Street1, Address.Street2,Address.ZipCode))
    select
    id, lastname, firstname, street1, street2, ZipCode
    from SourceTable;
    What is wrong here ?
    null

    Magnus,
    1. Check out the examples on 'insert with subquery' in http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/server.817/a85397/state21b.htm#2065648
    2. Correct your syntax that repeated the column definition after "insert into ..."
    Insert into DestTable
    id, name, pub.address_type(Street1, Street2, ZipCode))
    select
    id, lastname, firstname, street1, street2, ZipCode
    from SourceTable;
    Regards,
    Geoff
    null

  • Nested Tables with Object Types

    Hi,
    Does someone know from which version on object Types can be referenced via database links ?
    I could not manage with Oracle 8.1.7 and needed this features as the only way to access
    a stored procedure array is via collection and using Object Types.
    But Object Types are not possible to access remotlely.
    Thanks in advance.
    brg robert

    Click on the link below and see if you can use that method as a way to work around the problem:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1252400357305

  • Use of Call Function Node vi, with char type pointer

    I want to be able to use a certain function from C++ DLL, and I followed the TOOLS>>IMPORT>>SHARED LIBRARY(.dll) wizard.  Where I located my header file and the dll file.
    However i am getting an error (1097).  This is the function with the paramaters:
    void Function_Name(unsigned char *L, unsigned char *H, unsigned in Len, unsigned char Adr);
    I don't think, that I configured my Call Function Node, correctly.  How should i set the paramaters settings of the first 2?  I have tried Numeric, unsigned (and signed) Int (32, 16), pass pointer value.  to accomodate the first two varaibles. 
    Please someone help, what should I do to accomodate the unsigned char pointers, so that I can used the function in labVIEW?

    Hi Safe,
    The error you're encountering has the following description (I'm sure you've already looked this up-posting here for clarity for other readers):
    LabVIEW:  An exception occurred within the external code called by a Call Library Function Node. This might have corrupted LabVIEW's memory. Save any work to a new location and restart LabVIEW.
    Typically, this happens for one of just a few reasons:
    Memory was overwritten (e.g. you passed a buffer of N bytes, but N+X bytes were modified, and an exception was thrown.
    A bad pointer was passed. (This is probably not the case.)
    Arguments were not passed to the function properly. (Calling conventions)
    Function wasn't called from the proper thread.
    Some other reason (only can be determined by inspecting in a debugger).
    I've attached some pictures of how I'd configure the dialog, but there are two critical things you have to know: calling conventions and thread safety. Those are things defined by the DLL. In Windows, C vs. 'Standard' (a.k.a. Pascal) calling conventions MUST be correct, as they affect how arguments are passed on the stack. If this is wrong, then, for example, where arg1 is expected to be an unsigned char *, you may actually only pass an unsigned char. Dereferencing that number as a pointer will at best crash, at worst appear to be a valid address and silently corrupt memory.
    I suggest double-checking the calling conventions. 'stdcall' is still quite common, but not the default setting in the Call Library Function dialog.
    Best regards,
    intvstefve
    intvsteve
    LabVIEW R&D
    Attachments:
    dllconfig11.JPG ‏40 KB
    dllconfig21.JPG ‏41 KB

  • Trying to list table column names with data type

    I have a list of table names and need to output the fields and their type.  So I tried the code below but getName() returns string even when I know the field is an int.  So I'm assuming I'm using the wrong function.  I looked at the output from getMethods() but I didn't see anything else that would return the information I want.  TIA.
    <cfset TableList = "accountingsettings,address,area,areasettings">
    <cfloop from="1" to="#Listlen(TableList)#" index="i">
    <cfquery datasource="axxerion" name="getTablename">
    select * from #Listgetat(TableList, i)#
    where 0<>0
    </cfquery>
    <cfset colHeaderNames = ArrayToList(getTablename.getColumnList())/>
    <cfoutput>
    <p><b>#Listgetat(TableList, i)# #getTablename.getMetaData().getColumnCount()#</b></p>
    <ul>
    <cfloop from="1" to="#Listlen(colHeaderNames)#" index="x">
    <cfdump var="#getMetaData(Listgetat(colHeaderNames,x)).getmethods()#">
    <li>#Listgetat(colHeaderNames,x)# #getMetaData(Listgetat(colHeaderNames,x)).getName()# </li>
    </cfloop>
    </ul>
    </cfoutput>
    </cfloop>
    Returns
    accountingsettings 22
    ID java.lang.String
    BINENTRYID java.lang.String
    CLIENTID java.lang.String
    CREATESYSTEMUSERID java.lang.String
    CREATETIME java.lang.String
    DEPRECIATIONYEARS java.lang.String
    POSTNOTAPPROVED java.lang.String
    REGIONID java.lang.String
    RESIDUALVALUE java.lang.String
    REVISION java.lang.String
    UPDATESYSTEMUSERID java.lang.String
    UPDATETIME java.lang.String
    DUPLICATEREFERENCES java.lang.String
    STRICTMODE java.lang.String
    CONSOLIDATEINVOICEITEMS java.lang.String
    AUTOACCOUNTINGPERIOD java.lang.String
    INVOICEDESCRIPTION java.lang.String
    POSTREQUIRED java.lang.String
    CONSOLIDATEOUTINVOICEITEMS java.lang.String
    PAYMENTDIFFERENCECATALOGITEMID java.lang.String
    ACCOUNTINGPERIODLENGTHCODE java.lang.String
    CREDITPAYMENTS java.lang.String

    So I'm assuming I'm using the wrong function. 
    You are using GetMetaData() incorrectly. It returns an array of structures. Cfloop through the returned array, and output the #name# and #typeName# keys.
    But .. if you only need the column metadata. Dan's suggestion of using cfdbinfo would seem more appropriate here.

Maybe you are looking for

  • Russian text not appearing correctly

    I'm new to the Mac, please bear with me. I am attempting to translate some code developed by a Russian speaker however the Russian text appears in weird characters. See this screenshot: http://i34.tinypic.com/2yk1ilt.jpg I've tried everything I could

  • Problem setting different width for images using HorizontalList tag

    Hi,<br />I succeeded using HorizontalList in my AdvancedDataGrid,<br /><br />  <mx:groupedColumns><br />...<br />...<br />  </mx:groupedColumns>  <br />  <mx:rendererProviders>            <br />        <mx:AdvancedDataGridRendererProvider   <br />   

  • Why is waking Leopard up so buggy!??!

    Comp goes to sleep, and won't wake up! This has happened on the Macbook and Powermac! Argh!

  • Multiple pack level hierarchies

    Hi, i want to use multiple hierarchies with fixed device controllers created by the parameter value (hierarchy_by_epc_filter) of the activity device_validate_40 in the rule pack. Is it possible to build multiple hierarchies, considering the scenario

  • Suddenly can't click and drag within my playlists

    I can drag songs or podcasts to my playlist, but cannot organize them once they are in there. Also, previously I could drag them in a particular order, and achieve the desired result but that is no longer the case. Thanks for your consideration.