Run query in a loop vs run query once

Hi,
Which of the following would be more efficient
for i in 1 .. 100 loop
select sal into myvar from emp where empno = i
end loop
select sal bulk collect into myvars from emp where empno in (1, 2, ...100)
thanks for the help

Hi,
Which of the following would be more efficient
for i in 1 .. 100 loop
select sal into myvar from emp where empno = i
end loop
select sal bulk collect into myvars from emp where
empno in (1, 2, ...100)
thanks for the helpThe second one
You don't need to enumerate all 100 values
select sal bulk collect into myvars from emp where
empno between 1 and 100; Besides that, in Your first example, You keep in myvar at the end only last value 100 and overwrite other 99 ...
Regards
Dmytro

Similar Messages

  • Question about "run application once" semantics...

    Hi to anyone still out there. We're still using ZfD 3.0SP1a with the
    latest NAL patch (10.4.2002). Things basically are working but we're
    redoing our software distribution strategy to try and streamline things
    and squeeze a bit more life out of the platform. As part of the process, I
    moved away from force run MSI installs by user for basic stuff to force
    runs which call msiexec /i some.msi (or setup or whatever...) and
    associating these to OUs. I was planning to use the app version number to
    force redistribution whenever I put up newer MSIs or installer files. In
    testing, I noticed that msiexec was running on each login for each package
    and that wasn't what I wanted. I want the installers to fire off once,
    then again whenever I bump the version number. So I checked off "Run
    application once". Now the apps run only once but do not redistribute when
    I up the version number. If I use nlist to query eDir, I can see the
    attribute "zenappDisconnectedVersionNumber" has been incremented in the
    directory but looking at HKLMSoftwareNetWareNAL1.0Distribute*, the version
    number for that app never moves and the software isn't redistributed. The
    apps are all set to "wait on force run".
    Am I misunderstanding the use of this attribute? I suppose I could leave
    "run application once" off and set up some registry flags to control
    distribution or even just let them run on each login but I want to do this
    in the cleanest fashion. Any suggestion about what I might be doing wrong
    or how to work around/troubleshoot this issue? Thanks in advance!
    Michael

    Thanks, guys. I have a follow up question/issue related to this
    environment. I am pushing out a handful of apps associated with
    workstations via OUs (force runs which call msiexec or a setup). I've
    tested this a hundred or more times in my own OU but in several other OUs,
    I've now run into this issue when NAL kicks off the first app install. I
    get a WMRUNDLL.EXE error and no software distribution occurs. The text of
    the Dr Watson error is:
    The application, WMRUNDLL.exe, generated an application error The error
    occurred on 11/07/2007 @ 12:54:26.495 The exception generated was c0000005
    at address 004AED14 (NWAPPCreateFullObjectName)
    In setting up a few machines today, the first ran fine, the next 3 got
    this error. I've synched up everything in PUBLIC across all servers; all
    NAL related files that I'm aware of (that show via NAL's "more" button)
    are from the last update for ZfD 3, dated 10-04.2002.
    I did some searching and the little I was able to find seemed to point at
    a particular version of wsreg.dll. Wasn't able to find any particulars
    though. Fwiw, wsreg32.exe and wsreg.dll in PUBLIC were dated 6.26.2001. I
    swapped in a wsreg.dll from 10.22.2002 which I believe was part of the
    49SP2 client. That apparently hasn't helped. Worst of all, it seems
    intermittent or arbitrary - I can't really see what's different between
    the environment I'm currently in that is experiencing the error and the
    one in which it's working. It's the exact same base image, exact same
    PUBLIC dir... the only difference is that it's not my home OU. I checked
    workstation policies in the other OU and they appear to be the same as in
    mine.
    I thought I was past this as the PUBLIC sync seemed to clear things up at
    another location but now I'm seeing it again. Have you seen this before?
    Any suggestions? Thanks a lot!

  • How do I get a case to run only once

    I am using an e-series DAQ board to bring a pwm signal, then I use labview to use that signal to pick one of three cases. depending on the case picked a finite pulse stream is sent out. Currently the finite pulse vi keeps repeating because the the program stays in the case. I need a way to get labview to run the finite pulse output only once, and not run again until a new case is picked. I don't have the case in a while loop.
    Thanks For The Help

    I am still haveing problems so I will try and attach my program and see if you can help a little more that. It will probably be easier for you to look at this way. When you look at the diagram sequence 0 is the one the problem is in. In that sequence you will see a case structure and that is where the finite pulse train vi is. When case 1 is selected the finite pulse train will run again and again until I leave case 1. I need to have the program run the finite pulse train once and then wait and do nothing until the case is changed. The finite pulse train will be in all cases inside the case structure I just haven't done that yet, I am waiting until it works. The pulse train is used to move a stepper motor that is why running only once is im
    portant because the stepper motor is used to position something.
    Attachments:
    AMC_Eagle_Both_Inputs_Working_2.vi ‏266 KB

  • Materialized View to run only once in a year...

    Hi everybody...
    I want to create a materialized view which will run only once in a year and specifically some minutes after 00:00 a.m. on new year's day,
    so i created the following:
    CREATE MATERIALIZED VIEW <mv_name>
    BUILD IMMEDIATE
    REFRESH START WITH TO_DATE('01/01/2007 00:15:00','DD/MM/RRRR HH24:MI:SS')
    NEXT SYSDATE+366
    I have two notes:
    1) how to declare the refresh to be done the first new year's day after the day it'll be created , i mean not static date (01/01/2007)
    2)some years are leap and some are not , so in order to run every new year's day how should i transform the above..????
    3)is there any view which displays the next run of a materialized view..???
    the view DBA_MV_REFRESH_TIMES displays the last refresh of mv's...
    I use Oracle 10.2.0.1 on XP ...
    Thanks , a lot
    Simon

    1).
    use the expression that evaluates to next january first.
    SQL> select sysdate, add_months(trunc(sysdate, 'yyyy'), 12) from dual ;
    SYSDATE     ADD_MONTHS(
    19-JUN-2006 01-JAN-2007
    1 row selected.
    SQL>2). for this also use the same expression that will evaluate to the january first of the year after that.

  • How do I submit a job to run only once?

    I have a stored procedure that submits a job. If this job fails, I don't want it to continue trying to run. Does anyone know how to ensure that it will only run once, no matter what?
    I did try something similar to the following:
    procedure proc_submitted_as_job(p_job_no number) is
    begin
    dbms_job.broken(p_job_no, true);
    end;
    However, I found out that if you change the Broken state while a job is running, then it gets reset when the job completes.
    Basically, I'm using the dbms_job utility to run a long-running procedure in the background. If there's another way to obtain this same result, I'd love to hear it.

    I am still haveing problems so I will try and attach my program and see if you can help a little more that. It will probably be easier for you to look at this way. When you look at the diagram sequence 0 is the one the problem is in. In that sequence you will see a case structure and that is where the finite pulse train vi is. When case 1 is selected the finite pulse train will run again and again until I leave case 1. I need to have the program run the finite pulse train once and then wait and do nothing until the case is changed. The finite pulse train will be in all cases inside the case structure I just haven't done that yet, I am waiting until it works. The pulse train is used to move a stepper motor that is why running only once is im
    portant because the stepper motor is used to position something.
    Attachments:
    AMC_Eagle_Both_Inputs_Working_2.vi ‏266 KB

  • How to get lauchctl daemons/agents to run only once a day

    How do you get a daemons/agents to run only once a day regardless of the error code of the .sh you are running?
    (not I'm not looking for run once or run on reboot. I want a job to run at 3am every day and it has several bash commands in it. Regardless of the returns by any of the commands in the script, I only want this to run once - NO RESPAWN).

    Ok still not working.. here is the plist
    the .sh file does file processing and then uploads xml files to my server and should run once a day. Here I have it running at 11:45am. It completes and then runs again and again and again.
    The plist is placed in LaunchAgents and loaded with $launchctl load com.iclassicnu.crontabtest.plist
    ideas?
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>label</key>
    <string>com.iclassicnu.crontabtest</string>
    <key>ProgramArguments</key>
    <array>
    <string>/Users/dan/Desktop/iClassicNu/Idea/Forexite/ForexUpdate.sh</string>
    </array>
    <key>WorkingDirectory</key>
    <string>/Users/dan/Desktop/iClassicNu/Idea/Forexite</string>
    <key>OnDemand</key>
    <false/>
    <key>Nice</key>
    <integer>1</integer>
    <key>StartCalendarInterval</key>
    <dict>
    <key>Hour</key>
    <integer>11</integer>
    <key>Minute</key>
    <integer>45</integer>
    </dict>
    <key>StandardErrorPath</key>
    <string>/Users/dan/tmp/icnTest1.err</string>
    <key>StandardOutPath</key>
    <string>/Users/dan/tmp/icnTest1.out</string>
    </dict>
    </plist>

  • Dbms_scheduler - dbms_aq - dbms_aqadm - event driven job runs only once/sec

    hi, i tried here to process events with 2 jobs... surprisingly i had to call dbms_lock.sleep(1) to be able to enqueue events
    at inserts in a row ... even more surprisingly the enqueuing doesn't function if the processing (prc_evsched) lasts some seconds...
    how must the code be changed to be able to enqueue all events after the inserts without any sleep()?
    and how must the code be changed to be able to enqueue all events with a proc (prc_evsched) running longer?
    thanx in advance for your help!
    --evsched
    h4.
    --to remove all test-objects
    h4.
    --test table
    h4.
    --define the object type to act as the payload for the queue
    h4.
    --creating the event queue
    h4.
    --creating the proc for the prog/job
    h4.
    --creating the proc for the prog/job
    h4.
    --creating the program
    h4.
    --creating the first job (for parallel execution)
    h4.
    --creating the second job (for parallel execution)
    h4.
    --test block
    h4.
    --test scenarios/results
    h4.
    --to remove all test-objects
    DECLARE
    exc_ora_27475 EXCEPTION; --ora-27475: <job_name> muss job sein
    PRAGMA EXCEPTION_INIT (exc_ora_27475, -27475);
    exc_ora_27476 EXCEPTION; --ora-27476: <program_name> ist nicht vorhanden
    PRAGMA EXCEPTION_INIT (exc_ora_27476, -27476);
    exc_ora_24010 EXCEPTION; --ORA-24010: QUEUE SYSGIS.EVENT_QUEUE ist nicht vorhanden
    PRAGMA EXCEPTION_INIT (exc_ora_24010, -24010);
    exc_ora_24002 EXCEPTION; --ORA-24002: QUEUE_TABLE SYSGIS.EVENT_QUEUE_TAB ist nicht vorhanden
    PRAGMA EXCEPTION_INIT (exc_ora_24002, -24002);
    exc_ora_4043 EXCEPTION; --ORA-04043: Objekt T_EVENT_QUEUE_PAYLOAD ist nicht vorhanden
    PRAGMA EXCEPTION_INIT (exc_ora_4043, -4043);
    exc_ora_942 EXCEPTION; --ORA-00942: Tabelle oder View nicht vorhanden
    PRAGMA EXCEPTION_INIT (exc_ora_942, -942);
    exc_ora_2289 EXCEPTION; --ORA-02289: Sequence ist nicht vorhanden.
    PRAGMA EXCEPTION_INIT (exc_ora_2289, -2289);
    v_fpos PLS_INTEGER := 1;
    BEGIN
    v_fpos := 10;
    BEGIN
    --remove job
    SYS.DBMS_SCHEDULER.DROP_JOB(job_name=> 'job_evsched', FORCE=>TRUE);
    EXCEPTION WHEN exc_ora_27475 THEN NULL;
    END;
    v_fpos := 12;
    BEGIN
    --remove job
    SYS.DBMS_SCHEDULER.DROP_JOB(job_name=> 'job_evsched_2', FORCE=>TRUE);
    EXCEPTION WHEN exc_ora_27475 THEN NULL;
    END;
    v_fpos := 20;
    BEGIN
    --remove program
    SYS.DBMS_SCHEDULER.DROP_PROGRAM(program_name=>'prg_evsched',FORCE=>TRUE);
    EXCEPTION WHEN exc_ora_27476 THEN NULL;
    END;
    v_fpos := 30;
    BEGIN
    -- stop the event queue.
    DBMS_AQADM.stop_queue (queue_name => 'evsched_event_queue');
    EXCEPTION WHEN exc_ora_24010 THEN NULL;
    END;
    v_fpos := 40;
    BEGIN
    -- drop the event queue.
    DBMS_AQADM.drop_queue (queue_name => 'evsched_event_queue');
    EXCEPTION WHEN exc_ora_24010 THEN NULL;
    END;
    v_fpos := 50;
    BEGIN
    -- Remove the queue table.
    DBMS_AQADM.drop_queue_table(queue_table => 'tab_evsched_event_queue');
    EXCEPTION WHEN exc_ora_24002 THEN NULL;
    END;
    v_fpos := 60;
    BEGIN
    -- remove type
    EXECUTE IMMEDIATE 'DROP TYPE typ_evsched_payload';
    EXCEPTION WHEN exc_ora_4043 THEN NULL;
    END;
    v_fpos := 70;
    BEGIN
    -- remove table
    EXECUTE IMMEDIATE 'DROP TABLE tab_evsched';
    EXCEPTION WHEN exc_ora_942 THEN NULL;
    END;
    v_fpos := 80;
    BEGIN
    -- remove sequence
    EXECUTE IMMEDIATE 'DROP SEQUENCE seq_evsched';
    EXCEPTION WHEN exc_ora_2289 THEN NULL;
    END;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('v_fpos='||v_fpos);
    END;
    h4.
    --test table
    CREATE TABLE tab_evsched
    ( id NUMBER
    , sys_date DATE
    , status VARCHAR2(1)
    , processed VARCHAR2(1) DEFAULT 'N'
    , processed_by varchar2(128)
    GRANT DELETE, INSERT, SELECT, UPDATE ON tab_evsched TO PUBLIC
    CREATE SEQUENCE seq_evsched
    h4.
    --define the object type to act as the payload for the queue
    CREATE OR REPLACE TYPE typ_evsched_payload AS OBJECT
    ( event_name VARCHAR2(30)
    , tab_evsched_id NUMBER
    , daterf DATE
    h4.
    --creating the event queue
    BEGIN
    -- Create a queue table to hold the event queue.
    DBMS_AQADM.create_queue_table
    ( queue_table => 'tab_evsched_event_queue'
    , queue_payload_type => 'typ_evsched_payload'
    , multiple_consumers => TRUE
    , COMMENT => 'Queue Table For Event Messages'
    -- Create the event queue.
    DBMS_AQADM.create_queue
    ( queue_name => 'evsched_event_queue'
    , queue_table => 'tab_evsched_event_queue'
    , queue_type => DBMS_AQADM.NORMAL_QUEUE
    , max_retries => 0
    , retry_delay => 0
    , dependency_tracking => FALSE
    , comment => 'Test Object Type Queue'
    , auto_commit => FALSE
    -- Start the event queue.
    DBMS_AQADM.start_queue
    ( queue_name => 'evsched_event_queue'
    END;
    h4.
    --creating the proc for the prog/job
    CREATE OR REPLACE PROCEDURE prc_evsched
    ( p_message IN typ_evsched_payload
    , p_job_name IN VARCHAR2
    IS
    BEGIN
    UPDATE tab_evsched
    SET processed = 'J'
    , processed_by = p_job_name
    , sys_date = p_message.daterf
    WHERE 1=1
    AND id = p_message.tab_evsched_id
    dbms_lock.sleep(5); --#sleep-1#
    COMMIT;
    END prc_evsched;
    h4.
    --creating the program
    DECLARE
    exc_ora_27476 EXCEPTION; --ora-27476: <program_name> ist nicht vorhanden
    PRAGMA EXCEPTION_INIT (exc_ora_27476, -27476);
    BEGIN
    BEGIN
    SYS.DBMS_SCHEDULER.DROP_PROGRAM(program_name=>'prg_evsched',FORCE=>TRUE);
    EXCEPTION
    WHEN exc_ora_27476 THEN
    NULL;
    END;
    SYS.DBMS_SCHEDULER.CREATE_PROGRAM
    ( program_name => 'prg_evsched'
    , program_type => 'STORED_PROCEDURE'
    , program_action => '"SYSGIS"."PRC_EVSCHED"'
    , number_of_arguments => 2
    , enabled => FALSE
    , comments => 'Program-Komponent für den Test von DBMS_SCHEDULER'
    --event message as the first param to prc_evsched 
    DBMS_SCHEDULER.DEFINE_METADATA_ARGUMENT
    ( program_name => 'prg_evsched'
    , argument_position => 1
    , metadata_attribute => 'EVENT_MESSAGE'
    --name of the job as the second param to prc_evsched 
    SYS.DBMS_SCHEDULER.define_program_argument
    ( program_name => 'prg_evsched'
    , argument_name => 'p_job_name'
    , argument_position => 2
    , argument_type => 'VARCHAR2'
    , default_value => 'dummy'
    --enable program   
    SYS.DBMS_SCHEDULER.ENABLE(NAME=>'prg_evsched');
    END;
    h4.
    --creating the first job (for parallel execution)
    DECLARE
    exc_ora_27475 EXCEPTION; --ora-27475: <job_name> muss job sein
    PRAGMA EXCEPTION_INIT (exc_ora_27475, -27475);
    BEGIN
    BEGIN
    --remove job
    SYS.DBMS_SCHEDULER.DROP_JOB(job_name=> 'job_evsched', FORCE=>TRUE);
    EXCEPTION WHEN exc_ora_27475 THEN NULL;
    END;
    DBMS_SCHEDULER.create_job
    ( job_name => 'job_evsched'
    , program_name => 'prg_evsched'
    , start_date => SYSTIMESTAMP
    , event_condition => 'tab.user_data.event_name = ''MYEVENT'''
    , queue_spec => 'evsched_event_queue'
    , auto_drop => FALSE
    , enabled => FALSE
    SYS.DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE
    ( job_name => 'job_evsched'
    , argument_name => 'p_job_name'
    , argument_value => 'job_evsched'
    SYS.DBMS_SCHEDULER.ENABLE(NAME=>'job_evsched');
    END;
    h4.
    --creating the second job (for parallel execution)
    DECLARE
    exc_ora_27475 EXCEPTION; --ora-27475: <job_name> muss job sein
    PRAGMA EXCEPTION_INIT (exc_ora_27475, -27475);
    BEGIN
    BEGIN
    --remove job
    SYS.DBMS_SCHEDULER.DROP_JOB(job_name=> 'job_evsched_2', FORCE=>TRUE);
    EXCEPTION WHEN exc_ora_27475 THEN NULL;
    END;
    DBMS_SCHEDULER.create_job
    ( job_name => 'job_evsched_2'
    , program_name => 'prg_evsched'
    , start_date => SYSTIMESTAMP
    , event_condition => 'tab.user_data.event_name = ''MYEVENT'''
    , queue_spec => 'evsched_event_queue'
    , auto_drop => FALSE
    , enabled => FALSE
    SYS.DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE
    ( job_name => 'job_evsched_2'
    , argument_name => 'p_job_name'
    , argument_value => 'job_evsched_2'
    SYS.DBMS_SCHEDULER.ENABLE(NAME=>'job_evsched_2');
    END;
    h4.
    --test block
    DECLARE
    PROCEDURE pr_ins_tab_evsched
    ( p_id IN NUMBER
    , p_status IN VARCHAR2
    IS
    BEGIN
    INSERT INTO tab_evsched(id,status) VALUES (p_id, p_status);
    COMMIT;
    --enqueue the MYEVENT-event
    IF p_status = 'M' THEN
    --enqueue works in 1sekunden-taktung.... !?
    dbms_lock.sleep(1); --#sleep-2#
    DECLARE
    v_enqueue_options DBMS_AQ.enqueue_options_t;
    v_message_properties DBMS_AQ.message_properties_t;
    v_message_handle RAW(16);
    v_queue_msg typ_evsched_payload;
    BEGIN
    v_queue_msg := typ_evsched_payload
    ( event_name => 'MYEVENT'
    , tab_evsched_id => p_id
    , daterf => SYSDATE
    v_enqueue_options.VISIBILITY := DBMS_AQ.ON_COMMIT;
    v_enqueue_options.delivery_mode := DBMS_AQ.PERSISTENT;
    v_message_properties.PRIORITY := 1;
    v_message_properties.DELAY := DBMS_AQ.NO_DELAY;
    v_message_properties.EXPIRATION := DBMS_AQ.NEVER;
    v_message_properties.CORRELATION := 'TEST MESSAGE';
    DBMS_AQ.enqueue
    ( queue_name => 'evsched_event_queue'
    , enqueue_options => v_enqueue_options
    , message_properties => v_message_properties
    , payload => v_queue_msg
    , msgid => v_message_handle
    END;
    END IF;
    COMMIT;
    END pr_ins_tab_evsched;
    BEGIN
    DELETE tab_evsched;
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    pr_ins_tab_evsched (seq_evsched.NEXTVAL,'M');
    END;
    SELECT * FROM tab_evsched ORDER BY id;
    SELECT * FROM sysgis.tab_evsched_event_queue;
    h4.
    --test scenarios/resultsh
    h5.
    --test results #sleep-1#=5, #sleep-2#=0
    --job (job_evsched) runs only once, only the first event is enqued/processed
    ID SYS_DATE STATUS PROCESSED PROCESSED_BY
    9 22.03.2012 17:00:41 M J job_evsched
    10 (Null) M N (Null)
    11 (Null) M N (Null)
    12 (Null) M N (Null)
    13 (Null) M N (Null)
    14 (Null) M N (Null)
    15 (Null) M N (Null)
    16 (Null) M N (Null)
    h5.
    --test results #sleep-1#=0, #sleep-2#=1
    --jobs (job_evsched/job_evsched2) run alternately, every events are enqued/processed
    ID SYS_DATE STATUS PROCESSED PROCESSED_BY
    25 22.03.2012 17:04:31 M J job_evsched_2
    26 22.03.2012 17:04:32 M J job_evsched_2
    27 22.03.2012 17:04:33 M J job_evsched
    28 22.03.2012 17:04:34 M J job_evsched_2
    29 22.03.2012 17:04:35 M J job_evsched_2
    30 22.03.2012 17:04:36 M J job_evsched_2
    31 22.03.2012 17:04:37 M J job_evsched
    32 22.03.2012 17:04:38 M J job_evsched_2
    h5.
    --test results #sleep-1#=5, #sleep-2#=1
    --jobs (job_evsched/job_evsched2) run alternately, only two events are enqued/processed
    ID SYS_DATE STATUS PROCESSED PROCESSED_BY
    41 22.03.2012 17:07:42 M J job_evsched_2
    42 (Null) M N (Null)
    43 (Null) M N (Null)
    44 (Null) M N (Null)
    45 (Null) M N (Null)
    46 (Null) M N (Null)
    47 22.03.2012 17:07:48 M J job_evsched
    48 (Null) M N (Null)
    */

    hi, thank you for your (fast) answer! that is the solution to my problem!
    now i have a follow-up question:
    i've got a procedure, that runs between 1 and 2 minutes long. unlimited running lightweight jobs
    would freeze the db...
    how can the count of the parallel running lightweight-jobs be limited?
    according to the documentation it is not possible:
    There is no explicit limit to the number of lightweight jobs that can run simultaneously to process multiple instances of the event.
    However, limitations may be imposed by available system resources.
    could you explain to me, what it (...available system recources...) means?
    eventually what i would like to have: max. two parallel running (lightweight) jobs....
    thank you in advance, bye, á
    ps: can i attach a file to the post anyway?
    Edited by: user4786904 on 23.03.2012 07:22

  • Run Script Once through Group for All users

    Hello Everyone,
    We have 4 forests with one domain each having forest trusts. I want to run a script only once on all the windows 7 machines in all the domains.
    I have created the script and saved it in the .bat. how can i go ahead and do this.
    Need your help.
    Thanks in Advance

    Hello Everyone,
    We have 4 forests with one domain each having forest trusts. I want to run a script only once on all the windows 7 machines in all the domains.
    You need to apply your script 4 times since you have 4 domains. Just use WMI filters to apply the GPO on Windows 7 machines only. 
    Filtering Group Policy to Windows 7 Computers
    Mahdi Tehrani   |  
      |  
    www.mahditehrani.ir
    Please click on Propose As Answer or to mark this post as
    and helpful for other people.
    This posting is provided AS-IS with no warranties, and confers no rights.
    How to query members of 'Local Administrators' group in all computers?

  • Run only once in case structure

    Hello,
    I have a menu set up that is wired to a case structure.  Of course the menu is some boolean buttons that are set to switch when pressed so the case will stay open as long as the button is true.
    inside that case I have another menu and a case structure that operates the same.  In one of these cases I have a piece of code that I only want to run once.  I have tried the while loop that runs once and a for loop that only runs once, but the section of code seems to run continuosly instead of just once.  It works ok if I use any of the latch functions but not the switch when pressed functions.  However, I need the button to stay pressed until the user is finished with that case.
    I really don't want to use an event structure as I was saving that for another piece of code that monitors inputs.
    Anyone have a suggestion?

    Typically, this works easiest with a shift register and and a boolean "implies" function.
    In the code example (see image), the button is set to "switch until released". (Of course you probably don't need the NOT, simply place your one-time code into the FALSE case )
    Message Edited by altenbach on 01-26-2007 01:52 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    implies.png ‏8 KB

  • 8am morning run labview once, 4pm run once again, and it continues forever everyday

    Hi everyone,
    I have  wrote a programm with if case which checks whether the time stamp lies between 8am til 4pm with time range. If outside this range, it will send a signal to shut a relay down, if within this time frame, it will send another signal to turn it on. But the problem is, it runs 24 hours everyday to check this condition with while loop and if case, combine with timerange.
    Does anyone has an idea , where the programm only runs twice a day, which is 8am run the program to turn it on, and 4pm run another time to turn it off, without repeating everytime.
    I have a feeling it is time loop structure related and have tried it, but I can't seem to set the start time as 8am, and end time at 4pm, what i can manage to do is that in the first frame in time loop, it runs and it turn on, and the second frame has to wait a very long time(whatever time u set), then it will execute to turn it off. It works but everytime i have to calculate the time difference. I am looking for alternatives.
    Thanks for anyone's help.
    Have a nice day.

    I think it is Ed Dickens who sprats a signature that reads something to the effect of;
    "Using the abort button to sop your application is like using a tree to stop your car. It will work but you may not like the consequences."
    Calculating time difference for 24 X 7 apps is not as easy as it appears due to Daylight Savings Time. DST introduce one day a yeear that has 25 hours and another day that has only 23 hours. We can not code these dates at development time since they are subject to the will of the congress and are subject to change ("Woe to those who seek to change times and ways." Is that Revelations?).
    Since you target times do not fall into the nebulus hour that may or may not be there, I would recomend you set up a loop (timed or not) that queries the system time once a second to see if the current time meets your criteria. When doing the check don't try to an exact match of the time since the code may run end up missing the exact hour by a handful of seconds one way or the other due to other processes runing on the machine.
    This thing all things devour:
    Birds, beasts, trees, flower;
    Gnaws iron, bites steel;
    Grinds hard stones to meal;
    Slays king, ruins town,
    And beats high mountain down.
    JRR Tolkiens The Hobbit, Riddles in the Dark , Time.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Run timer once a month

    How can I set a timer to run on the first of the month or can I?

    I think you shouldn't use a timer because it is a very long period, and you could get errors or interruptions and relaying on the interval wouldn't allow you to rovery. Try something like this, instead:
    import java.util.*;
    public class MonthlyWork {
    public MonthlyWork() {
    new Thread() {
      public void run() {
       Calendar cal=Calendar.getInstance();
       for(;;) { //loop forever
        if(cal.get(Calendar.DAY_OF_MONTH)==cal.getActualMinimum(Calendar.DAY_OF_MONTH)) doWork();
        // the above should work also with non-gregorian calendars!!!
        cal.setTimeInMillis(System.currentTimeMills());
    }.start();
    public void doWork() {
    System.out.println("It is the first of the month, and I'm working hard :-)");
    public static void main(String[] args) {
    new MonthlyWork();
    }Hope it helps

  • Xcelsius runs only once, then the "play=true" needs to be reset.

    Post Author: stephantmi
    CA Forum: Xcelsius and Live Office
    When I export into PowerPoint the dashboard will only run one time... I then need to goto properties and find "play" and change from "false" to "true". I found a website that stated "Note: we've recently discovered that if the flash movie is scripted to stop
      playing rather than loop or repeat then this command appears to be passed to
      PowerPoint - this results in the play command being reset to false. The simple
      solution (if you've got the source flash file) is to remove the offending command,
      alternatively you'll have to save the presentation with play set to true and
      not run it again until ready to present - it'll only run once and will need
      resetting before it'll work again!" How do I send out a PowerPoint that would allow the person I would email the presentation to run the slide show and interact with the dashboard if it doesn't initiate without manual intervention.

    Post Author: abrat
    CA Forum: Xcelsius and Live Office
    I assume this is with X2008?   BTW. Right-clicking on the flash and choosing 'play' should also work. This is an Adobe issue. They have increased the security on the use of flash files.  They are afraid of malicious use and viruses so they now require manual intervention.  You could contact Adobe and let them know how this security feature is affecting you. Xcelsius is also currently in talks with them. - Andy

  • GO button to execute a query once report parameters are selected.

    I am familiar with the GO button depicted in chapter 10 of the 2 Day Developer manual that does not cause the report to be rendered until a user chooses a value from a select list of values. The GO button is used in conjunction with Null Value Text (ex. -Select-), Null Value (ex. -1), and Default (ex.-1).
    I need an alternative to the above method that will still force the user to pick a value from the List Of Values parameters prior to executing the query and rendering the report. Please provide.
    Thanks, Don From Maine

    Why don't you use a validation process?
    Denes Kubicek

  • How many apple tvs can i run at once

    i want to set up a trade show booth with apple tvs and a mac mini. how many apple tvs can i run off a mac mini? i want to run different slideshows.

    Frank Caggiano wrote:
    Pretty sure that one device (the mini) will only be able to interact with one Apple TV.  At best you might be abel to connect to multiple ATVs but they would all run the same content. (and I have my doubts about that)
    You can use the mini and multiple Apple TV's to watch different content, indeed you can only watch different content although you can listen to the same content. For the avoidance of doubt different includes the same content but not in sync.

  • What kind of battery in the 4s? Should I let it run down once in a while? ...

    I lose track of the battery tech being used now (is it lithium-ion?). Is it beneficial, or bad, to let the battery in an iPhone 4S run down to near 0% once in a while?
    What does Apple recommend?
    Thanks!
    Chris
    www.pretenseofknowledge.com

    Just got this from Apple.
    Apple - Batteries - iPhone
    For proper maintenance of a lithium-based battery, it’s important to keep the electrons in it moving occasionally. Be sure to go through at least one charge cycle per month (charging the battery to 100% and then completely running it down).
    http://www.apple.com/batteries/iphone.html
    http://support.apple.com/kb/HT1476?viewlocale=en_US

Maybe you are looking for