Filter collection

Hi all

Need your advice in a scenario, I created 2 collection with the same structure and move another collection 1 collect data by using a condition and I wonder if someone check my logic or suggest me a better solution. I tried to convert my script using the EMP table. Please find below my code and appreciate your answers. Thank you

Code

SET serveroutput ON

DECLARE

TYPE c_emp IS the TABLE OF THE emp % rowtype;

TYPE c_emp_filter IS TABLE OF THE emp % rowtype;

v_emp c_emp;

v_emp_filter c_emp_filter:=c_emp_filter();

BEGIN

SELECT *-empno, ename, JOB, mgr, hiredate, sal, comm, deptno

TO COLLECT FEES IN BULK

IN v_emp

EMP;

BEGIN

-Transfer of items in collection v_emp in v_emp_filter but only deptno = 10

I'm looping 1.v_emp.count

IF v_emp (i) .deptno (10) THEN

v_emp_filter. EXTEND (1);

v_emp_filter (v_emp_filter. Last): = v_emp (i);

END IF;

END loop;

BEGIN

FOR j IN loop 1.v_emp_filter.count

dbms_output.put_line (v_emp_filter (j) .empno);

END loop;

END;

END;

END;

---------------

First I move all the data in my 1st collection (v_emp) and then based on this data I have filter it in my other v_emp_filter in the collection. The above codes work properly, but if someone suggest me a way to filter the data in the collection then I really appreciate it. Thank you

Concerning

Line

So, the easiest solution would simply re - select from EMP in the collection filtered (using the filter condition). Another solution is to create corresponding types of O - R (unless you use 12 c, in which case you can now reference local collection PL/SQL types in embedded SQL) to refer to these types in embedded SELECT statements:

create or replace type o_emp is object (...);
create or replace type c_emp is table of o_emp;

DECLARE
    v_emp c_emp;
    v_emp_filter c_emp;
BEGIN
    SELECT    new o_emp( empno,ename,JOB,mgr,hiredate,sal,comm,deptno )
    BULK COLLECT
    INTO    v_emp
    FROM    emp;  

    SELECT    value(emp) --empno,ename,JOB,mgr,hiredate,sal,comm,deptno
    BULK COLLECT
    INTO    v_emp_filter
    FROM    table(v_emp) emp
    WHERE   emp.deptno IN (10);

    BEGIN
        FOR j IN 1..v_emp_filter.count loop
            dbms_output.put_line(v_emp_filter(j).empno);
        END loop;
    END;
END;

Gerard

Tags: Database

