Parallel process with reentrant VI have same value in both threads

Has it been so long since I programmed LabVIEW that I forgot some basic stuff??
I have a main VI which originally called dynamic processes in parallel.
I then called the sub-vi's dirtectly and still run them in parallel, but thwey now have seperate names.
I use a QSM.  Each parallel thread now has it's own QSM, because although I was using a Queue Name for each dynamic queue, the data that was being extracted was shared or done between the two threads.  If I confused everyone with the statement, I shall explain.
Two parallel processes, calling a QSM (re-entrant).  They have the same number of elements and matching sets.
EX:
Process 1          Process 2
Task1                 Task1
Task2                 Task2
Task3                 Task3
Task4                 Task4
Task5                 Task5
Task6                 Task6
I was expecting each thread (each process) to extract from the queue the list of tasks as entered (from Task1 to Task6).  What the processes were getting was the following:
Process 1          Process 2
Task1                 Task1
Task2                 Task3
Task4                 Task5
Task6                 default
Each Process was sending a different Queue Name to the QSM.  Each queue should have it's own name.
I need to get this running by tomorrow with no excuse!  So I decided to do a lame workaround by also having 2 QSMs.  That fixed it..
In each parallel process (which are a copy of each other with different names) there is a call to open a telnet session.  I probed and placed breakpoints in the code.  Although each process has a different name and the call to the function that opens the telnet session is re-entrant, the very same telnet reference number is assigned to both processes.
Why?  Why would they get the same reference number?  I made all vi's down to (and including) Telnet Open Connection as re-entrant (although it was not needed) and it still assigns the same reference number to each telnet session.  Why?  What I am not seeing?  What am I missing?
Unfortunately, I cannot post the code..  But it is not complicated code.  Just 2 sessions with different IP addresses.  I would expect different telnet session references... 
As a matter of fact, I need to try something silly.. 

