Ensuring that variable is initialized only once in a movieclip

Guys, what is the way to ensure that variable is initialized only once in each instance of a movieclip?
I tried:
if (!isLocked)
    trace("setting up isLocked variable");
      var isLocked:Boolean = new Boolean(false);//I need this variable to be initialized only once for each instance of this movieclip and to value of false
but this doesn't work.
Any ideas?

Note that new Boolean() makes zero sense. And this is the beef I have with the convention of checking for existence with !someVariable. Because inexperienced programmers will use that logic with Boolean (which always exists if you're checking it, but is either true or false) or Numbers, which might exist with a value of zero and will make that expression false.
Try
if (!this.hasOwnProperty('isLocked')) {
     var isLocked:Boolean = true;
This may not work because of variable hoisting in AS. It's hard to know what the addFrameScript code will do to this in the background.
Note that you can avoid this by using a proper Class with accessors and mutators and avoiding timeline code.

Similar Messages

  • How can I ensure a function is called only once in a query?

    I have a function (in a package) that returns the start date and end date to be used by my query. The query was taking bind variables but when I updated it to use the function calls it slowed down a lot.
    I tried creating an inline view that selects the start and end date and joins with the other table but this does not help. I thought the inline view would only be run once but this is not the case. I have my function print out a value from a sequence and i see that it is called thousands of times.
    Why would the procedure call be so much slower?
    How can I ensure that the function is only called once in the query?
    This is what I currently have:
    SELECT col1, col2
    FROM aTable,
    (SELECT proc.getStartdate startDate,
    proc.getEndDate endDate
    FROM dual) dt
    WHERE aTable.theDate >= dt.startDate
    AND aTable.theDate <= dt.endDate
    Thanks

    They get the begining and ending dates to be used by the query.
    My application uses the Oracle Portal. Each user can select their date range and it is stored as a user preference. The portal API provides funcitons for retrieving the preferences and I have encapsulated it in my procedure so the developers do not need knowledge of the portal. If they just restrict their queries to the dates returned by this function they will get the needed data.
    Our work around as been to pass these date variables around as bind variables.

  • Correlation set may be initialized only once

    Hello !
    I have the following scenario : I initialize a correlation in the first receive shape . After that , in a loop , I have a send shape , to send a bunch of messages (no correlation initializing needed since I did it at the beginning of the orchestration -
    I just have the correct correlation value in the body of the message ) . In another loop I'm looking for correlated responses (I'm following the correlation ) . 
    What I want to do is to move the initialization of the correlation to the send port , in the loop . I'm hitting the issue with "Correlation set may be initialized only once" . The solution is to create o scope inside the loop and to move the correlation
    from the general level to that scope - it works . However , when I want to select to follow the correlation in the response loop , it's not possible because is only visible to the send loop scope . Even if I create a similar scope in the receive loop and copy
    the correlation there , still the responses are not correlated . 
    Any ideea if is possible to correlate the responses when you initialize multiple time a correlation when you are sending the requests ? 
    Thanks

    It's because the Correlation Set can only be initialized once per Scope.  But you already know that ;)
    I think what you really want is a Self Correlating Ports. 
    http://msdn.microsoft.com/en-us/library/aa954477.aspx
    There's a number of Blog posts as well with samples.

  • Both my husband and I have our Macs backed up on Time Machine. I have a new Mac and want to download my files,etc. from Timeline to my new Mac. How do I ensure that Time Machine downloads only MY files, and not my husband's files?

    Both my husband and I have our MacBook Pros backed up to Time Machine. I have a new MacBook Pro and want to download my files, etc. from Time Machine to my new Mac. I do I ensure that Time Machine downloads only MY files to my new Mac, and not my husband's files?

    OS X uses a unique identifier so there will be no problems.

  • How can I ensure that a file is only ftp-ed once?

    Hi Frens,
    Im at the level of testing my codes and I noticed my code deliberately ftps a file even though it has been sent. Some servers do not accept duplicate files to be sent at their servers therefore causing FTP ok at first attempt and FTP not successful at 2nd attempt with error message file already ftped.
    Can someone help to advice how can I overcome this issue?
    CURSOR Diebank_RRTC_Lot (pInvoiceNo varchar2,pShipTo varchar2) IS
    SELECT   'D' record_id, 'DIEBANK' dept, invoiceno,
             DECODE (INSTR (MAX (d.device), '/'),
                     '0', MAX (d.device),
                     SUBSTR (MAX (d.device),
                             INSTR (MAX (d.device), '/') + 1,
                             LENGTH (MAX (d.device))
                    ) part_name,
             ' ' pd_part_name, d.customerlotnumber intersil_lot_no,
             MAX (d.originalcustomerlotnumber) waferlotnumber,
             NVL (MAX (d.waferquantity), 0) wafer_quantity, MAX (mawb) mawb,
             MAX (hawb) hawb, MAX (shipfrom) from_org_code, shipto to_org_code,
             SUBSTR (MAX (invoicedate), 3, 6) ship_out_date,
             SUBSTR (MAX (invoicedate), 10, 6) ship_out_time,
             MAX (labeldatecode) datecode, MAX (d.lotobject) lotobject
    FROM     fwcatns_diesinventory d, fwwiptransaction w, fwmp.proman_invoice_info@mmesp pr
       WHERE d.lotobject = w.lotobject
         AND d.asyinvoiceno = pr.invoiceno
         AND activity = 'Terminated'
         AND pr.invoiceno = pinvoiceno
         AND pr.shipto = pshipto
         AND LTRIM (d.customercode) IN ('HAT', 'HUS', 'ISL', 'ELS', 'ELX')
         AND d.state IN ('RDUMMY', 'RRTC', 'RDSCRAP')
         AND (pr.invoicedate > from_sysdate
         AND pr.invoicedate <= to_sysdate)
    GROUP BY invoiceno, shipto, customerlotnumber;
    CURSOR Diebank_RRTC_Lo_Filename Is
    SELECT shipfrom, shipto, invoiceno
      FROM fwcatns_diesinventory d, fwmp.proman_invoice_info@mmesp p
    WHERE d.asyinvoiceno = p.invoiceno
       AND d.state IN ('RDUMMY', 'RRTC', 'RDSCRAP')
       AND LTRIM (d.customercode) IN ('HAT', 'HUS', 'ISL', 'ELS', 'ELX')
       AND (invoicedate > from_sysdate
       AND invoicedate <= to_sysdate);
    BEGIN
        from_sysdate := to_char(sysdate-2,'YYYYMMDD')||' 235959';
        to_sysdate := to_char(sysdate-1,'YYYYMMDD')||' 235959';
        vpath := CS_UTILS.GET_UTL_PATH ;
    FOR Rec IN Diebank_RRTC_Lo_Filename  LOOP
            v_sysdate    := to_char(sysdate-1,'YYYYMMDD');
            Filename:= Rec.shipfrom||'_'||Rec.shipto||'_'||substr(v_sysdate,1,8)||'_'||Rec.invoiceno||'.txt';
            edi_hat_data := utl_file.fopen(vpath,filename,'W');
            var1 := to_char(sysdate,'YYYYMMDD HH24MISS');
            dbms_output.put_line('Start      '||var1);
            Hdr_Sql := 'H'||to_char(sysdate-1,'YYMMDD');
            utl_file.put_line(edi_hat_data,Hdr_sql);
            nRecord := '0';
    FOR Lotcur IN Diebank_RRTC_Lot (Rec.InvoiceNo,Rec.ShipTo) LOOP
           SELECT MAX(lottype),SUM(componentqty) INTO vLotCode,vDieQty FROM fwlot WHERE sysid = Lotcur.Lotobject;
            IF    instr(vLotCode,'RR') > 0 OR instr(vLotCode,'CR') > 0 OR
                  instr(vLotCode,'RT') > 0 OR instr(vLotCode,'RE') > 0 OR
                  instr(vLotCode,'CE') > 0 OR instr(vLotCode,'RW') > 0 THEN
                  vLotCode := 'REWORK';
            ELSIF (instr(vLotCode,'E') > 0 AND instr(vLotCode,'IE') = 0 AND instr(vLotCode,'PPE') = 0) OR instr(vLotCode,'Q') > 0 THEN
                  vLotCode := 'ENGINEERING';
            ELSIF  instr(vLotCode,'P') > 0 OR instr(vLotCode,'IE') > 0 THEn
                  vLotCode := 'PRODUCTION';
            ELSE
                  vLotCode := 'PRODUCTION';
            END IF;
            Unix_Sql := rpad(LotCur.Record_Id,1,' ')||rpad(Rec.InvoiceNo,20,' ')||rpad(Lotcur.MAWB,35,' ')||rpad(NVL(Lotcur.HAWB,' '),35,' ')||
                      rpad(to_char(to_date(Lotcur.Ship_Out_Date,'YYMMDD'),'MMDDYY'),6,' ')||rpad(Lotcur.Ship_Out_Time,6,' ')||
                      rpad(Lotcur.From_Org_Code,3,' ')||
                      rpad(Lotcur.To_Org_Code,3,' ')||
                      rpad(Lotcur.Intersil_Lot_No,20,' ')||rpad(Lotcur.Dept,8,' ')||rpad(Lotcur.WaferLotNumber,20,' ')||
                      rpad(Lotcur.Part_Name,25,' ')||
                      rpad(NVL(Lotcur.PD_Part_Name,' '),25,' ')||lpad(vDieQty,10,'0')||lpad(Lotcur.Wafer_Quantity,2,'0')||
                      rpad(NVL(' ',' '),10,' ')||rpad(NVL(Lotcur.Datecode,' '),4,' ')||rpad(vLotCode,20,' ')||
                      rpad(' ',30,' ');
            utl_file.put_line(edi_hat_data,Unix_sql);
            nRecord := nRecord + 1;
    END LOOP;
            Hdr_Sql := 'T'||lpad(nRecord,5,'0');
            utl_file.put_line(edi_hat_data,Hdr_sql);
            v_msg := 'Close Unix File';
            utl_file.fclose(edi_hat_data);
          filename2 := 'toftp.hattw.'||to_char(sysdate,'YYYYMMDDHH24MISS');
          edi_ftp_data  := utl_file.fopen(vpath,filename2,'W');
          Unix_Sql := '-sfile='||filename||' -ddir=/CAS/ASN -dfile='||filename||' -user=intersil\\/carsemftp -pass=40t+bqR -ip=192.157.179.7';
          Utl_File.put_line(edi_ftp_data,Unix_Sql);
          utl_file.fclose(edi_ftp_data);
          IF Rec.ShipTo = 'UNM' Then
          filename2 := 'toftp.hattws.'||to_char(sysdate,'YYYYMMDDHH24MISS');
          edi_ftp_data  := utl_file.fopen(vpath,filename2,'W');
          Unix_Sql := '-sfile='||filename||' -ddir=/home/islasn -dfile='||filename||' -user=islasn -pass=isl@usm -ip=ftp://ipohftp.unisemgroup.com';
          Utl_File.put_line(edi_ftp_data,Unix_Sql);
          utl_file.fclose(edi_ftp_data);
          ELSIF Rec.ShipTo = 'MMT' Then
          filename2 := 'toftp.hattws.'||to_char(sysdate,'YYYYMMDDHH24MISS');
          edi_ftp_data  := utl_file.fopen(vpath,filename2,'W');
          Unix_Sql := '-sfile='||filename||' -dfile='||filename||' -user=INTERSIL -pass=S4rOgoB3 -ip=thftp.m-microtech.com';
          Utl_File.put_line(edi_ftp_data,Unix_Sql);
          utl_file.fclose(edi_ftp_data);
          --this ftp not working
          ELSIF Rec.ShipTo = 'ANS' Then
          filename2 := 'toftp.hattws.'||to_char(sysdate,'YYYYMMDDHH24MISS');
          edi_ftp_data  := utl_file.fopen(vpath,filename2,'W');
          --Unix_Sql := '-sfile='||filename||' -dfile='||filename||' -user=intersilasn -pass=anst052108 -ip=58.214.241.77';
          Unix_Sql := '-sfile='||filename||' -dfile='||filename||' -user=intersilasn -pass=anst052108 -ip=58.214.5.236';
          Utl_File.put_line(edi_ftp_data,Unix_Sql);
          utl_file.fclose(edi_ftp_data);
          ELSIF Rec.ShipTo = 'CAS' Then
          filename2 := 'toftp.hattws.'||to_char(sysdate,'YYYYMMDDHH24MISS');
          edi_ftp_data  := utl_file.fopen(vpath,filename2,'W');
          Unix_Sql := '-sfile='||filename||' -dfile='||filename||' -user=intersilasn -pass=isil62nu -ip=ftp:\\192.228.215.6';
          Utl_File.put_line(edi_ftp_data,Unix_Sql);
          utl_file.fclose(edi_ftp_data);
          ELSIF Rec.ShipTo = 'SCM' Then
          filename2 := 'toftp.hattws.'||to_char(sysdate,'YYYYMMDDHH24MISS');
          edi_ftp_data  := utl_file.fopen(vpath,filename2,'W');
          Unix_Sql := '-sfile='||filename||' -ddir=/Intransit_up_folder -dfile='||filename||' -user=carsem135 -pass=Carsem -ip=203.115.242.199';
          Utl_File.put_line(edi_ftp_data,Unix_Sql);
          utl_file.fclose(edi_ftp_data);
          END IF;
    END LOOP;Edited by: user11342432 on Oct 29, 2009 10:16 PM

    The code looks ugly.. a lot of testing of data using PL/SQL if conditions.. why do you not use SQL for that? Why not simply join the data sets, instead of coding nested loop joins.
    And why do you step outside of Oracle into the operating system?
    Our system do a lot of FTPs of Oracle data - but only uses PL/SQL. Never once having to use UTL_FILE to create external files (which requires external space, external permissions, external file management, etc).
    The "+file+" is create as CLOB (e.g. files=( filename varchar2(100), ..other attributes, file_content clob ) ).
    This is then ftp'ed using a PL/SQL package that accepts a CLOB as file input and then ftp's it to a destination server.
    Another point regarding your code - modularise. Design and build software like you would a Lego creation - using reusable blocks of code. A procedure or function should do one thing only and do it well. Not attempt to do everything and anything and clean the kitchen sink afterwards...

  • HT204088 My purchase history shows that I am charged only once but my bank statement shows tha I am charghed thrice

    I purchased Whatsapp and I was charged once.After that I only downloaded Free Apps but I am charged twice in my bank statement but purchase history shows only 1 purchase in AppStore

    To Contact iTunes Customer Service and to request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • 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

  • Execute Javascript in SCRIPT_ITEM onload, but only once

    Hi,
    if I publish my webtemplate then the javascript function (executeJS_SET_ITEM_PARAMETERS_R) inside the script item is executed. The execution is done via onload="javascript:executeJS_SET_ITEM_PARAMETERS_R".
    Within the JavaScript I create some parameters to change some settings of the webtemplate. At then end the command is executed and the template is refreshed.
    1.The problem is that the Javascript is executed recursively (always onload). How can I ensure that the JavaScript is executed only once (the template only refreshed once)?
    2.Within executeJS_SET_ITEM_PARAMETERS_R these lines are commented:
      //To extract specific values of parameters refer to the following:
      //var key = currentState.getParameter( <b>PARAM_KEY</b>).getValue();
      //alert( "Selected key: " + key );
      What is meant by PARAM_KEY? Maybe I can use this parameter to create a condition that ensures to execute the code only once. Where can I found these PARAM_KEYs?
    Thanks for the info.
    BR, Andreas

    You might try this approach, using the following workflow...
    1) *Get Specified Finder Items* -- press the "+" sign, navigate to the target folder and choose it.
    2) *Set Folder Views* -- move the icon slider to 128, etc., and check "Apply Changes to Sub-folders."
    From Automator's File menu select Save As Plug-in > Plug-in for: Folder Actions.
    The AppleScript, located in the User > Library > Scripts > Folder Action Scripts folder, can then be modified:
    on adding folder items to this_folder after receiving added_items
    tell application "Macintosh HD:Users:username:Library:Workflows:Applications:Folder Actions:Make 128.app"
    run -- 'run' replaces 'open added_items'
    end tell
    end adding folder items to
    This has worked for me consistently (so far) using Mac OS 10.4.11; not tested in Leopard. Your results may vary.
    Good luck.

  • 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

  • Condition value need to be applicable only once

    Hi,
    I am working on solution to define set up cost for machined components. When components needs to be ordered, irrespective of the quantity there will be a fixed cost for the given material which is other than the normal unit price.
    Although I can simply define a fixed value condition, it will not solve my problem. When we run MRP, based on MRP area requirements / project requirements, each of the requirement for the same material can come as different line items in a PR and when we covert the same into a PO, there is always a possibility that same material can appear in several line items. If I use fixed value type of condition, this value will appear for all such line items for that given material which is not the desired situation.
    I think I can't even use condition grouping functionality (I am not very sure of this), as same condition if used for other materail number in the same PO, it should consider that value.
    I am looking for a solution, how to define a condition that will be applicable only once for a particular material number in one given PO.
    Any ideas / help? Thanks in advance.
    Cheers
    Jags

    Hi
    Thanks for your reply but I am not clear how it will solve my problem.
    Please note:
    1. Manually intervention is impossible as volume of such scenario and materials are very high.
    2. MAP of the material should be impacted with the cost which is to be paid as set up cost which is nothing but fixed cost for that given material at PO level.
    3. During IV, the condition value should be available for processesing (not to be provided manually).
    Will definitely reward points if it can help me in solution.
    Cheers
    Jags

  • How do i fire a query/Stored procedure only once

    Hi,
    I have a master frame and multiple child frames. Master frame triggers child1 frame which triggers child 2 frame etc using some common keys between the frame.
    Now each frame executes a stored procedure and then uses the Db2 cursor as a record set. However when the same frame is fired again then the stored procedure is triggered again. But i could very well use the same record set from the record set that i already have,
    In other words i need to fire the stored procedure/query only once and not every time the frame is fired.
    I just need to get the record set for each frame and then operate on the retrieved record sets.
    Is there a way to do this?
    Currently I experience serious performance issues as the stored procedures get fired repeatedly thousands of times
    Any help will be greatly appreciated
    Thanks
    anand

    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

  • Help: I want to auto schedule a load using file watcher but it runs only once for the first time and after that it is not running at all

    Hi All,
    I am trying  to execute the below code as provided from one of the blogs. i am able to run the job only once based on a file watcher object(i.e. for very first time) and after that the job is not running at all and if  i schedule the job to run automatically based on interval of 10 or more minutes it is executing properly). Please let me know or guide me if i have missed any step or configuration.that is needed.
    Version of Oracle 11.2.0.1.0
    OS : Windows 7 Prof
    Given all the necessary privileges
    BEGIN
      DBMS_SCHEDULER.CREATE_CREDENTIAL(
         credential_name => 'cred',
         username        => 'XXXX',
         password        => 'XXXX');
    END;
    CREATE TABLE ZZZZ (WHEN timestamp, file_name varchar2(100),
       file_size number, processed char(1));
    CREATE OR REPLACE PROCEDURE YYYY
      (payload IN sys.scheduler_filewatcher_result) AS
    BEGIN
      INSERT INTO ZZZZ VALUES
         (payload.file_timestamp,
          payload.directory_path || '/' || payload.actual_file_name,
          payload.file_size,
          'N');
    END;
    BEGIN
      DBMS_SCHEDULER.CREATE_PROGRAM(
        program_name        => 'prog1',
        program_type        => 'stored_procedure',
        program_action      => 'YYYY',
        number_of_arguments => 1,
        enabled             => FALSE);
      DBMS_SCHEDULER.DEFINE_METADATA_ARGUMENT(
        program_name        => 'prog1',
        metadata_attribute  => 'event_message',
        argument_position   => 1);
      DBMS_SCHEDULER.ENABLE('prog1');
    END;
    BEGIN
      DBMS_SCHEDULER.CREATE_FILE_WATCHER(
        file_watcher_name => 'file_watcher1',
        directory_path    => 'D:\AAAA',
        file_name         => '*.txt',
        credential_name   => 'cred',
        destination       => NULL,
        enabled           => FALSE);
    END;
    BEGIN
      DBMS_SCHEDULER.CREATE_JOB(
        job_name        => 'job1',
        program_name    => 'prog1',
        queue_spec      => 'file_watcher1',
        auto_drop       => FALSE,
        enabled         => FALSE);
      DBMS_SCHEDULER.SET_ATTRIBUTE('job1','PARALLEL_INSTANCES',TRUE);
    END;
    EXEC DBMS_SCHEDULER.ENABLE('file_watcher1,job1');
    Regards,
    kumar.

    Please post a copy and paste of a complete run of a test case, similar to what I have shown below.
    SCOTT@orcl12c> SELECT banner FROM v$version
      2  /
    BANNER
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    PL/SQL Release 12.1.0.1.0 - Production
    CORE    12.1.0.1.0    Production
    TNS for 64-bit Windows: Version 12.1.0.1.0 - Production
    NLSRTL Version 12.1.0.1.0 - Production
    5 rows selected.
    SCOTT@orcl12c> CONN / AS SYSDBA
    Connected.
    SYS@orcl12c> -- set file watcher interval to one minute:
    SYS@orcl12c> BEGIN
      2    DBMS_SCHEDULER.SET_ATTRIBUTE
      3       ('file_watcher_schedule',
      4        'repeat_interval',
      5        'freq=minutely; interval=1');
      6  END;
      7  /
    PL/SQL procedure successfully completed.
    SYS@orcl12c> CONNECT scott/tiger
    Connected.
    SCOTT@orcl12c> BEGIN
      2    -- create credential using operating system user and password (fill in your own):
      3    DBMS_SCHEDULER.CREATE_CREDENTIAL
      4       (credential_name     => 'cred',
      5        username          => '...',
      6        password          => '...');
      7  END;
      8  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- create table to insert results into:
    SCOTT@orcl12c> CREATE TABLE ZZZZ
      2    (WHEN      timestamp,
      3      file_name varchar2(100),
      4      file_size number,
      5      processed char(1))
      6  /
    Table created.
    SCOTT@orcl12c> -- create procedure to insert results:
    SCOTT@orcl12c> CREATE OR REPLACE PROCEDURE YYYY
      2    (payload IN sys.scheduler_filewatcher_result)
      3  AS
      4  BEGIN
      5    INSERT INTO ZZZZ VALUES
      6        (payload.file_timestamp,
      7         payload.directory_path || '/' || payload.actual_file_name,
      8         payload.file_size,
      9         'N');
    10  END;
    11  /
    Procedure created.
    SCOTT@orcl12c> -- create program, define metadata, and enable:
    SCOTT@orcl12c> BEGIN
      2    DBMS_SCHEDULER.CREATE_PROGRAM
      3       (program_name          => 'prog1',
      4        program_type          => 'stored_procedure',
      5        program_action      => 'YYYY',
      6        number_of_arguments => 1,
      7        enabled          => FALSE);
      8    DBMS_SCHEDULER.DEFINE_METADATA_ARGUMENT(
      9       program_name         => 'prog1',
    10       metadata_attribute  => 'event_message',
    11       argument_position   => 1);
    12    DBMS_SCHEDULER.ENABLE ('prog1');
    13  END;
    14  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> BEGIN
      2    -- create file watcher:
      3    DBMS_SCHEDULER.CREATE_FILE_WATCHER
      4       (file_watcher_name   => 'file_watcher1',
      5        directory_path      => 'c:\my_oracle_files',
      6        file_name          => 'f*.txt',
      7        credential_name     => 'cred',
      8        destination          => NULL,
      9        enabled          => FALSE);
    10  END;
    11  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> BEGIN
      2    -- create job:
      3    DBMS_SCHEDULER.CREATE_JOB
      4       (job_name          => 'job1',
      5        program_name          => 'prog1',
      6        queue_spec          => 'file_watcher1',
      7        auto_drop          => FALSE,
      8        enabled          => FALSE);
      9    -- set attributes:
    10    DBMS_SCHEDULER.SET_ATTRIBUTE ('job1', 'PARALLEL_INSTANCES', TRUE);
    11  END;
    12  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- enable:
    SCOTT@orcl12c> EXEC DBMS_SCHEDULER.enable ('file_watcher1, job1');
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- write file (file must not exist previously):
    SCOTT@orcl12c> CREATE OR REPLACE DIRECTORY upncommon_dir AS 'c:\my_oracle_files'
      2  /
    Directory created.
    SCOTT@orcl12c> declare
      2    filtyp utl_file.file_type;
      3  begin
      4    filtyp := utl_file.fopen ('UPNCOMMON_DIR', 'file1.txt', 'W', NULL);
      5    utl_file.put_line (filtyp, 'File has arrived ' || SYSTIMESTAMP, TRUE);
      6    utl_file.fclose (filtyp);
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- wait long enough (may take more than one minute) for job to run:
    SCOTT@orcl12c> EXEC DBMS_LOCK.SLEEP (100)
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- check for results:
    SCOTT@orcl12c> SELECT * FROM zzzz
      2  /
    WHEN
    FILE_NAME
    FILE_SIZE P
    22-OCT-13 10.12.28.309000 PM
    c:\my_oracle_files/file1.txt
            57 N
    1 row selected.
    SCOTT@orcl12c> declare
      2    filtyp utl_file.file_type;
      3  begin
      4    filtyp := utl_file.fopen ('UPNCOMMON_DIR', 'file2.txt', 'W', NULL);
      5    utl_file.put_line (filtyp, 'File has arrived ' || SYSTIMESTAMP, TRUE);
      6    utl_file.fclose (filtyp);
      7  end;
      8  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- wait long enough (may take more than one minute) for job to run:
    SCOTT@orcl12c> EXEC DBMS_LOCK.SLEEP (100)
    PL/SQL procedure successfully completed.
    SCOTT@orcl12c> -- check for results:
    SCOTT@orcl12c> SELECT * FROM zzzz
      2  /
    WHEN
    FILE_NAME
    FILE_SIZE P
    22-OCT-13 10.12.28.309000 PM
    c:\my_oracle_files/file1.txt
            57 N
    22-OCT-13 10.14.08.580000 PM
    c:\my_oracle_files/file2.txt
            57 N
    2 rows selected.

  • Need to display records only once for that particular group

    Hi,
    I have a requirement like displaying repeated records only once for that particular group.
    For eg, in the emp table, I need to display repeated deptno only once for the particular group of job.
    And for the above requirement I have used the below query,
    SELECT empno, DECODE (LAG (job, 1) OVER (ORDER BY job), job, NULL, job),
    DECODE (LAG (deptno, 1) OVER (ORDER BY deptno), deptno, NULL, deptno)
    FROM emp;
    Output:
    EMPNO     JOB     DEPTNO
    7782          10
    7934     CLERK     
    7839     PRESIDENT     
    7876          20
    7788          
    7902     ANALYST     
    7566     MANAGER     
    7844          30
    7900          
    7654     SALESMAN     
    7698          
    But in the above output you can find that, say deptno 10 is getting displayed only once, whereas I want that deptno 10 to be checked whether it is getting repeated within the group of JOB and than hide the deptno 10 only if it is repeated within that job group. If not, deptno 10 should be displayed again.
    Please help me in this.
    Regards,
    Shiva

    Hi,
    Hope the below helps.
    SELECT emp_id, job, deptno,
           CASE WHEN LAG(deptno, 1) OVER (partition by job order by deptno) = deptno THEN null else deptno end
      FROM empRegards
    Ameya

  • Do you agree with me that mackeeper is a very bad software? I installed yesterday, it ran only once. After it didn't recognize the clue. I had a hard problem to unsinstalle it. I am trying to recover $39,50 I paid for it. Never install mackeeper.

    Do you agree with me that mackeeper is a very bad software? I installed yesterday, it ran only once. After it didn't recognize the clue. I had a hard problem to unsinstall it. I am trying to recover $39,50 I paid for it. Never install mackeeper. Sure ilness will arrive.
    I fill very bad from Chile.
    Ricardo

    Apps like MacKeeper or any other maintenance apps like CleanMyMac 1 or 2, TuneUpMyMac or anything like these apps, installed on your Mac, while they appear to be helpful, can do too good a job of data "cleanup" causing the potential to do serious data corruption or data deletion and render a perfectly running OS completely dead and useless leaving you with a frozen, non-functional Mac.
    Plus, these type of apps aren't really necessary. They really aren't.
    There are manual methods to clear off unnecessary data off of your Mac that are safer and you have complete control over your Mac and not just leave a piece of auto cleaning software in charge of clearing off data off of your Mac.
    These types of apps potential of causing OS X issues outweighs the implied good and benefits these types of hard drive or memory "cleaning" apps are written to do.
    Plus, the software companies that write these apps make it hard to easily uninstall these apps if something DOES go wrong and these apps work in a way where you have no recovery or revert function to return your Mac back to its former, working state in the event something does go wrong.
    Apps that have no obvious way or uninstall themselves or do not come with a dedicated uninstaller app to uninstall the app in question should be avoided and NOT even considered for download, install and use.
    It is best to never, EVER download and install these types of apps.
    The risk to your system and data is too great a risk!

  • How can i arrange that movies and picts are stored only once?, how can i arrange that movies and picts are stored only once?

    how can i arrange that movies and picts are stored only once?, i find them in thumbnail, i movie, imovie thumbnails, and some times in cache.mov or as imovie proyects

    The movies themselves are stored only once. The other files you're seeing are small ones that are used to reference, display and access the main file. If you check the file sizes, you'll see that only one (the movie file itself) is large.
    If you don't want anything saved but the main file, stop using iMovie.

