Collection based loop

Hi!
I've been trying write a collection based loop for a program but only been able to use it on an enum. The code it the following
public class Collection {
enum Words { one, two, three };
     public static void main(String args[])
          for (Words word: Words.values())
               System.out.println(word);
}But I can't seem to get i to work for arrays. I've done some googling but I haven't found any useful code out there. Is there a way to do this?
/MJ

MidnightJulia wrote:
Sure, but why doesn't the code accept an array as an argument? I can get the enum to be accepted as an argument but not an array. The following code is not accepted and I've not been able to make it work. Why do you want to call .values() on the array? Arrays don't have such a method. Simply write "Words" there.
Also, you should really follow the naming conventions. At least give your variables lower-case names ("words" instead of "Words"), otherwise it'll get easy to confuse them with types (classes/interfaces/enums/annotations usually start with a capital letter, such as "String", "Integer", "Collection", "MyFirstClass", ...).

Similar Messages

  • Collection-Based For Loop Troubles!

    I am trying to compile this code from the book "Beginning Java 2: JDK 5 Edition" by Ivor Horton, using XCode on a Mac with SDK 1.4 (I know that the book is for JDK 5, but I figure that the first 5 chapters or so are going to be basic enough that it won't matter?):
    public class StringTokenizing {
    public static void main(String[] args) {
    String text = "To be or not to be, that is the question.";
    String delimiters = "[, .]";
    int[] limits = {0, -1};
    for(int limit : limits) {
    System.out.println("\nAnalysis with limit = " + limit);
    String[] tokens = text.split(delimiters, limit);
    System.out.println("Number of tokens: " + tokens.length);
    for(String token : tokens) {
    System.out.println(token);
    But, just as with EVERY code involving collection-based for loops -- In this case, the "for(int limit : limits)" statement, etc -- the compiler won't do it. The error points to that line and just says "; expected" as if it has no idea what to do with for loops that are not in the for (x ; x ; x) format...
    ...Grrrr. This is really starting to make it impossible to follow the examples in the book. Can someone help me?
    Thanks!
    -matt

    Kay, have you asked a written permission prior to posting that reply
    while I was posting my reply hm? I guess you didn't.
    kind regards,
    Jos (it's all anarchy and chaos overhere ;-)
    ^
    |
    +----- slow old sod                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How do i loop through a pl/sql collection based on a condition.

    hi, can any one help me or provide me sample code where  i have to loop through a collection  based on condition . just like where clause in sql. your help is highly appreciated....
    {code}
    create table MODEL1
      model_id  NUMBER ,
      model_seq NUMBER,
      p_ind     VARCHAR2(1)
    insert into model1 (MODEL_ID, MODEL_SEQ, P_IND)
    values (4, 103, 'U');
    insert into model1 (MODEL_ID, MODEL_SEQ, P_IND)
    values (3, 102, 'P');
    insert into model1 (MODEL_ID, MODEL_SEQ, P_IND)
    values (2, 101, 'U');
    insert into model1 (MODEL_ID, MODEL_SEQ, P_IND)
    values (1, 100, 'P');
    MODEL PROCEDURE......
    procedure (  param1,param2)        ( assume this procedure is being called from other procedure and collection has been populated already)
    TYPE  l_tab is table of  MODEL1%rowtype;
    begin
    loop through l_tab records where  ltab.model_id=param1  and  p_ind =p
    Join based on if else condition.
    if   param2 is not null then
       l_tab.model_seq=param2 and ltab.p_ind='P'
    if param2 is null then
             l_tab.p_ind='P'          etc...........
       {code}

    Hi,
    Try something like this:
    DECLARE
    TYPE L_TAB IS  TABLE OF MODEL1%rowtype;
    TAB L_TAB;
    param1 number := 1;
    param2 number := 999;
    BEGIN
    select
      model_id
      ,model_seq
      ,p_ind
    bulk collect into TAB
    from
      MODEL1
    DBMS_OUTPUT.PUT_LINE('PARAM1: ' || PARAM1);
    DBMS_OUTPUT.PUT_LINE('PARAM2: ' || PARAM2);
    DBMS_OUTPUT.PUT_LINE('     MODEL_ID, MODEL_SEQ, P_IND' );
    FOR X IN TAB.FIRST .. TAB.LAST
    LOOP
    DBMS_OUTPUT.PUT_LINE('OLD: ' || TAB(X).MODEL_ID || '         ' || TAB(X).MODEL_SEQ || '        ' || TAB(X).P_IND );
        IF TAB(X).model_id = param1 AND TAB(X).p_ind = 'P' THEN
          IF param2       IS NOT NULL THEN
            TAB(X).model_seq := param2;
    --        TAB(X).p_ind := 'P';     -- THIS IS NOT NEEDED SINCE THE CONDITION STATE L_TAB(X).P_IND = 'P' ALREADY
    NULL;
          END IF;
          IF param2     IS NULL THEN
    --          TAB(X).p_ind  := 'P'; -- THIS IS NOT NEEDED SINCE THE CONDITION STATE L_TAB(X).P_IND = 'P' ALREADY
    NULL;
          END IF;
        END IF;
    DBMS_OUTPUT.PUT_LINE('NEW: ' || TAB(X).MODEL_ID || '         ' || TAB(X).MODEL_SEQ || '        ' || TAB(X).P_IND );
    END LOOP;
    END;
    PARAM1: 1
    PARAM2: 999
         MODEL_ID, MODEL_SEQ, P_IND
    OLD: 4         103        U
    NEW: 4         103        U
    OLD: 3         102        P
    NEW: 3         102        P
    OLD: 2         101        U
    NEW: 2         101        U
    OLD: 1         100        P
    NEW: 1         999        P
    Regards,
    Peter

  • Can I bulk collect based on a date variable?

    I'm want to use some sort of Bulk collect to speed up this query inside a PL/SQL block (we're in 10g). I have seen examples of using a FORALL statement but I don't know how to accommodate the variable v_cal_date. My idea is to be able to run the script to update a portion of the table "tbl_status_jjs" based on a date range that I provide. tbl_status_jjs contains a list of dates by minute of the day for an entire year and a blank column to be filled in.
    I though of using something like FORALL v_cal_date in '01-apr-2009 00:00:00'..'01-jun-2009 00:00:00' -- somehow need to increment by minute!? ... but that doesn't seem right and i can't find any exmples of a bulk collect based on a date. How do I bulk collect on a date variable? Can I use the date/time from a subset of records from the final table in some sort of cursor?
    Thanks
    Jason
    -- loop through one day by minute of the day and update counts into table  
    v_cal_date Date       :=TO_DATE('01-apr-2005 00:00:00','dd-mm-yyyy hh24:mi:ss');
    intX := 1;
    WHILE intX <= 1440 LOOP
        UPDATE tbl_status_jjs
               SET  (cal_date, my_count) =
                    (SELECT      v_cal_date,
                                 NVL(SUM(CASE WHEN v_cal_date >= E.START_DT AND v_cal_date < E.END_DT THEN 1 END),0) AS my_count
                     FROM        tbl_data_jjs E
               WHERE cal_date = v_cal_date;
        v_cal_date := v_cal_date + (1/1440);
        intX := intX + 1;
        COMMIT;
    END LOOP;

    Here are the two tables. The goal is to find an efficient way to count how many records in tbl_data have a start_dt before and a end_dt after each cal_date in tbl_status.
    01-apr-2005 00:05:00 ==> 3
    01-apr-2005 00:25:00 ==> 1
    DROP TABLE tbl_status;
    CREATE TABLE tbl_status
    (   CAL_DATE    DATE,
        MY_COUNT    NUMBER);
    DECLARE
        start_date Date       :=TO_DATE('01-jan-2006 00:00:00','dd-mm-yyyy hh24:mi:ss');
        end_date   Date       :=TO_DATE('01-jan-2006 01:00:00','dd-mm-yyyy hh24:mi:ss');
    BEGIN
        INSERT INTO tbl_status (CAL_DATE)
        SELECT  start_date + ( (LEVEL - 1) / (24 * 60))
        FROM    dual
        CONNECT BY    LEVEL <= 1 + ( (end_date - start_date) * (24 * 60) );
    END;
    DROP TABLE tbl_data;
    CREATE TABLE tbl_data
    (   START_DT    DATE,
        END_DT      DATE);
    INSERT INTO tbl_data VALUES (TO_DATE('2006-01-01 00:05:00', 'yyyy-mm-dd hh24:mi:ss'), TO_DATE('2006-01-01 00:15:00', 'yyyy-mm-dd hh24:mi:ss'));
    INSERT INTO tbl_data VALUES (TO_DATE('2006-01-01 00:05:00', 'yyyy-mm-dd hh24:mi:ss'), TO_DATE('2006-01-01 00:20:00', 'yyyy-mm-dd hh24:mi:ss'));
    INSERT INTO tbl_data VALUES (TO_DATE('2006-01-01 00:05:00', 'yyyy-mm-dd hh24:mi:ss'), TO_DATE('2006-01-01 00:30:00', 'yyyy-mm-dd hh24:mi:ss'));
    INSERT INTO tbl_data VALUES (TO_DATE('2006-01-01 00:35:00', 'yyyy-mm-dd hh24:mi:ss'), TO_DATE('2006-01-01 00:40:00', 'yyyy-mm-dd hh24:mi:ss'));
    DECLARE
        v_cal_date Date       :=TO_DATE('01-jan-2006 00:00:00','dd-mm-yyyy hh24:mi:ss');
        intX Integer          :=1;
    BEGIN
        WHILE intX <= 60 LOOP
            UPDATE tbl_status
                   SET  (cal_date, my_count) =
                        (SELECT      v_cal_date,
                                     NVL(SUM(CASE WHEN v_cal_date >= E.START_DT AND v_cal_date < E.END_DT THEN 1 END),0) AS my_count
                         FROM        tbl_data E
                   WHERE cal_date = v_cal_date;
            v_cal_date := v_cal_date + (1/1440);
            intX := intX + 1;
            COMMIT;
        END LOOP;
    END;Edited by: Jason_S on Oct 21, 2009 9:00 AM -- i messed up the years/months .. fixed now
    Edited by: Jason_S on Oct 21, 2009 9:13 AM

  • Is there a way to create a collection based on the "previous import"?

    is there a way to create a collection based on the "previous import"? that would make it easy to mobile sync the last import to my ipad, and do further picking/rejecting while away from my laptop.

    well, yes, of course i could do it that way. i guess i wasn't specific enough. is there a way to create a smart collection, with the photos in the "previous import" as members of the smart collection.  earlier i mentioned about using this smart collection to mobile sync with my ipad, to do further flagging.
    so my intention, use a smart collection to mobile sync with my ipad, and the smart collection to include the photos from my previous import.
    i guess another way to ask the question, is there a way to create a smart collection, by using some rule or condition in the smart collection, to automatically include previous import photos.
    the documentation says that "previous import" is a collection, even though it shows up in the catalogue side bar section. but i see no way to choose that collection when making a smart collection.
    jd

  • Using JavaScript need to Sort subsite site collection based on date in descending order

    Hi,
    Below is my code, where i need to sort the " webCollection
    = web.getSubwebsForCurrentUser(null)" web collection based on the web.get_created() in
    descending order. How could i do it any suggestions. Also i need it in JavaScript.
    <script src="/_layouts/15/sp.runtime.js" type="text/javascript"></script>
    <script src="/_layouts/15/SP.js"></script>
    <script type="text/javascript">
    var context = SP.ClientContext.get_current();
    var web = context.get_web();
    ExecuteOrDelayUntilScriptLoaded(getWebProperties, "sp.js");
        function getWebProperties() {
                    webCollection = web.getSubwebsForCurrentUser(null);
            context.load(webCollection)
            //ctx.load(this.web);
            context.executeQueryAsync(Function.createDelegate(this, this.onSuccess),
                Function.createDelegate(this, this.onFail));
        function onSuccess(sender, args) {
            //alert('web title:' + this.web.get_title() + '\n ID:' + this.web.get_id()
    + '\n Created Date:' + this.web.get_created());
            alert("Number of sites: " + webCollection.get_count());
                   var webEnumerator = webCollection.getEnumerator();
                    while (webEnumerator.moveNext()){
       var web = webEnumerator.get_current();
      alert("Title="+web.get_title() +"\n"+ "Created="+web.get_created());
        function onFail(sender, args) {
            alert('failed to get list. Error:'+args.get_message());
    //getWebProperties();
    </script>
    Thanks!
    MCTS- Please vote and mark posts as answered where appropriate.

    Hi,
    According to your post, my understanding is that you wanted to sort the subsite based on the date in descending order.
    You can refer to the following code snippets, it sorts the subsites by the date in descending order.
    <script src="http://code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    // When the body is loaded, the onload event handler executes each function whose name is contained in this array.
    _spBodyOnLoadFunctionNames.push("callCSOM");
    function callCSOM()
    $("#Button1").click(function()
    ExecuteOrDelayUntilScriptLoaded(RetriveSites, "sp.js");
    var currentcontext = null;
    var currentweb = null;
    function RetriveSites()
    currentcontext = new SP.ClientContext.get_current();
    currentweb = currentcontext.get_web();
    this.subsites = currentweb.get_webs();
    currentcontext.load(this.subsites);
    currentcontext.executeQueryAsync(Function.createDelegate(this, this.ExecuteOnSuccess),
    Function.createDelegate(this, this.ExecuteOnFailure));
    function ExecuteOnSuccess(sender, args)
    var subsites = '';
    var enum1 = this.subsites.getEnumerator();
    var siteCreatedTime = '';
    var array=new Array();
    while (enum1.moveNext())
    var site = enum1.get_current();
    array.push(new Array(site.get_created(),site.get_title()));
    alert(array);
    array=sortMethod(array);
    alert(array);
    function sortMethod(arr) {
    var i, j, stop, len = arr.length;
    for (i=0; i<len; i=i+1)
    for (j=1;j<len - i; j++)
    // change the "<" to ">" would be sort by the Ascending.
    if (new Date(arr[j-1][0]) < new Date(arr[j][0]))
    //swap(j, j+1);
    var temp = arr[j-1];
    arr[j-1] = arr[j];
    arr[j] = temp;
    //alert(new Date(arr[j]));
    return arr;
    function ExecuteOnFailure(sender, args) {
    alert("error");
    </script>
    <input id="Button1" type="button" value="Run Code"/>
    Results:
    Sort before:
    Sort after:
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected].
    Jason Guo
    TechNet Community Support

  • Need help creating a device collection based on members of a user collection

    Hello everyone,
        I am working on developing a device collection based on the membership of a user collection. The purpose of the device collection is to provide us with the capability of deploying software to users while the users are logged off their systems.
    I would love to use AD security groups but unfortunately that isn't an available approach in this case. I have been experimenting with SQL queries to find the best way to obtain the results I want and the following query works like a champ:
    Select SYS.Name0,
    v_R_User.Unique_User_Name0
    FROM v_R_System AS SYS
    JOIN v_UserMachineRelationship ON SYS.Name0=v_UserMachineRelationship.MachineResourceName
    JOIN v_R_User ON v_UserMachineRelationship.UniqueUserName=v_R_User.Unique_User_Name0
    JOIN v_FullCollectionMembership AS FCM on FCM.ResourceID = v_R_User.ResourceID
    JOIN v_Collection AS COLMEM ON COLMEM.CollectionID = FCM.CollectionID
    Where FCM.CollectionID = 'cha0000B'
    The problem arises when I attempt this same query in SCCM 2012, I don't get any results from this query so of course it won't work to base a Device Collection from. Here is the WQL:
    Select SYS.Name,
    SMS_R_User.UniqueUserName
    FROM SMS_R_System AS SYS
    JOIN SMS_UserMachineRelationship ON SYS.Name=SMS_UserMachineRelationship.MachineResourceName
    JOIN SMS_R_User ON SMS_UserMachineRelationship.UniqueUserName=SMS_R_User.UniqueUserName
    join sms_v_FullCollectionMembership AS FCM on FCM.ResourceID = SMS_R_User.ResourceID
    join SMS_v_Collection AS COLMEM ON COLMEM.CollectionID = FCM.CollectionIDwhere FCM.CollectionID = 'cha0000B'
    I am hoping that someone will be able to look at my SQL and tell me how I can get the WQL right so I can use this query properly or provide suggestions to accomplish what I need.
    Thanks in advance for the assist,
    Chris Bolton

    Hi Torsten,
         While your suggestion of that link was close, it still went in the direction of using security groups as the basis for device queries and that isn't the direction I am pursuing. I had a colleague look at my original query and he identified
    that I had some unnecessary redundancy but that didn't resolve my SQL -> WQL inconsistency. I continued to play with the query and the following SQL also works (and actually works a bit better for my purposes)
    select distinct v_R_System.Name0,
    v_R_User.Unique_User_Name0
    FROM v_R_System
    JOIN v_R_User on v_R_User.Full_User_Name0 = v_R_System.User_Name0
    JOIN v_UserMachineRelationship ON v_R_System.Name0 = v_UserMachineRelationship.MachineResourceName
    JOIN v_FullCollectionMembership on v_R_User.Unique_User_Name0 = v_FullCollectionMembership.SMSID
    WHERE v_FullCollectionMembership.CollectionID = 'cha0000b'
    however when I translate it to WQL I still am unable to get results (here is the WQL version)
    select distinct sms_R_system.Name,
    sms_R_User.UniqueUserName
    FROM sms_R_system
    JOIN SMS_R_User on SMS_R_User.FullUserName = SMS_R_System.UserName
    JOIN SMS_UserMachineRelationship ON SMS_R_System.Name = SMS_UserMachineRelationship.MachineResourceName
    JOIN SMS_FullCollectionMembership on SMS_R_User.UniqueUserName = SMS_FullCollectionMembership.SMSID
    WHERE SMS_FullCollectionMembership.CollectionID = 'cha0000b'
    I think I am on the verge of getting this right but it sure seems to be a challenge. Is there a "WQL Workbench" that I could use that is similar to SQL Management Studio inside of which I could test these queries rather than having to use the rather clunky
    SCCM "Edit Query Statement" dialog box?
    Thanks again,
    Chris Bolton

  • 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());

  • R/3 - XI Idoc Collection Based On Same tRFC Call

    We have solution where RSEOUT00 sends idocs out in one tRFC call to a system running Mercator.  These idocs represent 1 transaction if you will, and are then mapped into 1 outbound file.
    I am trying to figure out what the best option to do this in XI is.  The requirement is to not collect based on a deadline, but to collect based on the chunk of idocs that were released online by the user in the same RSEOUT00 transaction.
    Is this possible or any suggestions to accomplish this?  I do have the flexibility to customize RSEOUT00 (its already custom actually) and have been toying with the idea of sending another message that is an "all are sent" or even something like a control message with a listing of all of the idoc numbers that belong to that group, but have yet to come up with a design that I'm comfortable with as the idocs are all sent asynchronously thorugh tRFC.
    Thanks
    Peter

    Hi Peter,
    If we can check the TID of the IDOC then that make your job easy..is it not ?
    Because all the IDOCs send in one tRFC call will have the same TID..
    Now i am trying to see what is the best way to get that...i checked standard context objects given by SAP ..it doesnot have this TID :(...
    I have suggestion ..this will work for sure...however it maynot be the most optimal one...
    In the BPM where you are collecting IDOCs...after the recieve..have a mapping from IDOC to a dummy message which will basically return TID....now this mapping should be an ABAP mapping ...now from the ABAP code...query the IDXSNDPOR table and get the TID for the current IDOC and return it..
    Back in the BPM, check if this is a new TID or not...if it is new..we can bundle it and stop the collection...
    if we have a better way to get the TID.....we can make this better...
    Thanks.

  • Dynamic computers collection based on User State Migration associations

    At our company, we have a group of computers with the follwoing situation:
    User works on machine with WindowsXP, there is already prepared new machine, with Windows 7 installed, and delivered to user. I have prepared 2 task sequences - "State Capture" and "State Restore", both deployed to separate device collections.
    Now, what I do is create old/new computer association in the User State Migration tab, add old computer to Capture collection, let the TS complete, add new computer to Restore collection, and let the TS complete. After all these steps user can begin to work
    on the new machine with his/her profile and data migrated.
    But I would like to speed things a little bit, and allow my
    colleagues to perform such "migration" by simply adding computers association. To achieve that, I need to create a query, that would assign computers to collections, based on the existing associations in the User State Migration tab. The problem is,
    I fail to find appropriate rule in query wizard. Is it possible at all?
    I need computer to be added to Capture collection upon detection of it being source computer in the USM tab, and removed from collection upon finished TS, with the target computer added to Restore collection at the same moment and removed from the collection
    upon finished restore TS.
    I would greatly appreciate any help or pointing into right direction.

    Hi,
    There is a blog about removing computer from collection after SCCM task sequence. But it is for SCCM 2007. You could have a look on this blog to see if the script can be edited to meet your requirements.
    Remove computer association from collection
    after SCCM task sequence
    Note: Microsoft provides third-party contact information to help you find technical support. This
    contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.
    Best Regards,
    Joyce
    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.

  • WQL query for collection based on file properties not add remove

    Hi
    I have an issue where a .exe file does not have the updated version number available in add remove programs. The only way I know to get the version number is to right click the file and view version there.
    I need to make a collection based on the information available in properties. Is this possible? How would I write the query?
    Thanks

    Hi,
    to perform this kind of operation on a .exe file you need to configure software inventory.
    Inside the properties just choose to Collect File Details and select a path to scan.
    http://technet.microsoft.com/en-us/library/bb633191.aspx and http://technet.microsoft.com/en-us/library/bb632607.aspx

  • Collections based on Software Update Group compliance

    Hi!
    Is it possible to create a collection based on software update group compliance? This is for software update groups which are
    not deployed, they are just monitor groups (for example, groups for yearly or quarterly software update compliance).
    I would like to create a collection that lists all devices which are non-compliant in software update groups with names like "%Client Updates" - is this possible?
    The reason for this is so I can impose some stricter Compliance Settings (among some other stuff) on devices that are not compliant.
    I looked around a bit, but I could not find anything that I can use. Even Google couldn't solve my question :/

    you can try something like this:
    This collection is basically sub selected query get list of computers that do not have specific assignment enabled.
    select *  from  SMS_R_System where SMS_R_System.ResourceId not in (SELECT distinct SMS_UpdateComplianceStatus.MachineID  FROM SMS_UpdateComplianceStatus JOIN SMS_UpdateDeploymentSummary ON SMS_UpdateComplianceStatus.CI_ID = SMS_UpdateDeploymentSummary.CI_ID
    WHERE SMS_UpdateDeploymentSummary.AssignmentName like "%Client Updates%")
    Eswar Koneti | Configmgr blog:
    www.eskonr.com | Linkedin: Eswar Koneti
    | Twitter: Eskonr

  • Collection Based on Null Value from Custom MOF extended value

    I extended the MOF to create collections based on registry keys and its working great!
    I would like to know how to modify the below query that looks for "Automatic" to actually return all servers without this value - a collection of servers without this custom registry value we are using.
    Below is the working query for finding servers with "Automatic" - how can I adjust this to give me all servers without any value here? I want all servers with a NULL value....
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_ServerReboot_ServerReboot_1_0 on SMS_G_System_ServerReboot_ServerReboot_1_0.ResourceId
    = SMS_R_System.ResourceId where SMS_G_System_ServerReboot_ServerReboot_1_0.Reboot = "Automatic" order by SMS_R_System.NetbiosName
    What we want:
    select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_ServerReboot_ServerReboot_1_0 on SMS_G_System_ServerReboot_ServerReboot_1_0.ResourceId
    = SMS_R_System.ResourceId where SMS_G_System_ServerReboot_ServerReboot_1_0.Reboot = "NULL" order by SMS_R_System.NetbiosName

    Use "is null" like this.
    SMS_G_System_ServerReboot_ServerReboot_1_0.Reboot is Null
    http://www.enhansoft.com/

  • How to create Collection Based on Status Message

    It's possible create a collection based on Status Message?
    If yes, please post how
    tks
    Allan

    the query given by matthew is WQL but not SQL.you cannot run the WQL query in SQL which do not support.
    The error what you get is expected .some of the wmi entries that exist in sms provider may not appear in sccm query design.
    Do not click on show query design as sms_statusmessage attributes cannot be retrived .After you
    created the WQL Query ,just paste in query box and click Ok (Ignore the error message box).
    wait for sometime and see if that display any computers.
    Eswar Koneti | Configmgr blog:
    www.eskonr.com | Linkedin: Eswar Koneti
    | Twitter: Eskonr

  • Collection-based for loop

    Can somebody explain to me why only the first code snippet is valid?
    A.
    int[] a= {2,3,5,7};
    for(int i : a) System.out.println(i);B.
    int[] a= {2,3,5,7};
    int i;
    for(i : a) System.out.println(i);

    Why shouldn't it be? You declare an array, and you iterate over it using the new for loop and a variable declared in the loop's head...

Maybe you are looking for

  • Client/server application under development

    Hi there, I've been working on a client/server application that includes chat and whiteboard features. In terms of how the client app communicates with the server app, my initial thought was to just go with xml, until I reached a snag. Everything abo

  • Cannot dismiss iOS 8 keyboard

    Has anyone else had a problem dismissing the iPad's iOS 8 keyboard when you have a Bluetooth keyboard attached? From time to time I run into a problem dismissing the iOS 8 keyboard when the cursor is in a text field, even though I have a Bluetooth ke

  • Connection to Apps EUL fails with Disco 4

    Hi all, anyone has a hint for me what the problem might be? - I want to connect to an applications EUL with Discoverer 4 - I checked the 'connect to Oracle Applications EUL' box - I filled in GWUID en FNDNAM - I checked the user and password works in

  • Issue in rebuilding index after restoring database from sql server 2005 to 2012

    Hi All, We have recently restored a database named DBA_admin from our sql server 2005 instance to sql server 2012 and we have added the database to out weekly maintenance plan. After adding the database to maintenance plan the job is failing every we

  • USB headphones + speakers in jack

    Is it possible to run both a USB gaming headset and have my output work on the onboard sound?  I noticed that it doesn't work now, but haven't fooled much with anything to try and get it to work.