I should provide more details with the solution....
I just have to stop saying "D'Oh!!"
Okay... here goes...
In the LVOOP, I am using Notifiers and Semaphores to ensure that a race condition cannot occur.  Works well with previously written code.
In this particular implementation, I have the same / similar object being created more than once (twice at this time).
Where I went wrong (D'Oh!!!!), was to have a static name for a given object when creating the Notifier and Semaphore references.  Since the same name was given, so was the reference.  SInce the references were the same, so was the data, and so on.
D'Oh!!!!!!
D'Oh!!!!!!
Now I know why a particular bird was called D'Oh-D'Oh bird... 
D'Oh!!!  Such a silly mistake...
D'Oh!!!
Hope it makes a few people laugh...  or help another bird....

Similar Messages

  • How to map secondry elements with main if have same ids for both?

    I need to map secondry elements with its matching primary elements if they both have same id.
    How can this be achieved in xslt.
    If ids are not matching then not a single element of secondry sholud be shown.
    If ids matching, then other fields of secondry elements, should be mapped to similar fields of primary elements.
    Eg: Its like some program running and in between some add on programs started (may be trailor or advertisement).
    the add on program is not always shown (optional), and whenever shown it has its own data information etc etc.
    Please provide me some input, how to map and proceed.
    Not sure what this code is really doing.
    <xsl:template match="SECONDARY_EVENT_LIST">
              <xsl:variable name="secondaryElements" select="ancestor::SCHEDULE/SECONDARY_ELEMENT_LIST"/>
              <xsl:for-each select="SCHEDULE_ELEMENT_ID">
                   <xsl:variable name="id" select="."/>
                   <xsl:apply-templates select="$secondaryElements/SCHEDULE_ELEMENT[(@ID=$id)]"/>
              </xsl:for-each>
         </xsl:template>
    Is this having any relation with what my requirement is all about?

    Hi,
    You can use XPATH command to get the exact tag.
    You can access each tag with it location like “/Report_Name/Group_Tag/Element_ID”.
    I think this will remove the ambiguity of Tags with same ID.

  • Parallel processing of mass data : sy-subrc value is not changed

    Hi,
    I have used the Parallel processing of mass data using the "Start New Task" . In my function module I am handling the exceptions and finally raise the application specific old exception to be handled in my main report program. Somehow the sy-subrc is not getting changed and always returns 0 even if the expection is raised.
    Can anyone help me about the same.
    Thanks & Regards,
    Nitin

    Hi Silky,
    I've build a block of code to explain this.
      DATA: ls_edgar TYPE zedgar,
            l_task(40).
      DELETE FROM zedgar.
      COMMIT WORK.
      l_task = 'task1'.
      ls_edgar-matnr = '123'.
      ls_edgar-text = 'qwe'.
      CALL FUNCTION 'Z_EDGAR_COMMIT_ROLLBACK' STARTING NEW TASK l_task PERFORMING f_go ON END OF TASK
        EXPORTING
          line = ls_edgar.
      l_task = 'task2'.
      ls_edgar-matnr = 'abc'.
      ls_edgar-text = 'def'.
      CALL FUNCTION 'Z_EDGAR_COMMIT_ROLLBACK' STARTING NEW TASK l_task PERFORMING f_go ON END OF TASK
        EXPORTING
          line = ls_edgar.
      l_task = 'task3'.
      ls_edgar-matnr = '456'.
      ls_edgar-text = 'xyz'.
      CALL FUNCTION 'Z_EDGAR_COMMIT_ROLLBACK' STARTING NEW TASK l_task PERFORMING f_go ON END OF TASK
        EXPORTING
          line = ls_edgar.
    *&      Form  f_go
    FORM f_go USING p_c TYPE ctype.
      RECEIVE RESULTS FROM FUNCTION 'Z_EDGAR_COMMIT_ROLLBACK' EXCEPTIONS err = 2.
      IF sy-subrc = 2.
    *this won't affect the LUW of the received function
        ROLLBACK WORK.
      ELSE.
    *this won't affect the LUW of the received function
        COMMIT WORK.
      ENDIF.
    ENDFORM.                    "f_go
    and the function is:
    FUNCTION z_edgar_commit_rollback.
    *"*"Interface local:
    *"  IMPORTING
    *"     VALUE(LINE) TYPE  ZEDGAR
    *"  EXCEPTIONS
    *"      ERR
      MODIFY zedgar FROM line.
      IF line-matnr CP 'a*'.
    *comment raise or rollback/commit to test
    *    RAISE err.
        ROLLBACK WORK.
      ELSE.
        COMMIT WORK.
      ENDIF.
    ENDFUNCTION.
    ok.
    In your main program you have a Logical Unit of Work (LUW), witch consists of an application transaction and is associated with a database transaction. Once you start a new task, your creating an independent LUW, with it's own database transaction.
    So if you do a commit or rollback in your function the effect is only on the records your processing in the function.
    There is a way to capture the event when this LUW concludes in the main LUW. That is the PERFORMING whatever ON END OF TASK. In there you can get the result of the function but you cannot commit or rollback the LUW from the function since it already have implicitly happened at the conclusion of the funtion. You can test it by correctly comment the code I've supplied.
    So, if you  want to rollback the LUW of the function you better do it inside it.
    I don't think it matches exactly your question, maybe it lead you on the right track. Give me more details if it doesn't.
    Hope it helps,
    Edgar

  • Parallel process with a queue and file?

    Hello, first of all sorry for my bad english^^:
    I am working for days on my project where I have to show the parallel process while transfering information by different ways and their problems (like timing and so on). 
    I chose the transmission of information to a parallel process by (1) a queue, and by (2) a file (.txt). (other ways are welcome, do you have 1-2 other ideas?)
    To solve this problem I made three while loops, the first one is the original one, where the original information (as a signal) is created and send by queue and file to the other two while loops, where this information is getting evaluted to create the same signal.
    so in the end you can compare all signals, if they are the same - so that you can answer the question with the parallelity of process.
    but in my vi file i have some problems:
    the version with the queue works pretty fine - it's almost parallel
    but the version with file doesn't work parallel, and i have no idea how i can solve it - -
    i'm a newbie^^
    can someone correct my file, so both (file and queue version) run parallel with the original one, or tell me what i can or must do?
    Attachments:
    Queue_Data_Parallel_FORUM.vi ‏23 KB

    LapLapLap wrote:
    Hello, first of all sorry for my bad english^^:
    I am working for days on my project where I have to show the parallel process while transfering information by different ways and their problems (like timing and so on). 
    I chose the transmission of information to a parallel process by (1) a queue, and by (2) a file (.txt). (other ways are welcome, do you have 1-2 other ideas?)
    To solve this problem I made three while loops, the first one is the original one, where the original information (as a signal) is created and send by queue and file to the other two while loops, where this information is getting evaluted to create the same signal.
    so in the end you can compare all signals, if they are the same - so that you can answer the question with the parallelity of process.
    but in my vi file i have some problems:
    the version with the queue works pretty fine - it's almost parallel
    but the version with file doesn't work parallel, and i have no idea how i can solve it - -
    i'm a newbie^^
    can someone correct my file, so both (file and queue version) run parallel with the original one, or tell me what i can or must do?
    A queue is technically never parallell, though you can have several if you really need parallellism. Other methods include Events, Action Engines, Notifiers (and why not webservices) for information transfer between processes.
    Due to limitations in the disk system you can only read/write one file at a time from one process, so i wouldn't recommend that. If you use a ramdisk it might work.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • BPM Parallel Process with Exclusive Gateway

    Hi,
    I am facing issue with Exclusive Gateway in Parallel Process.
    Issu is, process always in In-Progress state at parallel Join. I mean process stops at Parallel Join and more over there are no errors in the process. If I delete Exclusive Gateway in Parallel process, the process is going to next level human task through Parallel Join. It means working fine.
    I have designed my process in such a way that, 1st task is Human Task ---> then Parallel Split with 2 Human tasks, out of one task performing throught Excusive Gateway and another one is just simple approval. Finally I am merging these two Human tasks using Parallel Join then finally triggerting Approval Human task, and closing the Process.
    Appreciate your quick suggestions to fix this issue.
    Thanks in advance,
    Dev...

    Hi Unni,
    Thanks for your reply.
    I have checked all the parallel tasks and all are in completed state. No errors.
    If I delete Exclusive Gateway it is working fine. I have checked step by step tasks in NWA, and every thing goes well.
    Please let me know If I missout anything.
    Thanks in advance,
    Dev

  • How to do parallel processing with dynamic internal table

    Hi All,
    I need to implement parallel processing that involves dynamically created internal tables. I tried doing so using RFC function modules (using starting new task and other such methods) but didn't get success this requires RFC enabled function modules and at the same time RFC enabled function modules do not allow generic data type (STANDARD TABLE) which is needed for passing dynamic internal tables. My exact requirement is as follows:
    1. I've large chunk of data in two internal tables, one of them is formed dynamically and hence it's structure is not known at the time of coding.
    2. This data has to be processed together to generate another internal table, whose structure is pre-defined. But this data processing is taking very long time as the number of records are close to a million.
    3. I need to divide the dynamic internal table into (say) 1000 records each and pass to a function module and submit it to run in another task. Many such tasks will be executed in parallel.
    4. The function module running in parallel can insert the processed data into a database table and the main program can access it from there.
    Unfortunately, due to the limitation of not allowing generic data types in RFC, I'm unable to do this. Does anyone has any idea how to implement parallel processing using dynamic internal tables in these type of conditions.
    Any help will be highly appreciated.
    Thanks and regards,
    Ashin

    try the below code...
      DATA: w_subrc TYPE sy-subrc.
      DATA: w_infty(5) TYPE  c.
      data: w_string type string.
      FIELD-SYMBOLS: <f1> TYPE table.
      FIELD-SYMBOLS: <f1_wa> TYPE ANY.
      DATA: ref_tab TYPE REF TO data.
      CONCATENATE 'P' infty INTO w_infty.
      CREATE DATA ref_tab TYPE STANDARD TABLE OF (w_infty).
      ASSIGN ref_tab->* TO <f1>.
    * Create dynamic work area
      CREATE DATA ref_tab TYPE (w_infty).
      ASSIGN ref_tab->* TO <f1_wa>.
      IF begda IS INITIAL.
        begda = '18000101'.
      ENDIF.
      IF endda IS INITIAL.
        endda = '99991231'.
      ENDIF.
      CALL FUNCTION 'HR_READ_INFOTYPE'
        EXPORTING
          pernr           = pernr
          infty           = infty
          begda           = '18000101'
          endda           = '99991231'
        IMPORTING
          subrc           = w_subrc
        TABLES
          infty_tab       = <f1>
        EXCEPTIONS
          infty_not_found = 1
          OTHERS          = 2.
      IF sy-subrc <> 0.
        subrc = w_subrc.
      ELSE.
      ENDIF.

  • How to set a process with more than 10 item values to be changed?

    I am trying to make a "default" button where it resets the Column checkboxes to its original state but I have more than 10 iems and I cant fill them all in the 10 slots that they have. Anyone have any ideas? thanks.
    For example I have columns 1-20 and I want something like col 1-5 to be checked and col 6-20 to be unchecked as default.

    I tried to use process where i declare the new values i.e. ID=1/true, Name=0/false etc. and still nothing happens, anyone have any suggestions?

  • In a XSD, can a element's name & type attributes have same value ?

    Hi,
    Can i have a same value for the name & type attributes of an Element. For ex: in below XSD, the element 'ChildEL' has the same value('ChildEL') for the type attributes as the name('ChildEL') ?
    I am asking this because when i generate Java Classes using Castor Source Code generator using this XSD has input, the output classes do NOT compile since the class ChildEL inherits itself and which causes the cyclic inheritance. Please help.
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <xs:element name="ParentEL" type="ParentELType"/>
         <xs:complexType name="ParentELType">
              <xs:sequence>
                   <xs:element name="ChildEL" type="ChildEL" maxOccurs="unbounded"/>
              </xs:sequence>     
              <xs:attribute name="CreationDate" type="xs:dateTime"/>
         </xs:complexType>
         <xs:complexType name="ChildEL">
              <xs:sequence>
                   <xs:element name="Type" type="xs:string/>
                   <xs:element name="ID" type="xs:string/>
              </xs:sequence>
         </xs:complexType>
    </xs:schema>
    Thanks,
    Manoj

    I figured out that this is possible and to avoid the compilation error in Castor source code generator is to set the property org.exolab.castor.builder.javaclassmapping=type in castorbuilder.properties config file.

  • Retruning rows which have same value return by RANK function

    Hi, what I wanna acheive is to use a DENSE RANK function to identify the same value of the data, if rank values are same then extra out. Here is the code
    WITH CTE AS
    SELECT SalesPersonID,
    SalesQuota,
    DENSE_RANK() OVER (ORDER BY SalesQuota DESC) as DENSE_RANK
    FROM Sales.SalesPersonQuotaHistory
    WHERE SalesQuota BETWEEN 266000.00 AND 319000.00
    )This retrun
    SalesPersonID SalesQuota DENSE_RANK
    280 319000.00 1
    287 304000.00 2
    280 301000.00 3
    282 288000.00 4
    283 284000.00 5
    287 281000.00 6
    278 280000.00 7
    283 280000.00 7
    283 267000.00 8
    278 266000.00 9How could I select those rank value which are same value ??
    The result should be
    278 280000.00 7
    283 280000.00 7

    with cte as
    select salespersonid,
         salesquota,
         dense_rank() over (order by salesquota desc) as dr
       from sales.salespersonquotahistory
      where salesquota between 266000.00 and 319000.00
    select *
      from (
         select cte.*, count(*) over(partition by dr) ct
           from cte
    where ct > 1

  • How to determine how many times result set columns have same value

    Hi -
    I'm doing a report which will be used for payment trend analyses.
    My initial result set looks like this:
    HOUSEHOLD_ID     JAN_PMT     FEB_PMT     MAR_PMT     APR_PMT     MAY_PMT     JUN_PMT     JUL_PMT     AUG_PMT     SEP_PMT     OCT_PMT     NOV_PMT     DEC_PMT
    90026845409     1     1     1     1     2     1     1     1     1     0     1     0(many rows, of course; result set pivoted)
    I need to determine the households that have a > 0 value in three or more consecutive months.
    I'm hoping someone will have some suggestions because the only solutions I'm coming up with right now would be a coding nightmare (lots of "OR's"), and I'm assuming (hoping) there's a better solution out there.
    Thanks!
    Christine

    Hi Frank,
    I'm not sure I'm understanding how I would use those analytic functions. Here is my select statement:
    SELECT HOUSEHOLD_ID,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  1 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  1 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS JAN_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  2 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  2 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS FEB_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  3 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  3 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS MAR_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  4 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  4 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS APR_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  5 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  5 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS MAY_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  6 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  6 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS JUN_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  7 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  7 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS JUL_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  8 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  8 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS AUG_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  9 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  9 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS SEP_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     = 10 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 = 10 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS OCT_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     = 11 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 = 11 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS NOV_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     = 12 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 = 12 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS DEC_PMT
      FROM MONETARY_TRANS
    WHERE MONETARY_TRANS_TYPE_ID    = 1                             --payment
    --TESTING
    AND HOUSEHOLD_ID = 90026845409
       AND RESPONSIBLE_PARTY_TYPE_ID = 1                             --household
       AND RECEIVED_DATE > '01-JAN-2008'
       AND ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6
        OR   TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 )
       AND PREMIUM_AMOUNT            > 0
       AND BILLING_TRANS_TYPE_ID     = 6
       AND MONETARY_TRANS_TYPE_ID    = 1
       AND RESPONSIBLE_PARTY_TYPE_ID = 1
    GROUP BY HOUSEHOLD_IDAnd from this I get the results originally posted. From there I need to figure out the households that have values greater than 0 for three or more consecutive months.
    Thanks for your help........
    -Christine

  • Parallel Processing with version 2.0

    Say I wanted to loop through a collection of servers, and copy a bunch of files to them, this part is simple, but how would I go about doing it, so that it copies the files to each server in parallel rather than serial? I know version 3.0 has Start-Job,
    but version 2.0 doesn't.
    I cannot use Invoke-Command because PSRemoting is not setup and most likely isn't allowed (I know dumb, but I don't make the rules).
    If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
    Don't Retire Technet

    Workflows require PowerShell 3.0.  Jobs should do the trick, so long as they're used smartly.  There's quite a bit of overhead involved with starting up a new job, so I wouldn't use them for really small individual tasks, but for a long file transfer
    like you're describing, you probably won't notice the difference.
    Do keep in mind that each job has a new process of powershell.exe running, which eats up 50MB or more of RAM until it's finished.  You don't want too many of them going at once.
    An alternative would be to use runspaces.  They're faster, but quite a bit more complicated to use properly.  There are a few functions available on the internet which try to wrap this concept up and make it easier to call from a
    script; try searching for "Invoke-Parallel" and "ForEach-Parallel", if you're interested in that.

  • Different tables' column have same value

    Hi,
    How to find out which coulmns in database are stoing a value. ex: 'Tier'
    I need to know different table's column in database have value 'Tier'.
    table1.col1 ='Tier'
    table2.col16='Tier'
    table3.col21='Tier'Thanks
    Sandy

    One possible solution is below. Take care with the performance, as the procedure is checking every schema.table.column VARCHAR ou CHAR. The number of columns can easily go to thousands and affect the overall performance of your DBMS.
    The example is explicitlly avoiding tables in schema SYS and SYSDBA.
    set serveroutput on size 999999
    declare
    cnt number;
    sql_comm varchar2(1000);
    begin
    for TRec in (select owner, table_name, column_name, data_length
                   from all_tab_columns
                  where data_type IN ('VARCHAR2', 'CHAR')
                    and owner not in ('SYS', 'SYSTEM')
                    and data_length >= 4
                  order by 1, 2, 3) loop
        sql_comm := 'select count(*) from '||TRec.owner||'.'||TRec.table_name||' where '||TRec.column_name||'= ''Tier''';
        execute immediate sql_comm into cnt;
        if cnt>0 then
            dbms_output.put_line(TRec.owner||'.'||TRec.table_name||'.'||TRec.column_name||' has '||cnt||' rows.');
        end if;   
    end loop;         
    end;
    Miguel

  • How to all  those set of records for which a given field have same value.

    Hi,
    I've a table
    T1 as
    id val
    1 A
    2 B
    3 A
    4 C
    5 D
    6 A
    7 D
    Now i want to write a query that'll return only those val for which there r more than one existence of val.
    result desired is:
    val count(val)
    A 3
    D 2
    Thanks
    Amitesh

    This?
    SQL> select * from t;
            ID VAL                                                                 
             1 A                                                                   
             2 B                                                                   
             3 A                                                                   
    SQL> select val,count(*) c
      2  from t
      3  group by val
      4  having count(*) > 1;
    VAL     C                                                              
    A              2
    Message was edited by:
            jeneesh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Random returning same values for all threads?

    <p>I "translated" an Applet example from a book to a MIDlet (as part of my learning process). However the MIDlet does not react as it should, and when the particles are all moving independently in the Applet, they are stuck together (as one) in the MIDlet.</p>
    <p>So far, only one possibility was suggested to me: if the Random object are created one after the other, they could end up based on the same seed (which is the clock by default) and will generate the same numbers.</p>
    <p>I tried to delay between the creation of the threads with no result. And the fact that the applet runs properly makes me wonder...</p>
    <p>Does anyone have a clue?</p>
    <p>In the MIDlet:</p>
    protected Thread makeThread(final Particle p) { // utility
        Runnable runloop = new Runnable() {
          public void run() {
            try {
              for(;;) {
                p.move();
                canvas.repaint();
                Thread.sleep(100); // 100msec is arbitrary
            catch (InterruptedException e) {  return; }
        return new Thread(runloop);
      }<p>In the particle:</p>
    protected final Random rng = new Random();
      public synchronized void move() {
        x += rng.nextInt(step) - (step/2);
        y += rng.nextInt(step) - (step/2);
        //returns exactly the same 10 times in a row
      }

    You might try justing just one static Random object.
    Also note that als long as your using CLDC 1.0, you don't have any floating point support.

  • IMac and Macbook pro have same Picture content both are being uploaded to iCloud

    Hi
    My iMac and Macbook pro have the same Pictures now that i got the new Photo app all the information is being uploaded to iCloud and i am getting duplicate pictures
    is there anyway to merge the pictures and only upload one of them?

    HI, then try this and before you do this hold down the command keyboard button and then click the pictures that are duplicated and delete them. then try this -
    Photos application for Mac Instructions that might help!
    On your iPad,iPhone keep the iCloud on in settings for Photos.
    if you have not opened the New Photos application yet to have it transfer your photos from iPhoto let it Transfer the Pictures.
    once you have all the pictures from iPhoto to Photos then in Photos go to Preferences
    there is general and iCloud tab and go to the iCloud and only uncheck the iCloud button that will make it so it doesn't sync with your iPhone and iPad for Photos.
    Then in Photos go up to View and press show sidebar because with that view you can move your pictures easier to albums snd delete or move any pictures or make new albums
    when you are all done with moving around your pictures or whatever go back to Preferences and turn on iCloud and make sure you have the optimize Mac Storage and then you are done! I hope this makes sense and works for you! here are the 2 pictures I'm talking about in settings

Maybe you are looking for