How to compare a collection of objects?

Basically I am checking answers to security questions.
So I have an id, a question no and the answer_text stored in a table.
What I intend to do is retrieve this into a collection and compare that to the collection passed in.
If they match , I return true else I return false.
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
referencing this thread on collections
Re: Compare Collections   - PL-00306
I based my example on TUBBY's example.
create or replace
type answer_array_obj
as
object(id number,
          question_no number,
          answer_text varchar2(100)
create or replace type answer_array as table of answer_array_obj;
DECLARE
first_list  answer_array_type := answer_array_type(answer_array_obj(1,1,'ONE'),
                                                                         answer_array_obj(1,2,'TWO'),
                                                                         answer_array_obj(1,3,'THREE')
second_list  answer_array_type := answer_array_type(answer_array_obj(1,1,'ONE'),
                                                                         answer_array_obj(1,2,'TWO'),
                                                                         answer_array_obj(1,3,'THREE')
compare_list answer_array_type := answer_array_type(NULL);
BEGIN
compare_list := first_list  MULTISET EXCEPT second_list;
IF compare_list.COUNT = 0
THEN
    compare_list := second_list MULTISET EXCEPT first_list;
END IF;
IF compare_list.COUNT = 0
THEN
    DBMS_OUTPUT.PUT_LINE('EQUAL');
ELSE
   DBMS_OUTPUT.PUT_LINE('THE ABSENCE OF EQUALITY');
END IF;
END;
/When I looked at the example , by user 933207, he appeared to be using two different objects.
18 BEGIN
19 load1( nt_copy1);
20 load2( nt_copy2);

Hi,
what is the question? I doesnt work? So you have to provide a map method
CREATE OR REPLACE TYPE  "ANSWER_ARRAY_OBJ"
as
object(id number,
          question_no number,
          answer_text varchar2(100),
          MAP MEMBER FUNCTION match RETURN VARCHAR2);
CREATE OR REPLACE TYPE BODY  "ANSWER_ARRAY_OBJ"
as
          MAP MEMBER FUNCTION match RETURN VARCHAR2 is
          begin
            return to_char(id)||to_char(question_no)||answer_text;
          end;
end;
create or replace type answer_array_type as table of answer_array_obj;
DECLARE
first_list  answer_array_type := answer_array_type(answer_array_obj(1,1,'ONE'),
                                                                         answer_array_obj(1,2,'TWO'),
                                                                         answer_array_obj(1,3,'THREE')
second_list  answer_array_type := answer_array_type(answer_array_obj(1,1,'ONE'),
                                                                         answer_array_obj(1,2,'TWO'),
                                                                         answer_array_obj(1,3,'FOUR')
compare_list answer_array_type := answer_array_type(NULL);
BEGIN
compare_list := first_list  MULTISET EXCEPT second_list;
IF compare_list.COUNT = 0
THEN
    compare_list := second_list MULTISET EXCEPT first_list;
END IF;
IF compare_list.COUNT = 0
THEN
    DBMS_OUTPUT.PUT_LINE('EQUAL');
ELSE
   DBMS_OUTPUT.PUT_LINE('THE ABSENCE OF EQUALITY');
END IF;
END;
THE ABSENCE OF EQUALITY
Statement processed.
0.02 secondsregards

Similar Messages

  • How to create an collection/array/object/thingy from a bunch of objects for eventual export to CSV.

    This is a follow-up to an earlier post (How
    to output a bunch of variables into a table.) Now that I can ouput data for a single computer I need to to do the same for a list of computers into a CSV. In more general terms how do I get a bunch of $Computer objects into a single collection/array/object/thingy
    with a clever name like $Computers?
    # http://ss64.com/ps/get-wmiobject-win32.html
    # http://social.technet.microsoft.com/Forums/en-US/da54b6ab-6941-4e45-8697-1d3236ba2154/powershell-number-of-cpu-sockets-wmi-query?forum=winserverpowershell
    # http://serverfault.com/questions/10328/determine-cpu-processors-vs-sockets-though-wmi
    # http://social.technet.microsoft.com/Forums/windowsserver/en-US/8443fcfd-5a0b-4c3d-bda7-26df83d2ee92/how-to-output-a-bunch-of-variables-into-a-table?forum=winserverpowershell
    Param(
    [Parameter(Mandatory=$false,ValueFromPipeline=$true)]
    [string]$ComputerName = $env:COMPUTERNAME,
    [Parameter(Mandatory=$false,ValueFromPipeline=$false)]
    [ValidateScript(
    If ( $_ -ne $null ) { Test-Path $_ }
    [String]$ComputerListFile
    Function Get-Computer
    Param(
    [string]$ComputerName
    $Win32_PingStatus = $null
    $Win32_PingStatus_Result = $null
    $Win32_OperatingSystem = $null
    $Win32_Processor = $null
    $Win32_PhysicalMemory = $null
    $Win32_ComputerSystem = $null
    $Win32_BIOS = $null
    $Computer = $null
    $Win32_PingStatus = "select * from Win32_PingStatus where address = '$ComputerName'"
    $Win32_PingStatus_Result = Get-WmiObject -query $Win32_PingStatus
    If ( $Win32_PingStatus_Result.protocoladdress )
    "$ComputerName ping succeeded."
    $Win32_OperatingSystem = Get-WmiObject Win32_OperatingSystem -computer $ComputerName -ErrorAction SilentlyContinue
    If ( $Win32_OperatingSystem -eq $null)
    "$ComputerName WMI failed."
    } Else {
    "$ComputerName WMI succeeded."
    $Win32_Processor = [object[]]$(Get-WmiObject Win32_Processor -computer $ComputerName)
    $Win32_PhysicalMemory = [object[]]$(Get-WmiObject Win32_PhysicalMemory -computer $ComputerName)
    $Win32_ComputerSystem = Get-WmiObject Win32_ComputerSystem -computer $ComputerName
    $Win32_BIOS = Get-WmiObject Win32_BIOS -computer $ComputerName
    $Computer = New-Object -Type PSObject -Property @{
    Name = $Win32_OperatingSystem.CSName
    Win32_BIOS_SerialNumber = [string]$Win32_BIOS.SerialNumber
    Win32_ComputerSystem_Manufacturer = [string]$Win32_ComputerSystem.Manufacturer
    Win32_ComputerSystem_Model = [string]$Win32_ComputerSystem.Model
    #Win32_ComputerSystem_NumberOfLogicalProcessors = [int32]$Win32_ComputerSystem.NumberOfLogicalProcessors
    #Win32_ComputerSystem_NumberOfProcessors = [int32]$Win32_ComputerSystem.NumberOfProcessors
    Win32_ComputerSystem_TotalPhysicalMemory = [long]$Win32_ComputerSystem.TotalPhysicalMemory
    Win32_ComputerSystem_TotalPhysicalMemory_GB = [float]($Win32_ComputerSystem.TotalPhysicalMemory / (1024*1024*1024))
    Win32_OperatingSystem_Caption = [string]$Win32_OperatingSystem.Caption
    Win32_OperatingSystem_CSName = [string]$Win32_OperatingSystem.CSName
    #Win32_OperatingSystem_OSArchitecture = [string]$Win32_OperatingSystem.OSArchitecture
    #Win32_OperatingSystem_SerialNumber = [string]$Win32_OperatingSystem.SerialNumber
    Win32_OperatingSystem_ServicePackVersion = [string]$Win32_OperatingSystem.ServicePackMajorVersion + "." + [string]$Win32_OperatingSystem.ServicePackMinorVersion
    Win32_PhysicalMemory_Capacity = ($Win32_PhysicalMemory | ForEach-Object { $_.Capacity } | Measure-Object -Sum).sum
    Win32_PhysicalMemory_Capacity_GB = (($Win32_PhysicalMemory | ForEach-Object { $_.Capacity } | Measure-Object -Sum).sum / (1024*1024*1024))
    Win32_Processor_Count = [int]$Win32_Processor.Count
    Win32_Processor_NumberOfCores = [string]$Win32_Processor[0].NumberOfCores
    Win32_Processor_NumberOfLogicalProcessors = [string]$Win32_Processor[0].NumberOfLogicalProcessors
    #Win32_Processor_Description = [string]$Win32_Processor[0].Description
    Win32_Processor_Manufacturer = [string]$Win32_Processor[0].Manufacturer
    Win32_Processor_Name = [string]$Win32_Processor[0].Name
    } ## end new-object
    $Computer
    } Else {
    "$ComputerName ping failed."
    $ComputerNameMgmt = $ComputerName + "-mgmt"
    $Win32_PingStatus = "select * from Win32_PingStatus where address = '$ComputerNameMgmt'"
    $Win32_PingStatus_Result = Get-WmiObject -query $Win32_PingStatus
    If ( $Win32_PingStatus_Result.protocoladdress )
    "$ComputerNameMgmt ping succeded."
    } Else {
    "$ComputerNameMgmt ping failed."
    "$(Get-Date -Format o) Starting script $($MyInvocation.MyCommand.Name)"
    If ( $ComputerListFile -eq $null -or $ComputerListFile.Length -eq 0 )
    "Processing computer $ComputerName"
    Get-Computer( $ComputerName )
    } Else {
    "Processing computer list $ComputerList"
    $ComputerList = Get-Content $ComputerListFile
    $Computers = @{}
    $Results = @()
    ForEach( $ComputerListMember in $ComputerList )
    "$(Get-Date -Format o) $ComputerListMember"
    # Get-Computer( $ComputerListMember ) | Add-Member -InputObject $Computers -MemberType NoteProperty -Name $_
    # http://social.technet.microsoft.com/Forums/windowsserver/en-US/e7d602a9-a808-4bbc-b6d6-dc78079aafc9/powershell-to-ping-computers
    # $Compuers += New-Object PSObject -Property $Props
    # $Computers += New-Object PSObject -Property Get-Computer( $ComputerListMember )
    Get-Computer( $ComputerListMember )
    "$(Get-Date -Format o) Ending script $($MyInvocation.MyCommand.Name)"
    If I try something like this:
    Get-Computer( $ComputerListMember ) | Add-Member -InputObject $Computers -MemberType NoteProperty -Name $_
    I get the following, even though $_.Name is not null.
    Add-Member : Cannot bind argument to parameter 'Name' because it is null.
    At <path to my script>Get-Hardware_Memory_OSVersion_CPU_Cores_ver04_sanitized.ps1:111 char:107
    + Get-Computer( $ComputerListMember ) | Add-Member -InputObject $Computers -MemberType NoteProperty -Name <<<< $_
    + CategoryInfo : InvalidData: (:) [Add-Member], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.AddMemberCommand
    Or if I try this:
    $Computers += New-Object PSObject -Property Get-Computer( $ComputerListMember )
    I get this:
    New-Object : Cannot bind parameter 'Property'. Cannot convert the "Get-Computer" value of type "System.String" to type "System.Collections.Hashtable".
    At <path to my script>Get-Hardware_Memory_OSVersion_CPU_Cores_ver04_sanitized.ps1:114 char:47
    + $Computers += New-Object PSObject -Property <<<< Get-Computer( $ComputerListMember )
    + CategoryInfo : InvalidArgument: (:) [New-Object], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.NewObjectCommand

    Hi Aenagy,
    If you want to combine all the computers' information to a single array, and add the property computername in the output, please also try the script below, which I make a little modification of the function Get-Computer, pleaese make sure the account running
    the script has the admin permission of the remote computers, or you need to privide cridentials in get-wmiobject, also note I haven't tested:
    $output = @()#to output information of the all the computers
    ForEach( $ComputerName in $ComputerList ){#loop all the computers
    $Win32_PingStatus = "select * from Win32_PingStatus where address = '$ComputerName'"
    $Win32_PingStatus_Result = Get-WmiObject -query $Win32_PingStatus
    If ( $Win32_PingStatus_Result.protocoladdress )
    "$ComputerName ping succeeded."
    $Win32_OperatingSystem = Get-WmiObject Win32_OperatingSystem -computer $ComputerName -ErrorAction SilentlyContinue
    If ( $Win32_OperatingSystem -eq $null)
    "$ComputerName WMI failed."
    Else {
    "$ComputerName WMI succeeded."
    $Win32_Processor = [object[]]$(Get-WmiObject Win32_Processor -computer $ComputerName)
    $Win32_PhysicalMemory = [object[]]$(Get-WmiObject Win32_PhysicalMemory -computer $ComputerName)
    $Win32_ComputerSystem = Get-WmiObject Win32_ComputerSystem -computer $ComputerName
    $Win32_BIOS = Get-WmiObject Win32_BIOS -computer $ComputerName
    $Computer = New-Object -Type PSObject -Property @{
    Computername = $ComputerName #add the property computername
    Name = $Win32_OperatingSystem.CSName
    Win32_BIOS_SerialNumber = [string]$Win32_BIOS.SerialNumber
    Win32_ComputerSystem_Manufacturer = [string]$Win32_ComputerSystem.Manufacturer
    Win32_ComputerSystem_Model = [string]$Win32_ComputerSystem.Model
    #Win32_ComputerSystem_NumberOfLogicalProcessors = [int32]$Win32_ComputerSystem.NumberOfLogicalProcessors
    #Win32_ComputerSystem_NumberOfProcessors = [int32]$Win32_ComputerSystem.NumberOfProcessors
    Win32_ComputerSystem_TotalPhysicalMemory = [long]$Win32_ComputerSystem.TotalPhysicalMemory
    Win32_ComputerSystem_TotalPhysicalMemory_GB = [float]($Win32_ComputerSystem.TotalPhysicalMemory / (1024*1024*1024))
    Win32_OperatingSystem_Caption = [string]$Win32_OperatingSystem.Caption
    Win32_OperatingSystem_CSName = [string]$Win32_OperatingSystem.CSName
    #Win32_OperatingSystem_OSArchitecture = [string]$Win32_OperatingSystem.OSArchitecture
    #Win32_OperatingSystem_SerialNumber = [string]$Win32_OperatingSystem.SerialNumber
    Win32_OperatingSystem_ServicePackVersion = [string]$Win32_OperatingSystem.ServicePackMajorVersion + "." + [string]$Win32_OperatingSystem.ServicePackMinorVersion
    Win32_PhysicalMemory_Capacity = ($Win32_PhysicalMemory | ForEach-Object { $_.Capacity } | Measure-Object -Sum).sum
    Win32_PhysicalMemory_Capacity_GB = (($Win32_PhysicalMemory | ForEach-Object { $_.Capacity } | Measure-Object -Sum).sum / (1024*1024*1024))
    Win32_Processor_Count = [int]$Win32_Processor.Count
    Win32_Processor_NumberOfCores = [string]$Win32_Processor[0].NumberOfCores
    Win32_Processor_NumberOfLogicalProcessors = [string]$Win32_Processor[0].NumberOfLogicalProcessors
    #Win32_Processor_Description = [string]$Win32_Processor[0].Description
    Win32_Processor_Manufacturer = [string]$Win32_Processor[0].Manufacturer
    Win32_Processor_Name = [string]$Win32_Processor[0].Name
    } ## end new-object
    $output+=$Computer #combine all the "$computer" to "$output"
    Else {
    "$ComputerName ping failed."
    $output
    If you have any feedback on our support, please click here.
    Best Regards,
    Anna
    TechNet Community Support

  • How to process a collection of objects of a derived class?

    I'm trying to clean up some duplicated code.
    I have several classes that have a common parent class. I have in my application several searching and sorting functions that operate on these child classes. But I realized that this is code duplication, as these functions only need data members of the common parent class. So I figured I could make these functions operate on collections of the parent class.
    But during refactoring, I ran into a compiler error that surprised me. This is the SSCCE:
    import java.util.*;
    public class Tinker {
      static class ParentClass {}
      static class ChildClass extends ParentClass {}
      static void processClassCollection( Collection< ParentClass > c ) {}
      public static void main( String[] args ) {
        Collection< ParentClass > parentClassCollection = new Vector< ParentClass >();
        Collection< ChildClass > childClassCollection = new Vector< ChildClass >();
        processClassCollection( parentClassCollection );
        processClassCollection( childClassCollection ); // Why won't this compile?
    }Every object of type ChildClass is also of type ParentClass, right? Every function that requires a ParentClass object, can be passed a ChildClass, right?
    Then, if a function requires a Collection< ParentClass >, why can't I pass it a Collection< ChildClass >?
    Apparently there is a gap of my understanding, either of inheritance, or of Collections. I would very much appreciate clarification, and any suggestion how to deal with such a case.
    -Ron.

    ejp wrote:
    Why can't a Collection< ChildClass > be used where a Collection< ParentClass > is expected?Because Collection< ChildClass > doesn't extend Collection< ParentClass >. They are separate unrelated types.And I think part of the reason this is not allowed. i.e. you can pass ChildClass to a method which expects a ParentClass. is that java doesn't know if you are just looking at the Collection or modifying it. If you could add anything which extends ParentClass to the collection, the collection of ChildClass would not be valid any more.
    The difference is that in the first case, you are passing the reference by value and changing it in the method has no impact on the caller. However, in the case of the Collection, you could corrupt it if you can add objects which the caller does not expect to be in it.

  • How to map a collection of object in TopLink?

    For (simple) example, I've a XSD that defines:
    <xsd:complexType name="AttachmentType">
    <xsd:sequence>
    <xsd:element name="docID" nillable="false" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="MyDocType">
    <xsd:sequence>
    <xsd:element name="attachment" nillable="true" minOccurs="0"
    maxOccurs="unbounded" type="tns:AttachmentType"/>     
    </xsd:sequence>
    </xsd:complexType>
    This XSD is referenced by a WSDL. Using JDeveloper to generate a Java Web Service using the WSDL and will get the following classes:
    public class AttachmentType implements java.io.Serializable
    protected java.lang.String docID;
    public AttachmentType() {    }
    public java.lang.String getDocID() {        return docID;    }
    public void setDocID(java.lang.String docID) {        this.docID = docID;    }
    public class MyDocType implements java.io.Serializable
    protected AttachmentType[] attachment;
    public MyDocType () {    }
    public AttachmentType[] getAttachment() {        return attachment;    }
    public void setAttachment(AttachmentType[] attachment)
    this.attachment = attachment;
    Now I want to generate a XML document from MyDocType. I use TopLink (JAXB) to do the mapping. However, how to map the 'attachment' of type AttachmentType[]? TopLink seems only allowing List/Set/Collection container options.
    Anyone can help?
    Note: I have to use the classes generated from WSDL.
    Thanks!!

    Thanks. I'm using TopLink Workbench for the mapping
    and have no idea on how to specify the XML
    transformation mapping for array attribute. Can you
    tell me more?I was putting together an example of the transformation mapping but came up with a better way. It turns out that a transformation mapping isn't ideal because you have to take over some of the responsibility for converting XML to objects. A better solution is to intercept the calls to the getter and setter for the AttachmentType[] and convert between an Array and List. Just map the Array as a composite collection in the workbench and customize the attachment attribute mapping in code.
    Each mapping in TopLink has Accessor object responsible for getting and setting values in objects. If you choose method or direct access the mapping will have a different Accessor class. So the solution is to use an Accessor that converts the List TopLink builds into an Array of the correct type on set. On get, the Accessor creates a List from the Array.
    You can introduce a custom Accessor using an After Load method. I've put a complete example up on my googlepages account[1]. The key code is listed below. Note that this code assumes you're using direct instance variable access. Also, this code works with TopLink 10.1.3.2 and the TopLink 11 preview. It won't work with previous versions.
    The After Load class that changes the mapping accessor:
    public class MyDocCustomizer {
         public static void customize(ClassDescriptor descriptor) {
              XMLCompositeCollectionMapping mapping = (XMLCompositeCollectionMapping)
                   descriptor.getMappingForAttributeName("attachment");
              InstanceVariableAttributeAccessor existingAccessor =
                   (InstanceVariableAttributeAccessor) mapping.getAttributeAccessor();
              ListArrayTransformationAccessor transformationAccessor =
                   new ListArrayTransformationAccessor(AttachmentType.class, "attachment");
              transformationAccessor.initializeAttributes(descriptor.getJavaClass());
              mapping.setAttributeAccessor(transformationAccessor);
    }The custom InstanceVariableAccessor subclass:
    public class ListArrayTransformationAccessor extends
              InstanceVariableAttributeAccessor {
         private Class arrayClass;
         public ListArrayTransformationAccessor(Class arrayClass, String attributeName) {
              super();
              this.arrayClass = arrayClass;
              this.setAttributeName(attributeName);
         public Object getAttributeValueFromObject(Object anObject)
                   throws DescriptorException {
              Object[] attributeValueFromObject =
                   (Object[]) super.getAttributeValueFromObject(anObject);
              return Arrays.asList(attributeValueFromObject);
         public void setAttributeValueInObject(Object anObject, Object value)
                   throws DescriptorException {
              List collection = (List)value;
              Object[] array = (Object[]) Array.newInstance(arrayClass, collection.size());
              for (int i = 0; i < collection.size(); i++) {
                   Object element = collection.get(i);
                   Array.set(array, i, element);
              super.setAttributeValueInObject(anObject, array);
    }--Shaun
    http://ontoplink.blogspot.com
    [1] http://shaunmsmith.googlepages.com/Forum-519205-OXM-Array.zip

  • How to install business content Info Objects..

    Hello all.
    I am trying to do some BW extraction in our sandbox. Unfortunately I dont know how to install BC infoobjects. I have searched thru this forum but am still not fully sure. I have the source system client connected to BI. I replicated the datasources and see a ton of datasources under the UNASSIGNED NODES tree.
    Eg: How do I install the InfoObject 0Material. Can somone tell me steps..I think I can figure out the rest after that.
    Thanks in advance.

    Hi
    The Data Warehousing Workbench for installing BI Content has three navigation windows:
    In the left-hand window you determine the view of the objects in the middle area of the screen.
    In the middle window, you select the objects that you want to activate.
    In the right-hand window, you make the settings for installing the BI Content. The right-hand window also contains an overview of the objects you have selected, and it is here that you start installation of BI Content.
    In the Data Warehousing Workbench, you use the Navigation Window On/Off pushbutton in the toolbar to display or hide the left-hand navigation window. The rest of this section assumes that the left-hand navigation window is displayed.
    2. Assign Relevant Source Systems
    If you want to assign a source system, select the Source System Assignment function. The Choose Source System by Default? dialog box appears.
    Select one or more source systems by setting the corresponding indicators in the Default Assignment column.
    Only ever select the source systems that you really need, otherwise you may have to wait unnecessarily when objects are collected.
    The assignment of the source system is only relevant for source-system dependent objects (such as transfer rules, file DataSources, and InfoPackages). If more than one source system is available, only those objects assigned to the specified source system are collected ready for the transfer. Objects that have not been assigned to the specified source systems are ignored.
    For more information about the special features inherent in activating process chains that can reference source-system dependent objects, see the Customer Content documentation, under Process Chains and Process Variants.
    If you do not select a source system, all the source systems are assigned automatically. You can change your selection later using the Source System Assignment function.
    3. Group Objects To Be Included, Determine Mode of Collection for Objects
    Make the settings you require from the following selection lists on the right-hand side of the screen:
    Grouping
    Choose the objects that you want the system to include. The groupings combine the objects from a particular area. You have the following options:
    Only Necessary Objects (default setting)
    Data Flow Before
    Data Flow Afterwards
    Data Flow Before and Afterwards
    If you change the default setting (Only Necessary Objects), the new setting becomes the default setting for your user.
    The grouping selection has an impact on system performance during BI Content installation. For more information, see View of Objects and Object-Specific Recommendations.
    Collection Mode
    Select how you want to collect the objects:
    Collect Automatically (default setting): The data is collected when the objects are selected.
    Start Manual Collection: The data is only collected when you choose Collect Dependent Objects.
    Set the collection mode to Start Manual Collection. You can select all the objects without having to wait.
    4. Determine View of Objects
    In the left-hand navigation window, specify how you want the objects to be displayed. For more information, see View of Objects and Object-Specific Recommendations.
    5. Transfer the Objects to Collected Objects
    In the central area of the screen, select the objects that you want to install, and drag and drop them into the right-hand Collected Objects area of the screen.
    The Find Object function allows you to use strings of characters (for example, 0CUST) or wild card searches (for example, 0CUST_*B) to search for objects.
    Input help is available for every type of object: Double-click on the Select Objects icon in the tree structure of the corresponding object type to display the Input Help for Metadata screen. Select the required objects. Choose Transfer Selection.
    If you implement BI Service API Releases lower than 7.0 in the source system, you have to install the active version of the BI Content DataSources in the source system and replicate them in the BI system before you can use them for transferring data into BI. For more information, see Installing BI Content DataSources and Metadata Upload for SAP Systems.
    In the Collected Objects area of the screen, the system displays the selected objects and all dependent objects. Collected objects are stored by default in the repository cache. This reduces the time it takes to access these objects when you want to use them again.
    When you transfer objects into the Collected Objectsarea of the screen, these objects are also added to the tree structure of the corresponding object type in the central area of the screen and stored for your user. This personal object list can be called up each time the program is restarted.
    If you want to remove objects from your personal list, select the objects that you want to remove and choose the Remove Object from Display option from the context menu or click on the icon.
    Objects that are listed in several tree structures can only be changed in the place where they first appear. All additional instances of these objects are grayed out so you cannot modify them.
    6. Check Settings for Collected Objects
    Check the following columns in the Collected Objects area of the screen:
    Install
    The following BI Content objects are highlighted in this column by default:
    Objects that are being transferred for the first time. There is not an active version of these objects in the system.
    BI Content objects that have been redelivered in a new version. These objects can be identified by the Content time stamp in the corresponding object tables.
    When setting this indicator, check whether the checkbox refers to a folder of an individual object: If the checkbox refers to a folder, the indicator is set for all the objects that belong to this folder. If the checkbox refers to an individual object, the indicator is set for a single object and the indicators for the other objects in the folder are not changed. The same applies if you deselect this indicator.
    In the context menu, the following options are available for the installation:
    a. Install All Below
    The object in the selected hierarchy level and all objects in the lower levels of the hierarchy are selected as to Install.
    b. Do Not Install All Below
    The Install indicators are deselected for the object in the selected hierarchy level and all objects in the lower levels of the hierarchy.
    Match (X) or Copy
    If the SAP delivery version and the active version can be matched, a checkbox is displayed in this column.
    With the most important object types, the active version and the SAP delivery version can be matched.
    Note that the InfoSource TRCS supports the match, but the 3.x InfoSource ISTD does not.
    From a technical point of view, the SAP delivery version (D version) is matched against the M version. As in most cases the M version is identical to the active version (A version) in a customer system, this is referred to as a match between the D and A versions for reasons of simplification.
    When a match is performed, particular properties of the object are compared in the A version and the D version. First it has to be decided whether these properties can be matched automatically or whether this has to be done manually. If you are sure that the object will be used in the same way after you install BI Content, you can perform an automatic match for those properties. When performing matches manually you have to decide whether the characteristics of a property from the active version are to be retained, or whether the characteristics are to be copied from the delivery version.
    Assign points if useful.
    Thanks & Regards,
    Hari

  • LSMW How to compare projects from 2 diffrent systeme ?

    Hello all,
    I need to know how to compare all the lsmw object from one systeme to another systeme,
    ex : form D01 (4.6) to DC1 ECC
    more information :
    this is the table which contain all information about lsmw :
    /SAPDMC/LSOINP
    thanks

    we know that LSMW will generate abapcode in step generate conversion program by using display conversion program notedown the program name: like that second one also and go for se39.
    and follow the steps to compare the program from one system to another system how just normal report we do.
    just have a try.
    All the best

  • How to compare an Object of type class?

    Hi,
    I got a generic array and want to check which class it contains.
    Now i tried to use
    Class c = T[0].getClass();and later
    if(c instanceof Float){
    }but this don't work.
    So how to compare two instances of Class?
    Maybe by looking for the name of the class and compare them?
    regards.
    Olek

    import java.util.*;
    public class WorksForMe {
        public static void main(String[] args) {
            List<Object> list = new ArrayList<Object>();
            list.add(Float.valueOf(17));
            Class<?> cls = list.get(0).getClass();
            System.out.println(Float.class.equals(cls)); //true
            System.out.println(Float.class == cls); //true
    }But again, it's best to avoid this kind of case analysis.

  • How to compare two Objects !!!!

    Hi All,
    I know that this question has been asked 100 times till now. But trust me I have checked all of them but couldn`t find answer. Here is my question:
    I have an objecs. In that object I am setting (Id,Name,DOJ). Now I want to check whether the object I am trying to save in database already exists or not. If exists then I need to check whether all the setters are same for the two objects. Now can anyone tell me ,how to compare two objects directly without comparing the setters individually.
    Thanks in advance.

    pavan13 wrote:
    That is pretty good idea. However I have a query. Does that code actually compare all the setters in a two beans. I don`t want to check each setter seperately.Well, it's pretty meaningless to talk about "comparing setters", setters are methods, they don't have values to compare. Because equals is inside the class, you can simply compare the fields that get set by the setters. "Properties" is probably a better name.
    In principal you could write something that tried to find all relevant fields and compare them, using reflection or bean info stuff. The resulting code would be about 50 times longer and take about 50 times longer to run. It's hardly asking a lot to put three comparisons between && operators.
    Remember, though, not to compare string fields with ==, you should call .equals on the string fields.
    p.s. don't let the bean terminology confuse you. Beans are just ordinary objects which follow a few rules. Personally I wish the term had never been coined.
    Edited by: malcolmmc on Dec 6, 2007 4:15 PM

  • How do you retrieve a Collection of objects using JDBC?

    How do you retrieve a Collection of objects using JDBC.
    MORE INFO:
    I have created a class i.e. Account class and I want to retrieve all the accounts previously created for accounts in my Mysql database..
    my method would retrieve an array of Account instances in the database i.e.
    public Vector retrieveAccounts();

    Connection con = null;
    ArrayList accounts = new ArrayList();
    try{
      con = DriverManager.getConnection(...);
      PreparedStatement ps = con.prepareStatement("select * from accounts");
      Resultset rs = ps.executeQuery();
      while (rs.next()) {
        Account account = new Account(rs.getString(1), rs.getString(2), ...);
        accounts.add(account);
      Account[] account_array = new Account[accounts.size()];
      accounts.toArray(account_array);
    catch (SQLException sqle) {
       sqle.printStackTrace();
    finally {
      if (con != null) {
        con.close();
    }should pretty much to what you want, you will obviously need to change it so that, a) the SQL query is correct and b) the Account class is correct and c) the correct values are taken from the result set to create an account.

  • How to compare objects between systems

    Hi,
    At the moment I am busy activating business content in BW for an SAP IS-U project. Here I encounter the following problem:
    In the past others have been activating business content objects and they have assigned a developer class to it. Then they decided they did not need those objects and they deleted their transports.
    Now when I want to transport objects to the acceptance environment quite often transports fail due to missing objects (which have never been transported). The automated activation does not include these dependent objects, as it thinks they are already available.
    Is there a way to compare two systems to see which objects are missing and need transporting (without sifting through each InfoObject/transfer rule etc by hand to check its existence)?
    Preferrably I would like to know table names so I can compare SE16 lists, but other suggestions are also more than welcome.
    Otherwise an easy way to see the technical names of those objects so that I can add them manually to a transport request?
    Thank you very much,
    Crispian

    Hi Crispian,
    Welcome to SDN!!
    You can use the following tables for comparing:
    RSDIOBJ - For info-objects
    RSDCUBE - For Cubes
    RSDAREA - InfoAreas
    RSDCHA - Characteristic Catalog
    RSDCUBEIOBJ - Objects per InfoCube (where-used list)
    RSDIOBC - InfoObject catalogs
    RSDIOBCIOBJ - InfoObjects in InfoObject catalogs
    RSDKYF - Key figures
    RSIS - InfoSource (transaction data)
    RSTSRULES - Transfer structure transfer rules
    RSDODSO - ODS
    Hope this helps.
    Bye
    Dinesh
    <i>Assigning point to the helpful answers is the way of saying thanks in SDN. you can assign points by clicking on the appropriate radio button displayed next to the answers for your question. yellow for 2, green for 6 points(2)and blue for 10 points and to close the question and marked as problem solved. closing the threads which has a solution will help the members to deal with open issues with out wasting time on problems which has a solution and also to the people who encounter the same porblem in future. This is just to give you information as you are a new user.</i>
    Message was edited by: Dinesh Lalchand

  • How to sort a collection based on their date?

    how do i sort a collection based on their respective dates which are in Calendar format?

    this is my codes
    /** This class is use to sort the call list base on their date
    import java.util.*;
    public class a implements Comparator
         /** compare the objects base on their types
         *     @obj1 the first object to be compared
         *     @obj2 the second object to compare with the first object
         public int compare(Object obj1, Object obj2)
         if (obj1 == obj2)
              return 0;
         if (obj1 == null || obj2 == null)
              return 0;
         if (!(obj1 instanceof Call) || !(obj2 instanceof Call))
              return 0;
         Call lhs = (Call) obj1;
         Call rhs = (Call) obj2;
         int s = lhs.getDate().compareTo(rhs.getDate());
         if (s != 0)     
              return s;
         return 1;
    this is the error
    a.java:21: cannot resolve symbol
    symbol : method compareTo (java.util.Calendar)
    location: class java.util.Calendar
         int s = lhs.getDate().compareTo(rhs.getDate());

  • Client code cast error:EJB returning data in Collection of Objects

    Still trying to understand this EJB stuff.....
    My BMP EJB returns data to the client in a collection of objects;
      // Home interface (CountryHome) nothing unusual here
      public Collection findAllCountries()
      //Remote interface (Country) nothing unusual here
      public CountryModel getDetails()The data object is a serialised object;
      // data object - nothing strange here
      public class CountryModel implements Serializable {
        private int countryId;
        private String countryName;
        public CountryModel () {......etc etc
        public CountryModel getDetails()  {.......etc etc
        public String toString() { ...etcWhen I try and get at the data from the collection in the client code, calling getDetails() in CountryModel causes a cast exception. How can I get at the data?
      Collection a = home.findAllCountries();
      Iterator i = a.iterator();
      while (i.hasNext()) {
        Object obj = i.next();
        Country country = (Country)
             PortableRemoteObject.narrow(obj, Country.class);
        // this fails with class cast exception.....
        System.out.println(country.getDetails());And to add to the confusion, why does calling the remote interface's getPrimaryKey() method in the client code invoke the toString() method in the CountryModel class and work?
      while (i.hasNext()) {
        Object obj = i.next();
        Country country = (Country)
             PortableRemoteObject.narrow(obj, Country.class);
        // have no idea why this works.....but it does.....
        System.out.println(country.getPrimaryKey());Thanks, lebo

    hi,
    you are getting a collection of serializable objects and not remote objects. the narow method has to be applied only for remote objects (actually it is the stub that will be received on the client side).
    so you modify your code as,
    Collection a = home.findAllCountries(); Iterator i = a.iterator(); while (i.hasNext()) {    Object obj = i.next();    Country country = (Country)obj;
    this will definitely solve the problem.
    regards
    srini

  • How to list an array of objects using struts in jsp and ActionForm

    I am using the struts ActionForm and need to know how to display an Array of objects. I am assuming it would look like this in the ActionForm:
    private AddRmvParts addRmv[];
    But I am not sure how the getter and setter in the ActionForm should look. Should it be a Collection or an Iterator?
    I am thinking I need to use an iterator in the jsp page to display it.
    I am also wondering if the AddRmvParts class I have can be the same class that gets populated by the retrieval of data from the database. This class has 10 fields that need to display on the jsp page in 1 row and then multiple rows of these 10 fields.
    Thanks.

    Most probably the easiest way to make it accessible in your page is as a collection.
    ie
    public Collection getAddRmvParts()
    You can use the <logic:iterate> or a <c:forEach>(JSTL) tag to loop through the collection
    As long as the individual items in the collection provide get/set methods you can access them with the dot syntax:
    Example using JSTL:
    <c:forEach var="addRmvPart" items="${addRmvParts}">
      <c:out value="${addRmvPart.id} ${addRmvPart.name} ${addRmvPart.description}"/>
    </c:forEach>

  • How to use a collection in ADF

    Hi all,
    How to use the collection in ADF.
    Thanks in advance
    C.Karukkuvel

    hi John,
    Scenario:
    In my page,i have two tab pages .In that when the user enter the Location names in the first tab.when the user navigates to the next tab,we need to give the LOV having the Loactions based on the first tab values.
    when i try to use the view object it will list only the data's in the database.but i needs the locations entered in the current page also.pls guide me in this
    Thanks & Regards
    C.Karukkuvel

  • How to compare all ABAP Programs (Workbench) between system?

    Hi BASIS Guru,
    Please kindly guide me How to compare all ABAP Programs (Workbench) between system?
    I have copy client (Export/Import) from PRD to DEV but I have some error about abap programs does not exist.
    For example COPA workbench object (Table and ABAP Program).
    Please kindly help.
    Thank you very much.
    Best Regards,
    Saiya

    Hi,
    You can use SE39 to compare your programs.
    Regards,
    Vijay

Maybe you are looking for