Question on Object Type

Hi,
I don't know if its the right forum to ask this question but I am a beginner. I am trying to extract a large number of values from oracle using more than 10 queries fired in sequence, with a little logic in-between( which can easily be shifted a stored procedure). I want to reduce the number of network trips by shifting all these queries in a stored procedure which could take all the input parameters as some sort of Object which can be mapped directly to a C# object. The return type of this proc would also be a similar object/ array of objects.
I can use those objects as is in my application for further execution.
Is this approach feasible and optimized than the current mechanism?
If yes then can I use the oracle object type for this purpose?
Thanks,
Peeyush

> I am trying to extract a large number of values from oracle using more than
10 queries fired in sequence, with a little logic in-between( which can easily
be shifted a stored procedure.. <snipped>
I think that is an accurate description of both the problem and solution.
It does not make sense to perform huge fetches of data, and ship that off to the client for processing. A RDBMS is a data processing platform. It is designed to do exactly this.. process the data on the server, reducing the data to information and then pass that information to the client.
And yes, the solution to this is to use PL/SQL. But to a greater extent of merely wanting to weld a bunch of SQLs together. The purpose of PL/SQL is to crunch the data - to do the processing that you would have done at the client.
In fact, much of this processing can likely be done using just SQL itself, without much help of PL/SQL.
What does not make sense is to use SQL as your "I/O language" - have it relegated to merely making read and write calls and nothing else. SQL is a very powerful and capable language - and the fastest at crunching data. Nothing, not even PL/SQL which is also very close to the physical data, can do it as fast as SQL.
Thus the performance and scalability rule that says: Maximize SQL. Minimize PL/SQL (and C/C#/Java/etc).
What also does not make sense is to take the data returned by SQL and throw it into buffers (objects/collections) in PL/SQL. PL/SQL memory (called PGA) is expensive dedicated memory. Oracle's SQL engine already has a very sophisticated and capable shared database buffer - that unlike a buffer in the PGA, is available and able to service all sessions and clients. (collections/bulk processing in PL/SQL is aimed at reducing context switching - not at reducing I/O calls)
My approach to this type of problem is to do as much as possible in SQL. Provide a PL/SQL wrapper to make the (sometimes complex) SQL transparent from the client - which also allows me to optimise, tune and maintain that without touching a single byte of client code.
Do as little as possible in the client (RDBMS and business logic wise) - have the client do what it is suppose to do - Visualise the information received via PL/SQL calls (usually using ref cursors) in an attractive user interface and interact with the end-user.

Similar Messages

  • OSB to Object Types: difference between NULL value and not available

    Hello all,
    I have a question about Object Types. More specifically, how to differentiate between an empty value (null) and a string not available.
    This is my case:
    I have created an object type with three parameters.
    CREATE OR REPLACE TYPE OSB_EMP_OBJ_TYPE AS OBJECT
    (EMP_ID NUMBER
    ,DEPT_ID NUMBER
    ,ORDER_ID NUMBER
    ,CONSTRUCTOR FUNCTION OSB_EMP_OBJ_TYPE
    RETURN self as result
    /I would like to see what happens when I put an empty string into emp_id, NULL into DEPT_ID and nothing into ORDER_ID.
    To do so I have this test script:
    declare
      p_emp OSB_EMP_OBJ_TYPE := OSB_EMP_OBJ_TYPE();
    begin
      p_emp.EMP_ID := '';
      p_emp.DEPT_ID := null;
    --  p_emp.ORDER_ID := null;
      if p_emp.EMP_ID is null
      then
        dbms_output.put_line('Empty');
      end if;
      if p_emp.DEPT_ID is null
      then
        dbms_output.put_line('NULL');
      end if;
      if p_emp.ORDER_ID is null
      then
        dbms_output.put_line('Not available');
      end if;
    end;The result of this is:
    Empty
    NULL
    Not availableIt seems that Oracle treats all three situations alike. What I would like to achieve is a way to see that p_emp.ORDER_ID was not initialized.
    To elaborate a bit: in our production system this procedure would be called from OSB and the object type would by the input for that procedure. Our database version is 10.2.0.5.0.
    Our procedures look something like this:
    procedure p_procedure ( p_emp in osb_emp_obj_type )
    is
    begin
      do_something;
    end;Can anyone tell me if there is a way to achieve this, so I can see whether or not a value in the object type was filled?
    Thanks in advance!

    Darn...
    Eventually we want to use this for an update procedure. The client gets all current data from the database by calling a webservice that (using OSB) selects the data from our database. What we want to achieve is that the client can update that data, by returning only the changed fields to an update procedure.
    We then handle an empty tag to update the field to null, and we ignore missing tags.
    OSB itself can handle this, but PL/SQL can't.
    I'm now thinking of adding an indicator to each optional field (clear_field_yn). OSB can still check for empty tags or missing tags. When a tag is empty, it's corresponding indicator will be set to 'Y'. If the tag is missing, then it will be set to 'N'.
    Is that a solution to consider, or is there a much simpler approach possible?

  • Cheat Sheet/Listing of Object types and transactions they are available in?

    Does anyone know how to obtain a listing of the standard object types and where they would be available? 
    We have already worked with the Travel Management Trip Docuemnts and I know that object type BUS2089 is available through the Object for Services area of transaction PR05.  So we store entries in the TOA01 table for this object and they are available to us in the object services section.
    But now we want to leverage the functionality we built and extend it to other areas.  But I spent a lot of time today trying to find out what object could be used through transaction IE03 for an equipment record and finally found EQUI.  Now I just have to test it out.
    I see a lot of standard document types available as well and don't know what they are for - for Plant Maintenance work order notifications object type BUS2038 is there with PMONOTFPAP, PMIDAMAGE and PMIREQUEST already available.  I didn't want to create a new one if these are available for work order notification images, etc.
    It would be nice if there was a spreadsheet or listing that detailed each object type and where it was used in the system.
    (I did try searching but didn't find this question/answer on a broad basis.)

    Tarun,
    Thanks for replying.  I think that we are agreeing on the same details, but it doesn't really answer my question.
    I guess what I am looking for is if I asked the following question:
         What object type is used when populating the object services link from within an equipment record via IE03?
    How would you obtain the answer to this question - besides just knowing it?
    It's the same way that I know the following:
         What object type is used when populating the object services link from within a trip via PR05?  --> BUS2089
         What object type is used when populating the object services link from within a work order via IW33?  --> BUS2007
         What object type is used when populating the object services link from within a wo notification via IW23?  --> BUS2038
    The last two were easy because it prompts you when creating an attachment.  The first one someone told me the answer to.
    We will be doing image links for many different documents (invoices, journal entries, HR employee records, etc) and I'm just trying to figure out how to know which objects to use.  Once I know the object I know how to configure the OAC* tables for use.
    Any help is much appreciated.
    Thanks!

  • Using Multiple Object Types in a FIM Managed Criteria Distribution Group

    Is it possible to use multiple object types in a criteria based distribution group. So when building your criteria filter, "Select (object type) that match (all/any) of the following condiftions". Currently you can only choose 1 object type and
    I want to be able to choose object type "user" and a custom object type I create for my contacts 

    You can create main condition as "any" and later add two sub-conditions - one that object in set "All People" and other sub-condition that object in set "All Contacts" or "All Groups".
    If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer.

  • S/A bridge problem: No object type found for the message

    Hi all,
    I've been spending days looking into the following problem. I have a RFCXIFile scenario. The R3 system sends data via an RFC to XI and XI post the data as a flat file on a certain server using FTP.
    This scenario worked just fine for 1 exception. I could only run this scenario once. The second time I got timeouts when checking the data sent to my RFC destination using SM58. When I reactivated my RFC communcation channel I could again send 1 RFC to the system. All subsequent tries would fail.
    I guess this is due to the fact that I use a synchonous call (RFC) to an asynchronous one. Thus the adapter is still waiting for the response from the XI system and will not accept any further new calls from R3.
    So I figure let's use this pattern called the S/A bridge. So I designed everything according to guides and examples and I'm quite certain everything is configured right but when I run the scenario I get the following message:
    <i> <!--  Call Adapter
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
      <SAP:Category>XIAdapter</SAP:Category>
      <SAP:Code area="BPE_ADAPTER">UNKNOWN_MESSAGE</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack>No object type found for the message. Check that the corresponding process is activated</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error></i>
    It seems that the adapter cannot find any integration process to send the message into!?
    I've looked at numerous threads on sdn and tried all kinds of stuff (looked at the cache==> code 0 = OK , tried to reactivate my integration process, checked the interface determination,...), but to no avail. Does anybody has an idea what could be wrong ?
    Any help would be greatly appreciated for I'm all out of clues....
    Bob

    First of all, Thank you for trying to help me out here.
    Some answer to your suggestions/questions:
    The IP has return code 0 in SXI_CACHE. so that doesn't seem to be the problem.
    I've checked the BPM for syntax errors. I doesn't have any.
    I've reimported the BPM into the integration directory.
    And did a full cache refresh in SXI_CACHE. Return code is (stays) zero, so that's OK.
    I've already included the error message from SXI_MONI. It is in the last step ("Call Adater") that the error occurs.
    The other steps execute just fine...
    The RFC communcation channel accepts the incoming RFC call and puts into the pipeline, so no problems with the communication channel either. the problem is actually when the pipeline is trying to forward the message into an IP trhough the BPE_ADAPTER (according to SXMB_MONI).
    Therefore I'm not able to go to into PE, because the workflow is never started. the BPE_ADAPTER does not find any active process for the interface determination i've entered.
    So i can not debug the IP in the PE and check container variables, like some of you mentioned.
    Maybe some more information about the scenario:
    The RFC is called from an R3 system to XI over the interface "CONTROL_RECIPE_DOWNLOAD", which is an imported RFC, with a request and response message type.
    Then I got a receiver and interface determination with lead the incoming RFC message to the IP, into interface "XI_ERP_MF_MD_CONTROL_RECIPE_REQ_AI_MI".
    This is an abstract synchronous interface based on the request and response types of the "CONTROL_RECIPE_DOWNLOAD" imported RFC.
    This interface is used the first step (receive) of my BPM as the synchronous interface to open the S/A bridge.
    The message (container var)  used in this step is
    name: CORREQ
    Category: Abstract interface
    type: "XI_ERP_MF_MD_CONTROL_RECIPE_REQ_AI_MI"
    The interface "XI_ERP_MF_MD_CONTROL_RECIPE_REQ_AI_MI" is an abstract, asynchronous interface based on the request type of the "CONTROL_RECIPE_DOWNLOAD".
    Then there are 2 send steps for putting the flat files into place and finally i close the the S/A bridge using message:
    name: CORRES
    Category: Abstract interface
    type: "XI_ERP_MF_MD_CONTROL_RECIPE_RES_AI_MI"
    The interface "XI_ERP_MF_MD_CONTROL_RECIPE_RES_AI_MI" is an abstract, asynchronous interface based on the response type of the "CONTROL_RECIPE_DOWNLOAD".
    I hope this information gives you guys a better understanding of hte problem.
    Really looking forward to see more suggestions and to solve this nasty problem ...
    Regards,
    Bob

  • Transaction KB16N business-object type and key for GOS

    When attachments (notes, PC documents etc) are made to a manual cost allocation in transaction KB16N using GOS (generic object services):
      what is the business-object type?
      how is the business-object key constructed?
    I suspect that the business-object type is BUS6036.
    I suspect that the business-object key is the concatenation of the controlling area and the document number (using internal values).
    Is that correct?
    The reason for my question is that I have a program to display attached notes (and allow drill-down to attached PC documents) that works for various business objects (billing documents, purchasing documents and some FI documents), but I cannot get it to work for manual cost allocations.
    John

    Hi Michele 
    The transaction you are looking for should be SWO1
    Then put the ex "BUS2000116" into the Object/Interface type and ...
    Guess it will help you
    Best Regards
    Daniel

  • XML attributes and object types

    I want to create an XML Document of the following form
    <family>
    <parent attr1="val1">
    <child attr2="val2" attr3="val3"/>
    </parent>
    </family>
    Using object table and object type (for the child element), I am able to produce the following XML Document (with a "select * from family" query)
    <family> <!-- rowset -->
    <parent> <!-- row -->
    <attr1>val1</attr1>
    <child>
    <attr2>val2</attr2>
    <attr3>val3</attr3>
    </child>
    </parent>
    </family>
    The question is: how am I going to query these data so that the "attr" elements are mapped to attributes (using XSU only, without XSLT)?
    I have already tried the following:
    1. Using
    SELECT attr1 as "@attr1",
    f.child.attr2 "@attr2",
    f.child.attr3 "@attr3"
    FROM family f
    all the attributes are obviously appended to the "parent" element.
    2. Using nested table for "child" and the following query
    SELECT attr1 as "@attr1",
    CURSOR (
    SELECT n.child.attr2 as "@attr2", n.child.attr3 as "@attr3"
    FROM TABLE(f.child n)
    ) AS "child"
    FROM family f
    I am getting the following document
    <family>
    <parent attr1="val1">
    <child>
    <child_ROW attr2="val2" attr3="val3"/>
    </child>
    </parent>
    </family>
    Is there a smart SQL query to produce the desired document? What data types
    is it recommended to use to define my db schema (object types, nested tables...)?
    Thank you in advance
    null

    Finally, I got the desired XML format output from relational tablse using schema based XMLType views.
    Wherein I created Object Types from relational table, generated the schema for the Object type, registered the schema and finally created XMLType Views for populating the XML data from Relational Tables.
    I guess, you all might aware of my problem, where I got struck. Instead of printing the data in XML format I am successful in generating the XML format data Using the Query Select from BLABLA_Type_view* . I am able to print the number of rows, that I require which is in the fallowing format.
    Column Name
    1. SYS.XMLTYPE ----- As a row
    The view I am querying for is printing the data in a string format, where in I got to do the fallowing query
    SELECT SYS.XMLTYPE.getStringVal(OBJECT_VALUE) FROM BLABLA_Type_view. Which ultimately gave me the required data in XML format with tags.
    Thanks for every one who tried to give a try to solve, especially "mdrake"

  • ORDVir object type

    First i had a problem with creating tables with image type column.
    For example, when i typed:
    CREATE TABLE stockphotos (photo_id NUMBER, photographer VARCHAR2(64),
    annotation VARCHAR2(255), photo ORDSYS.ORDVir);
    i got the answere invalid datatype for "ordsys.ordvir"
    After that i tryed with ORDImage instead of ORDVir an i succeed. But
    then raised another problem. When i tryed to generate signature for
    image data object:
    declare
    image ordsys.ordimage
    image.analyze
    i got error. Obviously obtaining atributes can happen just to ORDVir
    object . So my Question is do i get this object type (in ORDSYS )
    after the installation of oracle or i had an installation problem?
    I also tried with CREATING ORDvir OBJECT TYPE procedure but i didn't
    succeed. What should i do?

    What version are you running?
    If you are running a newer version, you should look at ORDImageSignature for matching since it is the newer implementation developed in house instead of having to pay royalties, and passing the cost to customers.
    We do support ordvir applications, but you have to install the ordvir compatability kit. See: <ORACLE_HOME>/ord/vir/admin/README.txt
    Larry

  • How can I sort a collection of array with different object types in it ?

    Hi all,
    I have a collection of ArrayList; each array contains, at the first position, the same object type.
    I'd like sorting the collection by the name contained in the object at the first position of each array.
    Any suggestion ?
    Cheers.
    Stefano

    so you have a collection of a collection?
    My guess is that:
    You could subclass the arraylist and override it's compareTo method (I think that it implements comparable already but if not, go ahead and implement that interface).
    Or you could wrap your arraylist in another class that implements comparable.
    The key in my mind is correctly coding your compareTo method to look at the name in the first item of the arraylists. This should be doable and not too difficult.
    Correction: after reviewing the ArrayList api, I see that it doesn't implement the Comparable interface. You will have to make any class that either inherits arraylist or contains arraylist implement the comparable interface.
    One last thing: This question would probably have been better off in the java forum and not the Swing forum since it doesn't really involve Swing.
    Good luck!
    Edited by: petes1234 on Nov 19, 2007 6:17 AM

  • Retriving data through stored procedure returning Table of object type

    I am trying to retrieve the data returned as a table(secret_tab_type) of object type(secret_type). Now we can get the secret_tab_type table through
    rset = (ResultSet) cstmt.getObject(1); but how to map the SQL object type to Java object type ??
    FUNCTION Fetchthat(
    secretinfo      out      SECRET_TAB_TYPE,
    message     OUT varchar2
    ) return number;
    These are the declaration of secret_type object and secret_tab_type(table returned by fetchthat procedure)
    create or replace type secret_type as object
    (secret_id number(3),
    secret_question varchar2(100),
    valid_flag char);
    create or replace type secret_tab_type as table of secret_type;

    Amit,
    Your question has been previously asked (and answered) on this forum. I suggest searching this forum's archives for the terms STRUCT and ARRAY.
    For your benefit, here are the results of my search:
    http://tinyurl.com/auvl8
    Good Luck,
    Avi.

  • How can I obtain an object-type variable in Forms 6i?

    i create an object-type in oracle 8i database like this:
    TYPE OBJ_TYPE_NUMBER AS OBJECT
    FIELD1 NUMBER,
    MEMBER PROCEDURE INIT, ...
    i create a variable of this object-type in a stored procedure in Oracle 8i:
    v_Number OBJ_TYPE_NUMBER(10);
    and then call it's method:
    v_Number.INIT;
    it work's!
    But when I try to compile a previous variable declaration
    (v_Number OBJ_TYPE_NUMBER;) in Oracle Forms 6i I see only an error message.
    So my question is How can I declare and use an object-type variable in Forms 6i?

    Hi,
    the release after Forms 6i is Forms9i. Forms9i does have the PLSQL engine of Oracle 9.0.0.2 database which means that it should knwo how to handle object types in PLSQL.
    Frank

  • Concurrency and Oracle Object Types

    Hi All,
    I have a question regarding Concurrent usage of an Object type in Oracle.
    I have a java program which calls an Oracle stored proc with the object's table type as IN parameter. In my stored proc, I am populating an Oracle Object with data received from java and retrieving some data based on that.
    My java program can be invoked concurrently by 500 users at the same time - the application is built to handle that request load.
    Now in Oracle, if a bunch of requests are received at the same, would Oracle create multiple instances of this object type that would be usage to the multiple stored proc invocations? Or would there be a prob of concurrency?
    If multiple instance creation is not supported, is there some alternative I can use?
    My code roughly resembles:
    Object:
    contains two columns - name, age
    Stored proc - logic to retrieve and return data from a table based on the name, age received.
    When a bunch of requests access the stored proc simultaneously, will a bunch of instnaces of the object type get created? Or would there be a scenario where the object is common to all requests and hence data from one request would be conflicted due to data from another request?

    Hi Wiiliam
    Sorry for the late acknowledgement (i dozed off!).. Thanks for the response. So the private instance specific to a session ensure that theres no conflict between multiple requests to the same stored proc and hence no conflict of data... Great
    Chaitanya

  • How to define object type in plsql

    I create a type...
    CREATE OR REPLACE TYPE t_Archive_Data_Obj AS OBJECT
    (Archive_Name VARCHAR2(40), Archive_Data CLOB);
    I create a type in plsql.....
    TYPE tt_Archive_Data IS TABLE OF t_Archive_Data_Obj;
    Can I, instead of creating the object type as a database object, some how define the same in plsql and then create a table type and use.
    Thanks & Regards.

    coz I'm using it as an out parameter in plsql procedure and this procedure is called by a java application.
    Now to access this type in java to get the returned value I used Jpublisher to generate a class, this class is being used in java application.
    I'm sorry I have not check one thing that now if I instead used record in plsql and try to access the returned value using the same class will it work or not. I should have tested then asked questions on forum.
    Regards.

  • Comparisons of Packages vs Object Types

    Hi all,
    I wonder if anyone can point me towards any articles or documentation that compares/contrasts the advantages and disadvantages of Packages against Object Types?
    For example, I like the ability to have private variables and procedures within Packages but don't know how I achieve the same thing with Object Types so a comparison of the two styles would be very useful.
    Thanks all,
    Leo

    Hmmm. As far as I can tell, these are 2 different animals. The way I look at it
    - A package is a grouping of one or more variables, procedures and functions. It is a PL/SQL construct.
    - An object type is a type definition that may be used to declare SQL and PL/SQL constructs.
    I would refer you to the docs at http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14260/toc.htm (under the 10gR2 doc set at http://tahiti.oracle.com, "Application Development" tab) for a good source of information related to your question.

  • Can you reference package variables in a pl/sql object type

    I'm trying to create an object type and I would like to use a type from a pacakge definition as one of the parameters for a method in the object. I read that types defined inside a PL/SQL package cannot be used as parameter. Does anyone have a workaround for this?

    You could move the type definition out from the package to a schema level object type. Then you should be able to use the schema level object type in both your package and the new object you wish to create.
    Below is a short example of what I mean:
    -- The way I interpreted your question
    CREATE OR REPLACE PACKAGE foo_pkg
    AS
    TYPE foo_obj IS RECORD (
    f1 NUMBER
    ,f2 VARCHAR2 (10)
    in_pkg_foo_obj foo_obj;
    END foo_pkg;
    SHOW errors
    CREATE OR REPLACE TYPE newFooObj IS OBJECT (
    f1 NUMBER
    ,f2 VARCHAR2 (3)
    ,f3 DATE
    ,MEMBER FUNCTION getAllFoos (inFoo IN foo_pkg.foo_obj)
    RETURN NUMBER
    SHOW errors
    CREATE OR REPLACE TYPE BODY newFooObj
    AS
    MEMBER FUNCTION getAllFoos (inFoo IN foo_pkg.foo_obj)
    RETURN NUMBER
    IS
    BEGIN
    RETURN 1;
    END;
    END;
    SHOW errors
    -- Clean up
    DROP PACKAGE foo_pkg;
    DROP TYPE newFooObj;
    -- Now try it with a schema level object type
    CREATE OR REPLACE TYPE foo_obj IS OBJECT (
    f1 NUMBER
    ,f2 VARCHAR2 (10)
    CREATE OR REPLACE PACKAGE foo_pkg
    AS
    in_pkg_foo_obj foo_obj;
    END foo_pkg;
    SHOW errors
    CREATE OR REPLACE TYPE newFooObj IS OBJECT (
    f1 NUMBER
    ,f2 VARCHAR2 (3)
    ,f3 DATE
    ,MEMBER FUNCTION getAllFoos (inFoo IN foo_obj)
    RETURN NUMBER
    SHOW errors
    CREATE OR REPLACE TYPE BODY newFooObj
    AS
    MEMBER FUNCTION getAllFoos (inFoo IN foo_obj)
    RETURN NUMBER
    IS
    BEGIN
    RETURN 1;
    END;
    END;
    SHOW errors
    DROP PACKAGE foo_pkg;
    DROP TYPE newFooObj;
    Bob

Maybe you are looking for

  • CC desktop app (windows) doesn't show latest versions of CC apps for installation. How do I fix it?

    I've been a CC member since the start; about 6 months ago the CC desktop app on my main desktop PC stopped showing the latest versions of most applications (for example Photoshop, Illustrator, etc., only showed the 'CS' version), and stopped giving m

  • How to Identify which reuest from PSA has been taken by DTP

    Hello BI Experts, I have a requests lying in the PSA, with a Red Sign, Requested not updated to any data target using DELTA. When I trigger my DTP i get the records in my DSO. But I could not find the which PSA request has been updated by the DTP. IS

  • Why does my screen come up dark when I press the camera icon?

    Why does my screen come up dark when I press the Camera icon?  I can neither take pictures nor look at the photos I have saved.

  • Need Mac OSX 10.7 Build server

    We bought some new Mac Minis and on one of them I need to have Mac OSX 10.7 running so I installed VMWare Fusion However, when I go to install the O/S on the VM Image, I can't find a Mac OSX 10.7 (Lion) Installation Disk Image to boot the image to be

  • Opening ports on cascading routers

    hello everyone this is my first time here so hopefully I'll post up all the info you need the first time. I have 2 wrt54g routers cascading off of each other. The first wrt54g(#1) is connected directly to my cable modem the wrt54g(#2) is connected to