Use TYPE RECORD or Create Object TYPE to build Collection?

Hi All,
I need to pull in data from our ERP system via a DB Link to keep some of our Web Data up to date. I wasn't sure if I should pull the data into my collection by creating a TYPE RECORD or Creating an Object Type and fillng it that way. Is there a preferrable method?
Record:
TYPE ItemInventory IS RECORD (
ProductID Products.ProductID%TYPE,
Qty Products.QTY%TYPE);
Object:
Create Type ProdObj as Object(
ProductID Products.ProductID%TYPE,
QTY Products.QTY%TYPE);
Maybe both are suitable....wasn't sure.
Any suggestions/info is greatly apprecaited.
S
Edited by: ScarpacciOne on Feb 21, 2010 7:54 PM

ScarpacciOne wrote:
We have a complex view we use from our ERP system that allows us to pull all of our available inventory and update our website with that information. What I was thinking I would do is refactor the current procedures that are in place to update this information and pull that views information into a collection so that I could speed up the update process.The basic difference between the two is that one is a dumb record structure (similar to a C struct), whereas the other is an intelligent class (similar to a class definition in Java/C++). It can have methods and constructors.
The next major difference is that one can only be use in the PL language and not in SQL. The record struct is a PL data type definition. PL cannot provide SQL engine support for it.
On the other hand, the SQL type definition is supported by both the PL and SQL languages. This allows the type to be transparently used in both languages.
I usually prefer the SQL type definition approach in general, as it allows for more flexibility.
However, for pure collection processing in PL/SQL, there's very little to choose between the two approaches as they serve the exact same purpose - increasing performance by decreasing context switching between the PL and SQL engines.
So you need to look beyond mere bulk collection and bulk processing to decide on which approach to use. For example, a SQL type definition allows for a standard SQL projection from cursors, enabling PL/SQL code to be cursor agnostic (as each cursor, irrespective of the table(s) queried, returns the same object type). However, if the aim is simply to bulk collect from that specific cursor, then it is a lot simpler to use a PL record struct.