Maybe you are looking for

  • Multiple Account Assignment issue with BAPI_PO_CREATE1 for service POs

    Whle creating service PO through BAPI_PO_CREATE1, The account assignments at the service line items were not being added correctly at the item level, instead they are getting split further wrt tax jurisdiction. This is occuring when an item have mult

  • Purchase Order approval workflows not forwarding through TC SWIA

    Hi When I am forwarding work item to other user I am getting following error. Work item 000015375242: Forwarding not allowed in status READY Message no. WL842 Diagnosis The work item cannot be forwarded in its current status. System Response The acti

  • Getting one swf to be higher than another in the zindex of a html page

    Hey all could someone please show me how I can tell one .swf to be higher in the pages object stack than an other, I presume using javascript? Any help would be great.

  • Row Template Condition doesnt working

    Hi all, i have a self made "row template" for my report: "Before Rows": <table cellpadding="5" cellspacing="0" border="0" summary=""> <tr> <th>ID</th> <th>ID_SHOW</th> <th>TITEL</th> <th>DOCUMENT</th> <th>status_external</th> <th>status_internal</th>

  • Contact Oracle Database Development Team

    Does anyone know of any email address where in we can send to Oracle Database R&D Team our suggestions and feedback etc. I have been trying to find the contact info for a very long time. It is so difficult to find one. Is it that Oracle is not intere