Similar Questions

  • Filter collection arrayCollection based on elements in another table?

    I have a table that contains several values: ["361 364"] = array1

    Here's the id references that change frequently.

    I have an arrayCollection collection that contains a bunch of files. I have experience of writing code to perform simple filtering of my collection arrayCollection using the filterFunction function and a simple piece of criteria.

    I am trying to reach a loop for filtering my arrayCollection collection to look at the number of element in array array1 and then filter my arrayCollection collection, leaving only entries that match the id numbers in array1.

    I am using a ".. for each" loop but I do not understand the result I need...

    Sample:

    public var matchingID:int:

    private function filterArray (): void
    {
    for each (var i: int array1)
    {
    matchingID = i;
    arrayCollection.filterFunction = checkIDs;
    }
    arrayCollection.refresh ();
    }

    private void checkIDs(item:Object):Boolean
    {
    If (item.id is matchingID)
    {
    Returns true;
    }
    on the other
    {
    Returns false;
    }
    }


    When I run this code I find myself alone with a collection consisting of single entry, arrayCollection which is the last. My brain is frozen trying to understand this one. The values and the amount of values will vary in array1 I am looking for a loop of filtering for arrayCollection collection that works no matter how many values of array1 is.

    Any creative ideas?

    You wanted to probably say array1 = [361, 364], right?

    Try this.

    TS

  • Failed to retrieve my collections on my CRD.

    Unable to retrieve my collections (several). Try al I know. Then right-click on the Collections, the option is selected, but at the end of the name, there is a 'star '.

    I have had no selected filter collections have been created. Hope you can help me. Thank you. Zach

    Hi again.  Maybe I explaining well. I have several collections in the CRD. Work with them all the time

    as well as create new ones. I must have done something to create this problem. I have not intentionally

    deleted for sure. The 'star' at the end of the word Collection when right click must have a sense that I can't solve. I would like your suggestions. Thank you. Zach

  • ISE 1.4 - silent authentications

    Hello

    I have a distributed deployment of ISE 1.4 with all PSN residing behind F5 NLB nodes. A probe of health of RADIUS has been configured to query each PSN in the NETWORK load balancing pool to check its status. Problem is that it creates journal entries 1444 authentication an hour. The graph of the dashboard is now an empty block of sense of successful authentications.

    Is he in any case of this RADIUS tuning probes? As the syslog ' ~'.

    see you soon,

    SEB.

    I'm sure you can use the filter collection for this feature, go to Administration/logging / filters

    Here, you can add an entry and then select NAS IP and the address of the device of the probe, and then use the filter "passed."

  • Data primary bucket

    I was wondering if it is possible to get only the entries in the primary bucket after calling the PartitionListener.afterPrimary method? I noticed that the afterPrimary has a bucketId parameter passed. The bucketId can be used to get the entries in the bucket? Should what API I use for this?

    You can use a function to iterate over the keys in your bucket.

    The bucketId which is passed can be used to perform a function as follows:

    Adjust the filter = Collections.singleton (bucketId);

    FunctionService.onRegion (pr) .withFilter (filter). Run (new PrimaryDataIterator()) .getResult ();

    The function itself can be defined as follows:

    class PrimaryDataIterator extends FunctionAdapter {}

    This will make the function running on primary bucket

    @Override

    public boolean optimizedForWrite() {}

    Returns true;

    }

    iterate over the data

    public void execute (FunctionContext context) {}

    RFC RegionFunctionContext = (RegionFunctionContext) context;

    Region r = PartitionRegionHelper.getLocalDataForContext (rfc);

    you have access to the keys in your primary bucket

    }

    }

  • Content of the server to check in content - URGENT error

    Unable to filter ' collections. CollectionValidateCheckinData' of type 'postValidateCheckinData '. Failed to instantiate the java class code ' collections. CollectionValidateCheckinData' the location 'collections. CollectionValidateCheckinData' location defaults to the ' collections. CollectionValidateCheckinData'. java.lang.ClassNotFoundException: collections. CollectionValidateCheckinData [details]

    An error has occurred. The stack trace below shows more information.

    ! $awappp54:! csUserEventMessage,AZLIFEM\\azl6u3d,inetucm.azlifem.azl.pvt!$!apFilterInstantiationError,collections. CollectionValidateCheckinData, postValidateCheckinData! apUnableToInstantiateClass, collections. CollectionValidateCheckinData, collections. CollectionValidateCheckinData, collections. CollectionValidateCheckinData! syExceptionType2, java.lang.ClassNotFoundException, collections. CollectionValidateCheckinData

    intradoc.common.ServiceException:! apFilterInstantiationError, collections. CollectionValidateCheckinData, postValidateCheckinData! apUnableToInstantiateClass, collections. CollectionValidateCheckinData, collections. CollectionValidateCheckinData, collections. CollectionValidateCheckinData

    at intradoc.shared.ComponentClassFactory.createClassInstance(ComponentClassFactory.java:161)

    at intradoc.shared.PluginFilters.filter(PluginFilters.java:70)

    at intradoc.server.DocServiceHandler.validateCheckinData(DocServiceHandler.java:1399)

    at sun.reflect.GeneratedMethodAccessor44.invoke (unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:585)

    at intradoc.common.IdcMethodHolder.invokeMethod(ClassHelperUtils.java:617)

    at intradoc.common.ClassHelperUtils.executeMethodReportStatus(ClassHelperUtils.java:293)

    at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:79)

    at intradoc.server.Service.doCodeEx(Service.java:490)

    at intradoc.server.Service.doCode(Service.java:472)

    at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1360)

    at intradoc.server.Service.doAction(Service.java:452)

    at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1201)

    at intradoc.server.Service.doActions(Service.java:447)

    at intradoc.server.ServiceRequestImplementor.executeSubServiceCode(ServiceRequestImplementor.java:1071)

    at intradoc.server.Service.executeSubServiceCode(Service.java:3497)

    at intradoc.server.ServiceRequestImplementor.executeServiceEx(ServiceRequestImplementor.java:942)

    at intradoc.server.Service.executeServiceEx(Service.java:3492)

    at intradoc.server.Service.executeService(Service.java:3476)

    at intradoc.server.Service.doSubService(Service.java:3465)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:585)

    at intradoc.common.IdcMethodHolder.invokeMethod(ClassHelperUtils.java:617)

    at intradoc.common.ClassHelperUtils.executeMethodEx(ClassHelperUtils.java:279)

    at intradoc.common.ClassHelperUtils.executeMethod(ClassHelperUtils.java:264)

    at intradoc.server.Service.doCodeEx(Service.java:507)

    at intradoc.server.Service.doCode(Service.java:472)

    at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1360)

    at intradoc.server.Service.doAction(Service.java:452)

    at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1201)

    at intradoc.server.Service.doActions(Service.java:447)

    at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1121)

    at intradoc.server.Service.executeActions(Service.java:433)

    at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:635)

    at intradoc.server.Service.doRequest(Service.java:1707)

    at intradoc.server.ServiceManager.processCommand(ServiceManager.java:359)

    at intradoc.server.IdcServerThread.run(IdcServerThread.java:197)

    Caused by: java.lang.ClassNotFoundException: collections. CollectionValidateCheckinData

    in java.net.URLClassLoader$ 1.run(URLClassLoader.java:200)

    at java.security.AccessController.doPrivileged (Native Method)

    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

    to Sun.misc.Launcher$appclassloader$ AppClassLoader.loadClass (Launcher.java:268)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

    at java.lang.Class.forName0 (Native Method)

    at java.lang.Class.forName(Class.java:164)

    at intradoc.shared.ComponentClassFactory.createClassInstance(ComponentClassFactory.java:148)

    ... 39 more

    Hi all

    I restarted the IDC content management service and it worked. Thanks for looking at my question.

    Thank you

    Aerts

  • Layout to the bridge (CS5)

    When I used Bridge & CS5, I had what seemed to me a very satisfactory layout. On the left side were: metadata, bookmarks and folders. Below: filter, Collections and export. To the right of these was a portrait of the images in the folder "film". And to the right of this band is a Preview Panel (forgive me if the names are false). However, at some point given, I clicked on something and now 'film' is horizontal and under the preview. It would not too, but either I do the film a bunch of very small, or preview is not big enough. How do I drag the band so that it is vertical again?

    Thank you

    David

    In Bridge, you could try window > Workspace > overview, but you will probably need to go to the window and check the metadata Panel so that it appears as described above.

    Bridge works similar to photoshop to be able to dock and move the panels and once you get bridge to setup as you want, you can go to the window > workspace > new workspace.

    MTSTUNER

  • ISE 1.1.1 Collection filter

    Hello

    I wanted to ask if there is a collection filter in the ISE similar to 5.3 ACS, where I can filter unwanted syslogs.

    Kind regards

    Patrick

    The "equivalent ACS: collection filter" is not yet supported. This is intended to point 1.2 of the ISE

    Jatin kone

    -Does the rate of useful messages-

    Understanding Collection Filters You can create collection filters that allow you to filter and drop syslog events that are not used for monitoring or troubleshooting purposes. When you configure collection filters, the Monitoring & Report Viewer does not record these events in the database and saves much needed disk space."
  • How to filter the catalog images that are/are not in a collection?

    Hi all.

    Simple enough question: how to filter for images of catalog that are or are not in a collection?

    I want to know this, so when I'm removing not classified images can I make sure I have avoid the dumping of those I have added to a collection, but neglected to give them a rating.

    Thank you


    David

    There are two non-obvious ways to find photos that are not in any regular collection of (non-puce):

    1. to add all these photos in the quick Collection:

    1. In the catalog Panel, right click on the Collection quick and make clear quick Collection.
    2. In the catalog Panel, select all photographs.
    3. Photo > stacking > expand all stacks.
    4. In the Collections Panel, select all collections by clicking on the first collection and then shift-click on the last one. If you don't want to include smart collections, then Ctrl/Cmd-click on them in order to exclude them.
    5. Edition > select all.
    6. In the catalog Panel, select all photographs.
    7. Edition > reverse selection.
    8. Photo > add to quick Collection.

    2 create a smart collection with the following criteria:

    Collection does not contain a b c d... z 1 0... 9

  • problem with filter smart collection

    Hello

    I know that this question could be covered widely in various forums, but I can't find what I'm looking for.

    The issue I'm having is that I used the quick Collection folder to temporarily store all the photos that I have edited for printing.  All of a sudden all the photos of this quick collection have broken links (! in the upper right corner).  I found these pictures in the real LR folder and they are fine.  How is that possible?

    instead of fixing all the links in the quick collection, I would like to use a smart collection just find all my photos edited in the original folder that has the tact in links.  However, when you filter for "adjusted photos" the smart collection keeps giving me photos with broken links, probably from my quick collection, not those of the foler.  How do I know the smart collection to search only in one folder I want?

    I hope that this logic... I can clarify if necessary.  Thank you!

    Hi, you seem to be confused about the importance of brands of exclamation noticed on the images.

    This means that the catalog as a whole has lost track of these images.

    The most likely reason is that they have been moved to another location by using the operating system or one application other than Lightroom or they are on an external hard drive where the assigned drive letter changed (a Windows problem).

    I do not understand your comment on find them in the "real" LR folder

    Images are not stored in Lightroom, either.

    The catalog contain references to the location of your pictures.

    It is these references that are spread over the images showing the exclamation points.

    If the Smart collection has been implemented correctly then it will want to include all the images that have been published for printing, but the Smart collection is SEO information found in the catalogue and so it will include images of which the catalogue has lost track of--exactly as you found it.

    Tony Jay

  • Smart collection returns different results to the library filter?

    This is such a stupid thing, and I barely noticed. I have smart collections simply gather all the images with a particular star of note, very very simple! I have a 1 star, a Star 2 and one for the 3 stars and more. So far so good, use these for centuries-, but I noticed that if I go to Catalog/All photos and place a filter of the same library (this is the filter at the top of the library grid view) I get different results. Actually if I place a filter attribute that says '= 2 stars' images only I can watch the tape that works at the bottom of the screen (sorry I have no idea what it's called) and he said that "all photos / 1056 1647 photos» If I can clear this filter and scroll down to my smart collection that applies the filter even to the entire catalog (and I triple checked this, no difference at all, I don't have lower or higher than the here is the self same "=" only!) and it says "1066"! Thus, the smart collection search 10 images more than other, identical filters working on the entire catalog - I am confused? Anyone had this problem, I missed something? If it wasn't for the number of images concerned I'd them and try to find the additional files by hand!

    Popular indices, and LR3 passing on Mac.

    Tim.

    You can check if the images are stacked differently (and thus not counted) in both points of view.

  • Get 'no photos matching the filter' in the collections, but not sets of collections during the search.

    I can't use the filters in the library collections that return no results despite the fact that there are valid search criteria. Images with a star ratings do not appear when filters are the nominal value in the collection. Filters will return the result when searching in the collection sets however. I'm puzzled. Is this a bug?

    Found it... the 'used' filter preset in the menu dropdown was selected but hidden.

  • Filter or Smart Collection by time Photo taken

    I had a good look for an answer to this, but not found anything. Unless I'm missing something obvious I think that there is no solution (yet).

    Is Lightroom 3.4, there a way to filter or set parameters for a smart collection, based on the time that a photo was taken?

    For example, if I want to see all my pictures taken between, say, 18:00 and 19:00.

    It would be for large groups of pictures, so sorting by capture time, and then selecting manually would be inappropriate. I am looking for an automated solution.

    Thanks for any help.

    Adrian

    I don't think there is a solution to this (I tried a text search, nothing done).

    Beat

  • How do I filter the Array collection

    Hello friends

    I do a simple little application in which I use a Datagrid collection and table as a dataprovider.just like that.

    private var mainArrcollection:ArrayCollection = new ArrayCollection([)
    {name: "vineet" rollno: ' 14', age: '24'},
    {name: "osho" rollno: ' 15', age: '34'},
    {name: "sharma" rollno: ' 16', age: '44'}
    ]);

    now I want to filter a specific data on this arraycollection.i: change the dataprovider to

    private var tempArrcollection:ArrayCollection = new ArrayCollection([)
    {name: "osho" rollno: ' 15', age: '34'},
    ]);

    Click some button on and set this new array as a dataprovider to on.can datagird, and therefore any body guide me how to achieve this function.

    Thank you and best regards

    Vineet Osho

    Hi Aditya,

    You can do something like this...


    http://www.Adobe.com/2006/mxml"layout ="absolute"creationComplete =" onCreationComplete () ">"

      Import mx.utils.ObjectUtil;
    Import mx.collections.ArrayCollection;
    [Bindable] private var mainArrcollection:ArrayCollection = new ArrayCollection([)
    {name: "vineet" rollno: ' 14', age: '24'},
    {name: "osho" rollno: ' 15', age: '34'},
    {name: "sharma" rollno: ' 16', age: '44'}
    ]);

    [Bindable] private var dgArrcollection:ArrayCollection = new ArrayCollection();
      
      
    private function onCreationComplete (): void
    {
    dgArrcollection.addItem (mainArrcollection.getItemAt (comboBox.selectedIndex));
    }
    private void comboBoxChangeHandler(event:Event):void
    {
    var _selectedIndex:int SelectedIndex = (event.currentTarget as ComboBox)
    dgArrcollection.removeAll ();
    dgArrcollection.addItem (mainArrcollection.getItemAt (_selectedIndex));
    }
    ]]>


              
     
                  
                  
      
     


    Thank you

    Jean Claude

  • Filter objects of a collection of duplicate objects

    I am running a report that lists the created virtual machines based on the event logs.  If the initial supply fails, the virtual machine is removed and recreated with the same name.  The report shows these VMs twice instead of once.  How can I remove objects in double vm of the release of the report?   If the VM names are the same, and they are not in different vCenters, whereas they are duplicates.

    Thank you!

    $start =(Get-Date). AddDays(-7)

    $finish =(Get-date) .adddays (0)

    $report = get-VIEventPlus-start $start - finishing $finish |

    Where-Object {"VmCreatedEvent", "VmClonedEvent", "VmDeployedEvent" - contains $_.} GetType(). Name} | %{

    $evtThisNewVMEvent = $_

    Try {}

    $vm = get-VM-Id $_. Vm.VM - ErrorAction Stop

    }

    Catch {}

    return

    }

    $vm | Select @{N = 'The virtual computer name'; {E = {$_.name}},

    @{N = "vCenter Server"; E={$_. "Uid.Split(":") [0]." {{Split("@") [1]}},

    @{N = "Createduserid"; {E = {$evtThisNewVMEvent.createdTime}}.

    @{N = "created by";} {E = {$evtThisNewVMEvent.UserName}},

    } | Sort-Object Createduserid

    $report | report.csv - notypeinformation - useculture csv export

    Yes, you could make a

    Tri-objet-unique VMID

Maybe you are looking for