Similar Messages

  • Using insert statements for creating objects..pls help

    Hello all,
    I have 2 databases DB1 (which is running on 8i) and DB2( Running on 10G).
    How can I copy all the objects of a particular schema (user1) from DB1 to DB2, only by using INSERT statements. I do not want to use import/export since it is taking huge time for the operation.
    Could anybody help me on this?
    Regards,
    chotu

    Since I have allready imported indexes,procedures etc , now I need only to copy tables from DB1 to DB2.
    I have truncated all the tables of user1 in DB2
    Now I am using,
    insert into my_tab as select * from user1.my_tab@DB2_db_link;
    Thanks for the help...
    chotu.

  • Using Flash Catalyst to create components in Flash Builder

    Hi,
    Apologies if this is a obvious question, but I wanted to solve the one way catalyst --> flash builder nightmare (there is no better word in my opinion) and create a number of basic components in catalyst (rather than an entire site), import them into flash builder and use them as components that I can extend, thus hopefully avoiding the need to affect the fxp file and prohibiting the catalyst updates. It also means I can have multiple people working on components in catalyst and assemble them into one app in Flash builder.
    My questions are:-
    1. Does what I'm proposing make sense?
    2. Is it possible to create SWC files from a project imported from an fxp file (generated in catalyst)?
    Many thanks for all of you who take the time to indulge a newbie like me :-)
    Kind Regards
    Jace

    Don't worry about the UI components development since there is a poweful GUI library that works
    for the J2ME PP. This is LwVCL that is available here: www.lwvcl.com
    See the www.lwvcl.com/online-demo.php demo applet to understand what the components set looks like.

  • Creating objects with proper stereotypes

    Hi,
    I'm just trying to create Architecture Areas and Business Functions using VB. This all works as expected, besides of one small but important exception:
    I want to create Architecture Areas and Business Functions of a given type (Stereotype).
    When I create the Architecture Area or Business Function, assign the code and name, and then set the Stereotype, everything looks OK. The Stereotype is appearing on the symbol etc., but ... the graphical symbol differs from what we have configured for this element.
    In the script I'm doing it this way:
    L2Process = EamL2.ArchitectureAreas.CreateNew(PdEam.cls_ArchitectureArea)
    L2Process.SetNameAndCode Trim(L3SubSubFolder.Name), Trim(L3SubSubFolder.Code)
    L2Process.Stereotype = "Process"
    The Architecture Area is created, the Stereotype is assigned:
    But the graphical symbol is not the expected one, it"s rather the "default" one ...
    What I have configured is:
    Is there a way to create Architecture areas and Business Functions, so that the configured Custom Symbols are used? MAybe a parameter for CreateNew like in the CreateModel function, where we can set the Diagram Type?
    CreateModel(PdEAM.cls_Model, EvaluateNamedPath("%_MODELS%") + L3SubSubFolder.Name + ".eam" + "|" + "Diagram=CityPlanningDiagram", omf_DontOpenView)
    I can't find anything in the documentation in regards to this issue...
    Thanks,
    Rafal

    Hi Rafal,
    Could you try creating object directly in the collection using the GetCollectionBySteretype("Process") on model ?
    Something like:
    Dim processes
    Set processes = EamL2.GetCollectionByStereotype("Process")
    Set L2Process = processes.CreateNew()
    L2Process.SetNameAndCode Trim(L3SubSubFolder.Name), Trim(L3SubSubFolder.Code)
    This should assign stereotype at initialization and may be fix your issue...
    Marc
    PS. I did not check code, take care of potential typo.

  • Specific function modules to create objects of type SC, D, CG CE?

    Hi Experts,
    I need to create objects
    SC (Program of study)
    D   (Event Type)
    CG (Module Group)
    CE (Assessment)
    using function modules. Up to the present, we have beeing using function module
    HRIQ_OBJECT_CREATE
    as an all purpose FM for all these object types.
    However, now, I have the requirement to replace these FM with specific FM for that particular object type. For object type SM, I found
    HRIQ_RFC_MODULE_CREATE
    Now, I am asking you if there are such FM for the other objects in question as well??
    THANKS,
    Johannes

    Dear Johannes,
    Hereby some FM's that may help you out:
    - HRIQ_CREATE_ANY_OBJECT --> create any objject
    - HRIQ_SUBJECT_CREATE --> create SU
    - HRIQ_TRANSCRIPT_CREATE --> create EQ
    - HRIQ_STUDY_OBJECT_CREATE --> create CS
    - HRIQ_RULECONTAINER_CREATE --. create RC
    - HRIQ_AW_ACWORK_CREATE --> create CW
    br
    Rob

  • Creating object type u0093no objectu0094

    We have created No objcet table SBO will create only code and name fields but create document table SBO will create DocEntry and also the Extra fields that will help  to link to other documents.
    Above things  that  we have clear idea
    Could u tell me  creating object type “no object”  can we insert the data……..??
    Or its compulsory  to using  UDO?

    using  .srf   is it possible  ???   i have sending u code 
    error form bad datasource.. form Unique id 'MPPeriod',item unique id ' cmbppt'
    but we check  all unique id   that is correct
    Public Class payperiod
        Private WithEvents SBO_Application As SAPbouiCOM.Application
        Dim AddStarted As Boolean
        Dim RedFlag As Boolean
        Private oform As SAPbouiCOM.Form
        Private oCodetext As SAPbouiCOM.EditText
        Private noteedittext As SAPbouiCOM.EditText
        Private daystext As SAPbouiCOM.EditText
        Private worktext As SAPbouiCOM.EditText
        Private starD As SAPbouiCOM.EditText
        Private endD As SAPbouiCOM.EditText
        Private Sub SetApplication()
            AddStarted = False
            RedFlag = False
            '// Use an SboGuiApi object to establish connection
            '// with the SAP Business One application and return an
            '// initialized application object
            Dim SboGuiApi As SAPbouiCOM.SboGuiApi
            Dim sConnectionString As String
            SboGuiApi = New SAPbouiCOM.SboGuiApi
            '// by following the steps specified above, the following
            '// statement should be sufficient for either development or run mode
            sConnectionString = Environment.GetCommandLineArgs.GetValue(1)
            '// connect to a running SBO Application
            SboGuiApi.Connect(sConnectionString)
            '// get an initialized application object
            SBO_Application = SboGuiApi.GetApplication()
        End Sub
        Public Sub New()
            MyBase.New()
            SetApplication()
            addmenuitems()
        End Sub
        Private Sub DrawForm()
            Dim oitem As SAPbouiCOM.Item
            Dim oCombopptype As SAPbouiCOM.ComboBox
            Try
                LoadFromXML("PayPeriodMaster.srf")
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try
            oform = SBO_Application.Forms.Item("MPPeriod")
                       '''''''''combo for pay type
            oitem = oform.Items.Item("cmbppt")
            oCombopptype = oitem.Specific
            oCombopptype.ValidValues.Add(CStr(3), "Employee")
            ' oCombopptype.ValidValues.Add(CStr(SAPbouiCOM.BoStatusBarMessageType.smt_Success), "Labour")
            oCombopptype.ValidValues.Add(CStr(4), "Labour")
            ''''''' combo for code
            oitem = oform.Items.Item("txtcode")
            oCodetext = oitem.Specific
            '''''''' startdate
            oitem = oform.Items.Item("txtSDate")
            starD = oitem.Specific
            ''''''''''end date
            oitem = oform.Items.Item("txtEDate")
            endD = oitem.Specific
            ''''''''''days in period
            oitem = oform.Items.Item("txtDPrd")
            daystext = oitem.Specific
            '''''''''''' working days
            oitem = oform.Items.Item("txtWDays")
            worktext = oitem.Specific
            ''''''' notes''''''''''''
            oitem = oform.Items.Item("txtNotes")
            noteedittext = oitem.Specific
        End Sub
        Private Sub addmenuitems()
            Dim oMenus As SAPbouiCOM.Menus    ' the menus collection
            Dim oMenuitem As SAPbouiCOM.MenuItem ' the new item
            'get the  menus collection from the application
            oMenus = SBO_Application.Menus
            Dim ocreationPackage As SAPbouiCOM.MenuCreationParams
            ocreationPackage = SBO_Application.CreateObject(SAPbouiCOM.BoCreatableObjectType.cot_MenuCreationParams)
            oMenuitem = SBO_Application.Menus.Item("2048") 'sales menu id
            oMenus = oMenuitem.SubMenus
            ocreationPackage.Type = SAPbouiCOM.BoMenuType.mt_STRING
            ocreationPackage.UniqueID = "mnu1"
            ocreationPackage.String = "Payperiod"
            ocreationPackage.Enabled = True
            ocreationPackage.Position = 15
            Try
                ' if the menu already exist thus code will fail
                oMenus.AddEx(ocreationPackage)
            Catch ex As Exception ' menu already exist
                MessageBox.Show("menu already exist")
            End Try
        End Sub
        Private Sub SBO_Application_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.MenuEvent
            If (pVal.MenuUID = "mnu1") And (pVal.BeforeAction = False) Then
                Try
                    Dim f As SAPbouiCOM.Form
                    f = SBO_Application.Forms.Item("MPPeriod")
                    f.Select()
                Catch ex As Exception
                    DrawForm()
                End Try
            End If
        End Sub
        Private Sub SBO_Application_StatusBarEvent(ByVal Text As String, ByVal MessageType As SAPbouiCOM.BoStatusBarMessageType) Handles SBO_Application.StatusBarEvent
            If MessageType = SAPbouiCOM.BoStatusBarMessageType.smt_Error And AddStarted = True Then
                RedFlag = True
            End If
        End Sub
        Private Sub LoadFromXML(ByRef FileName As String)
            Dim oXmlDoc As Xml.XmlDocument
            oXmlDoc = New Xml.XmlDocument
            '// load the content of the XML File
            Dim sPath As String
            sPath = IO.Directory.GetParent(Application.StartupPath).ToString
            oXmlDoc.Load(sPath & "\" & FileName)
            '// load the form to the SBO application in one batch
            SBO_Application.LoadBatchActions(oXmlDoc.InnerXml)
        End Sub
        Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_Application.ItemEvent
            Dim oDocRec As SAPbobsCOM.Recordset
            Dim f As SAPbouiCOM.Form
            Dim s As String
            ' Events of the Blanket Agreement form
            If (FormUID = "MPPeriod") Then
                If (pVal.Before_Action = True) Then
                    If pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED And pVal.ItemUID = "1" Then
                        Dim objRecser As SAPbobsCOM.Recordset
                        objRecser = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                        ' SBO_Application.MessageBox("hi")
                        ' objRecser.DoQuery("INSERT INTO [@MastPayPeriod]( Code,Name,U_PayPeriodTypeCode, U_PayPeriodCode, U_StartDate, U_EndDate, U_DaysInPeriod, U_WorkingDays, U_Notes) VALUES (1,1,'" & oform.Items.Item("cmbppt").Specific.Value & "','" & oform.Items.Item("txtCode").Specific.Value & "',& '"oform.Items.Item("cmbSDate").Specific.Value & "','"& oform.Items.Item("cmbEDate").Specific.Value & "','" & oform.Items.Item("txtDPrd").Specific.Value & "','" & oform.Items.Item("txtWDays").Specific.Value & "','" & oform.Items.Item("txtNotes").Specific.Value & "')")
                        objRecser.DoQuery("INSERT INTO [@MastPayPeriod](Code,Name,U_PayPeriodTypeCode, U_PayPeriodCode, U_StartDate, U_EndDate, U_DaysInPeriod, U_WorkingDays, U_Notes) VALUES (1,1,'" & oform.Items.Item("cmbppt").Specific.Value & "','" & oform.Items.Item("cmbCode").Specific.Value & "','" & oform.Items.Item("txtSDate").Specific.Value & "','" & oform.Items.Item("txtEDate").Specific.Value & "','" & oform.Items.Item("txtDPrd").Specific.Value & "','" & oform.Items.Item("txtWDays").Specific.Value & "','" & oform.Items.Item("txtNotes").Specific.Value & "')")
                    End If
                End If
                If (pVal.Before_Action = False) Then
                    If (pVal.ItemUID = "2") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED) Then
                    End If
                End If
            End If
        End Sub
        'Private Sub SaveAsXML(ByRef Form As SAPbouiCOM.Form)
        '    Dim oXmlDoc As Xml.XmlDocument
        '    Dim sXmlString As String
        '    oXmlDoc = New Xml.XmlDocument
        '    // get the form as an XML string
        '    sXmlString = Form.GetAsXML
        '    // load the form's XML string to the XML document object
        '    oXmlDoc.LoadXml(sXmlString)
        '    Dim sPath As String
        '    sPath = IO.Directory.GetParent(Application.StartupPath).ToString
        '    // save the XML Document
        '    oXmlDoc.Save((sPath & "\PayPeriodMaster.xml"))
        'End Sub
    End Class

  • Implicit and explicit Type conversion using Type object in heap

    Hi,
    I am surprised how Implicit and explicit Type conversion works using Type object in heap. for example when implicit type conversion occur what pointer it returns to object and similarly with explicit type conversion.

    Hello,
    >> I am surprised how Implicit and explicit Type conversion works using Type object in heap.
    For Implicit conversions: Typical examples are conversions from smaller to larger integral types, and conversions from derived classes to base classes. For the first one, the reference would be different which means it would return a different pointer to
    a new object. For the reference type, it actually points to the same memory location, you could use the object.ReferenceEquals() to check it.
    For Explicit conversions (casts):Typical examples include numeric conversion to a type that has less precision or a smaller range, and conversion of a base-class instance to a derived class. For first one, it would perform the same with implicit conversions.
    While for the conversion of conversion of a base-class instance to a derived class, actually, there's no built-in way to do this conversion.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • What type of blank DVD should I use to record photo images that are on my drive E

    I own a HP Pavilion dv5000 with an RW DVD + R DL multi recorder.  My question, which type of blank DVD should I use to record images that are on my drive E?  I can record without problems on a CR-R but when I try a blank DVD-R it won't work.  Please advise.

    Hi,
    Back to the good old days, HP supported only DVD +R discs, some vendors supported DVD -R discs. Now all vendors support both. You may want to try blank DVD +R. Hope this works. Please post back the result.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Creating object type conflict dump

    Hi All,
    I have an interface zintf_1. I getting the list of classes that implemented the zintf_1.
    There are some cases where the class wont have implemented the interface.
    ZDEMO_AA class has not implemented the interface zintf_1.
    data: lr_intf_1 type ref to zintf_1,
            lv_clsname type SEOCLSNAME.
    lv_clsname = 'ZDEMO_AAA'.
    try.
    create object lr_intf_1 type (lv_clsname).
    catch cx_sy_create_object_error.
    endtry.
    In that case i m getting the dump "Type conflict with allocation of References".
    Please help me to resolve the issue.
    thanks
    Vimalraj

    I'm assuming that you're trying to trap the case the class lv_clsname doesn't actually implement the interface.
    Well, the interface not being there is NOT a catchable error.  So you have to find out whether the interface is implemented first.
    DATA: lr_intf_1  TYPE REF TO zintf_1,
          lv_clsname TYPE seoclsname,
          lr_object  TYPE REF TO cl_oo_class,
          lt_intf    TYPE seo_relkeys.
    lv_clsname = 'ZDEMO_AAA'.
    lr_object ?= cl_oo_object=>get_instance( lv_clsname ).
    lt_intf = lr_object->get_implemented_interfaces( ).
    READ TABLE lt_intf TRANSPORTING NO FIELDS WITH KEY refclsname = 'ZINTF_1'.
    IF sy-subrc IS INITIAL.
      CREATE OBJECT lr_intf_1
        TYPE
          (lv_clsname).
      WRITE: 'it worked'.
    ELSE.
      WRITE / 'it failed'.
    ENDIF.
    matt

  • Exception '1250' is not defined for method 'CREATE' object type 'MESSAGE'

    Dear experts,
    I set up the document distribution (SWU3, backgroundjob SMTP, activated the workflows, flagged the linkages, etc). Now, I have still a error:
    Exception '1250' is not defined for method 'CREATE' object type 'MESSAGE'
    Does anyone know what the cause of exception 1250 could be?
    Thanks in advance and kind regards,
    Samuel

    hi,
    SAP ITS is SAP Internet Transaction Server which provides connection between SAP ERP system and html client.
    Check with bassis, i think TCP/IP or work station application not configured yet. i guess?
    Benakaraja
    ??P

  • Use Granfeldts Create Object to create dynamic groups

    Trying to use Sorens Granfeldts, Create Object WF activity to create dynamic groups.
    In a standard function evaluator activity I generate the Filter as [//WorkflowData/Filter]
    The "string" I set it to is:
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[ObjectID
    = /*[ObjectID = '8dfcb5e8-ff01-400c-8ca7-2a0002d2d2d4']/ComputedMember]</Filter>
    In the CreateObject activity I then just have [//WorkflowData/Filter],Filter among the initial values.
    The creation works if I remove this attribute so the rest of the attributes seems to be working.
    The creation fails however end I get the error below in the Forefront Identity Manager event log.
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.ResourceManagement.WFActivities.Resolver.GetDisplayStringFromGuid(Guid id, String[] expansionAttributes)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ReplaceGuidWithTemplatedString(Match m)
       at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
       at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
       at Microsoft.ResourceManagement.WFActivities.Resolver.GetStringAttributeValue(Object attribute)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorWithoutAntiXSS(String match, ResolverOptions resolveOptions)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorForWithAntiXSS(String match, ResolverOptions resolveOptions)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ReplaceMatches(String input, Boolean useAntiXssEncoding, ResolverOptions resolveOptions)
       at Microsoft.ResourceManagement.Workflow.Hosting.ResolverEvaluationServiceImpl.ResolveLookupGrammar(Guid requestId, Guid targetId, Guid actorId, Dictionary`2 workflowDictionary, Boolean encodeForHTML, String expression)
       at Microsoft.ResourceManagement.Workflow.Activities.ResolveGrammarActivity.Execute(ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
       at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
       at System.Workflow.Runtime.Scheduler.Run()
    Have anyone used this WF activity to create dynamic groups and can tell how to set the Filter?

    Hey Kent!
    I did the same thing, with Søren`s Create Object WF. I did it like this on the filter part:
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[(Department = '[//Target/ObjectID]')]</Filter>,Filter
    The whole thing looks like this:
    (I use Function evaluator to generate a AccountName for groups based on a clean version of DisplayName).
    [//Target/DisplayName],DisplayName
    SEC_[//WorkFlowData/CleanAccountName],AccountName
    [//Target/Manager],Owner
    Security,Type
    DOMAIN_STRING,Domain
    Universal,Scope
    [//Target/DisplayName]_SecGroup,Description
    [//Target/Manager],DisplayedOwner
    None,MembershipAddWorkflow
    True,MembershipLocked
    [//Target/CleanAccountName],MailNickname
    <Filter xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Dialect="http://schemas.microsoft.com/2006/11/XPathFilterDialect" xmlns="http://schemas.xmlsoap.org/ws/2004/09/enumeration">/Person[(Department = '[//Target/ObjectID]')]</Filter>,Filter
    Regards, Remi www.iamblogg.com

  • How & where to use Java script to create new button in object detail page

    Hi All,
    I want to create "New/Add button" in object detail page. If i am not wrong i need to use java script for that but could you please let me know how & where to use Java script to create new button in object detail page in CRMOD.
    Thanks in advance.
    Regards,
    Manish

    Any related object on the detail page should have an "Add" or "New" or both buttons by default - This is vanilla functionality and will do the required action.
    If you want to modify this behaviour and do something tricky you will potentially have to go for javascript. You should add the javascript on a custom web tab on that Object.
    Admin --> Application Customization --> Contact -->Contact Web Applet
    Now, add your javascript in the code area, after you select the type = HTML for this web applet, expose this web applet on the Contact detail layout and your javascript will be invoked whenever this page is loaded.
    Check this online document to see how javascript can be embedded in CRM on Demand http://helponmyproject.com/TTOCOD/
    Cheers!
    Royston

  • Best way to do a Object which holds a collection of another object type.

    I'm writing a caching object to store another object. The cache is only valid for a session, so I want a store the data in a nested table.
    I have try to simplify my example down to its core.
    How do I make this work and what is the best to index the index the items stored for fastest retrieval.
    CREATE OR REPLACE TYPE ty_item AS OBJECT (
    id_object VARCHAR2 (18),
    ORDER MEMBER FUNCTION compare (other ty_item)
    RETURN INTEGER
    CREATE OR REPLACE TYPE BODY ty_item
    AS
    ORDER MEMBER FUNCTION compare (other ty_item)
    RETURN INTEGER
    IS
    BEGIN
    IF SELF.id_object < other.id_object
    THEN
    RETURN -1;
    ELSIF SELF.id_object > other.id_object
    THEN
    RETURN 1;
    ELSE
    RETURN 0;
    END IF;
    END;
    END;
    CREATE OR REPLACE TYPE ty_item_store AS TABLE OF ty_item;
    CREATE OR REPLACE TYPE ty_item_holder AS OBJECT (
    CACHE ty_item_store,
    MEMBER FUNCTION get (p_id_object IN VARCHAR2)
    RETURN REF ty_item,
    MEMBER FUNCTION find (p_id_object IN VARCHAR2)
    RETURN REF ty_item,
    MEMBER FUNCTION ADD (p_id_object IN VARCHAR2)
    RETURN REF ty_item
    CREATE OR REPLACE TYPE BODY ty_item_holder
    AS
    MEMBER FUNCTION get (p_id_object IN VARCHAR2)
    RETURN REF ty_item
    IS
    rtn REF ty_item;
    BEGIN
    rtn := find (p_id_object);
    IF rtn IS NULL
    THEN
    rtn := ADD (p_id_object);
    END IF;
    RETURN rtn;
    END;
    MEMBER FUNCTION find (p_id_object IN VARCHAR2)
    RETURN REF ty_item
    IS
    rtn ty_item;
    BEGIN
    SELECT VALUE (ch)
    INTO rtn
    FROM CACHE ch
    WHERE ch.id_object = p_id_object;
    RETURN rtn;
    END;
    MEMBER FUNCTION ADD (p_id_object IN VARCHAR2)
    RETURN REF ty_item
    IS
    item ty_item;
    BEGIN
    item := ty_item (p_id_object);
    INSERT INTO CACHE
    VALUES (item);
    END;
    END;
    /

    Best way to do a Object which holds a collection of another object type. The best place for data in a database is.. no real surprise.. in tables. If that data is temporary of nature, global temporary tables cater for that.
    Storing/caching data using PL/SQL requires very expensive private process memory (PGA) from the server. This does not scale.
    I'm writing a caching object to store another object. Irrespective of how l33t your haxor skillz are, you will not be able to code as a sophisticated, performant and scalable PL/SQL data cache, as what already exists (as the database buffer cache) in Oracle.
    The cache is only valid for a session, so I want a store the data in a nested table.Not sure how you take one (session local data) to mean the other (oh, let's use a nested table).
    Session local data can be done using PL/SQL static variables. Can be done using name-value pairs residing in a context (Oracle namespace). Can be done using a global temporary table.
    The choice is dependent on the requirements that need to be addressed. However, the term +"caching+" has very specific connotations that say that a global temporary table is likely the best suited candidate.

  • How to use table type in bulk collect

    Hi experts,
    How to use table type in bulk collect see the procedure used( oracle 10g)
    and error is
    PLS-00597: expression 'REQ_REC' in the INTO list is of wrong type
    CREATE OR REPLACE PROCEDURE SAMPLE_SP IS
    TYPE TYP_A AS OBJECT
    ( COLMN1 TABLE1.COLM1%TYPE,
    COLMN2 TABLE1.COLM2%TYPE,
    COLMN3 TABLE1.COLM3%TYPE
    TYPE REC_A IS TABLE OF TYP_A;
    REQ_REC A_REC;
    CURSOR REQ_CUR IS SELECT COLM1,COLM2,COLM3 FROM TABLE1 WHERE <CONDITION>;
    BEGIN
    OPEN REQ_REC;
    LOOP
    EXIT WHEN REQ_REC%NOTFOUND;
    FETCH REQ_REC BULK COLLECT INTO REQ_REC LIMIT 1000;
    FOR I IN 1..REQ_REC.COUNT
    LOOP
    <insert statement>
    END LOOP;
    COMMIT;
    END LOOP;
    END SAMPLE_SP;
    Many thanks,
    Kalinga

    ok but that is not an issue..
    Hi experts,
    How to use table type in bulk collect see the procedure used( oracle 10g)
    and error is
    PLS-00597: expression 'REQ_REC' in the INTO list is of wrong type
    CREATE OR REPLACE PROCEDURE SAMPLE_SP IS
    TYPE TYP_A AS OBJECT
    ( COLMN1 TABLE1.COLM1%TYPE,
    COLMN2 TABLE1.COLM2%TYPE,
    COLMN3 TABLE1.COLM3%TYPE
    TYPE REC_A IS TABLE OF TYP_A;
    REQ_REC A_REC;
    CURSOR REQ_CUR IS SELECT COLM1,COLM2,COLM3 FROM TABLE1 WHERE <CONDITION>;
    BEGIN
    OPEN REQ_CUR;
    LOOP
    EXIT WHEN REQ_REC%NOTFOUND;
    FETCH REQ_REC BULK COLLECT INTO REQ_REC LIMIT 1000;
    FOR I IN 1..REQ_REC.COUNT
    LOOP
    <insert statement>
    END LOOP;
    COMMIT;
    END LOOP;
    END SAMPLE_SP;
    Many thanks,
    Kalinga
    Message was edited by:
    Kalinga

  • I'm trying to create a list using CustomSchemalXml property in ListCreationInformation object in CSOM. But, the code throws an error "Invalid List Schema".

    I'm trying to create a list using CustomSchemalXml  property in ListCreationInformation object in CSOM. But, the code throws an error "Invalid List Schema". Any pointers on how to set the CustomSchemalXml property?
    Sri

    Hi Lakshmanan,
    Thanks for your reply.
    I checked this post and there was no solution to the problem there. I undersand we cannot create a list based on custom template in CSOM, but what I'm looking for is how of form xml and set it to CustomSchemalXml
     property, so that everytime when I want to create a list with similar content types and stuff, I can just set the
    CustomSchemalXml  property. 
    Sri

Maybe you are looking for

  • Satellite P200-10G - Some programs don't work

    Hi everyone. Ok so we have a product recovery disc and we tried to reinstall Windows but it wouldnt work. Some of our programs like Bluetooth and the built in webcam dont work for no reason. Other programs like Google Earth and AVG the antivirus prog

  • Is there a way to automatically put CHUD into Nap mode on startup and wake?

    Using nap mode on chud helps my machine run way cooler. But nap defaults off on every restart or wake from sleep. Is there a simple way (or any way) to keep this from happening? Like some workaround with an applescript? I'm an applescript newb, so I

  • HP OfficeJet Pro 8600 Premium - Unable to Enable Scan to Email

    I was out the country for the past two weeks, and just returned to find that I can no longer scan to email (or the computer) from the printer. I have verified the email settings many times over, yet I continue to receive the message that "Connection

  • Purchase order text that appear automatically in Goods Receipt Automotive

    Hello, I am looking for a possibility to add a text (header or position) to the purchase order which than later will be shown as a popup for example   before posting in Goods Receipt. E.g. The purchase order  could maintain a text like "when material

  • ISSUE: TDS REVERSAL DURING ADVANCE CLEARING WITH INVOICE

    Dear All   I am having problem related to TDS reversal. For e.g Advance payment to Vendor: rs 10000/ Tds deducted is rs 200/ Now Invoice posted for amount is: 100000/ Tds deductes is rs 1000/ We know that TDS on rs 10000 is deducted twice which is ge