How can we write this in analytical function..

select a.employee_id,a.last_name,b.count from employees a, (select manager_id, count(manager_id) as count from employees group by manager_id) b where a.employee_id=b.manager_id;
As per my requirement I need each manager name and no of employees reporting to him... above query works.. Could anybody help to write the same using analytic function.... Hw this same can be written in effiect way??? (quick performance)
Please also share the link to download some doc to have good understanding of analytical function..
Thanks in advance....

are you trying to do a hierarchical type of query?
select ename, count(ename) -1 numr_of_emps_under_this_mgr  from  emp
connect by  empno =prior mgr
group by ename
order by count(ename) desc ;
ENAME     NUMR_OF_EMPS_UNDER_THIS_MGR
KING     13
BLAKE     5
JONES     4
CLARK     1
FORD     1
SCOTT     1
ADAMS     0
TURNER     0
MARTIN     0
JAMES     0
SMITH     0
MILLER     0
ALLEN     0
WARD     0Here is the table structure I used (I think you can download it from oracle somewhere)
CREATE TABLE EMP
  EMPNO     NUMBER(4)                           NOT NULL,
  ENAME     VARCHAR2(10 BYTE),
  JOB       VARCHAR2(9 BYTE),
  MGR       NUMBER(4),
  HIREDATE  DATE,
  SAL       NUMBER(7,2),
  COMM      NUMBER(7,2),
  DEPTNO    NUMBER(2)
SET DEFINE OFF;
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
   (7369, 'SMITH', 'CLERK', 7902, TO_DATE('12/17/1980 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    800, 20);
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
Values
   (7499, 'ALLEN', 'SALESMAN', 7698, TO_DATE('02/20/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1600, 300, 30);
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
Values
   (7521, 'WARD', 'SALESMAN', 7698, TO_DATE('02/22/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1250, 500, 30);
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
   (7566, 'JONES', 'MANAGER', 7839, TO_DATE('04/02/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2975, 20);
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
Values
   (7654, 'MARTIN', 'SALESMAN', 7698, TO_DATE('09/28/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1250, 1400, 30);
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
   (7698, 'BLAKE', 'MANAGER', 7839, TO_DATE('05/01/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2850, 30);
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
   (7782, 'CLARK', 'MANAGER', 7839, TO_DATE('06/09/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    2450, 10);
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
   (7788, 'SCOTT', 'ANALYST', 7566, TO_DATE('12/09/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    3000, 20);
Insert into EMP
   (EMPNO, ENAME, JOB, HIREDATE, SAL, DEPTNO)
Values
   (7839, 'KING', 'PRESIDENT', TO_DATE('11/17/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    5000, 10);
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)
Values
   (7844, 'TURNER', 'SALESMAN', 7698, TO_DATE('09/08/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1500, 0, 30);
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
   (7876, 'ADAMS', 'CLERK', 7788, TO_DATE('01/12/1983 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1100, 20);
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
   (7900, 'JAMES', 'CLERK', 7698, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    950, 30);
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
   (7902, 'FORD', 'ANALYST', 7566, TO_DATE('12/03/1981 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    3000, 20);
Insert into EMP
   (EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, DEPTNO)
Values
   (7934, 'MILLER', 'CLERK', 7782, TO_DATE('01/23/1982 00:00:00', 'MM/DD/YYYY HH24:MI:SS'),
    1300, 10);
COMMIT;

Similar Messages

  • List v = new Vector() how can i write this ?

    List v = new Vector() how can i write this ?
    vector does not 'extends' List rather it 'implements' only ......so how can write this way ? ( polymorphism applies only for 'extends' ).

    my question in a simple way is :
    List some_list extends Vector
    No, List is an interface; Vector is a concrete class. Read the javadocs.
    Vector implements List
    >
    AND
    List some_list implements Vector
    are these two same in behaviour
    our  apart from theoretical differences ?thanks
    Interfaces don't have any implementation; they're pure method signatures. When a concrete class implements an interface, it makes a promise that says "I will provide implementations for exactly these methods. Any client can call a method from the interface and I will do something 'sensible' if I'm written correctly."
    From the point of view of static and dynamic types, there's no difference between interfaces and classes.
    C++ has interfaces, too - they're classes with all pure virtual methods. If you understand how C++ works, the concept shouldn't be hard.
    ArrayList is preferred precisely because it isn't synchronized by default. (You can always make it so using java.util.Collections if you wish later on.) If you don't need synchronization, why pay the performance penalty?

  • How can i write this C-Code in G-Code

    hallo
    how can I write this C-Code in LabVIew ,
    for a=0; a=<10; a++
       for b=0; b=5 ; b+2
            X= 3+b;
      Y=1+a;
    please see the attachment and tell me where is the problem
    Attachments:
    Unbenannt 11.vi ‏43 KB

    Well, at least you tried and got some of it right.
    I think this should do what you want, but my C is rusty. Is the increment performed before or after the loop executes? If it's after, then I believe the loop should iterate 11 times, not 10.
    In any case, you should note that for a literal translation, you would need to add a sequence structure to guarantee that Y was written to only after the inner loop finished because of the way data-flow works.. Also, note that controls and indicators in LabVIEW are not equivalent to variables. They can be used as such, but they usually should not be.
    Another point about this is that you probably want to use the correct data type - the orange terminals are floating point indicators (of double precision, in this case) and you want integers.
    To learn more about LabVIEW, I suggest you try looking at some of these tutorials.
    Try to take over the world!
    Attachments:
    C.png ‏4 KB

  • How can I write this string to a file as the ASCII representation in Hex format?

    I need to convert a number ( say 16000 ) to Hex string ( say 803E = 16,000) and send it using Visa Serial with the string control in Hex Mode. I have no problem with the conversion (see attached). My full command in the hex display must read AA00 2380 3E...
    I can easily get the string together when in Normal mode to read AA0023803E... but how can I get this to hex mode without converting? (i.e. 4141 3030 3233 3830 3345 3030 3030 3031 )
    Attachments:
    volt to HEX.vi ‏32 KB

    Sorry, The little endian option was probably introduced in 8.0 (?).
    In this special case it's simple, just reverse the string before concatenating with the rest.
    It should be in the string palette, probably under "additional string functions".
    (note that this only works in this special case flattening a single number as we do here. If the stat structure is more complex (array, cluster, etc.) you would need to do a bit more work.
    Actually, you might just use typecast as follows. Same difference.
    I only used the flatten operation because of the little endian option in my version.
    Message Edited by altenbach on 11-16-2007 11:53 AM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    littleendian71.png ‏4 KB
    littleEndiancast71.png ‏4 KB

  • Body onload="..."  how can we access this type of functionality?

    Im working with a portlet, created in javascript. I would like to call a function when the portlet is first displayed (meant to populate a database driven list). However since the body onload event is not able to be modified from within a portlet, how can I accomplish this same type of functionality within plumtree?
    <body onload=".. :( ..">

    Because the portal page is a shared environment where several different portlets may all need to use the onload event handler, we cannot simply allow each portlet to register its own onload event handler.  Each would overwrite the other, and only the last portlet on the page would receive the benefit of using the onload event.
    To accommodate this, a client-side object called the PCC, short for Portlet Communication Component, exists to essentially &#034;multiplex&#034; a single onload event into multiple calls.  To take advantage of this functionality, you will need to register the function you want called with the PCC.
    Add a line of script to your portlet which looks something like:
    document.PCC.RegisterForEvent(namespaceURN, eventName, sFunction)
    namespaceURN = a namespace for your event, or just pass in false if you want to use the default window namespace.
    eventName = the event you want to register your function with, 'onload' in your case.
    sFunction = the name of your function, or an object reference to your function.

  • How can I write this small function to create number of Array(s), please?

    Guys,
    How can I have a function create Array depending upon the passed argument. Am I doing this right?
    function createArray(n:int):Array
        for(var i:int=0; i<n; i++)
           var nArr = new Array();
           return nArr[i];
    Thanks a lot.

    var aArraySet:Array = createArraySets(5); //create 5 arrays
    // Array 1 -> aArraySet[0]
    // Array 2 -> aArraySet[1]
    // Array 3 -> aArraySet[2]
    // Array 4 -> aArraySet[3]
    // Array 5 -> aArraySet[4]
    function createArraySets(n:uint):Array
        var aArraySet:Array = new Array();
        for(var i:uint=0; i<n; i++)
           aArraySet.push(new Array());
        return aArraySet;

  • How can rewrite the Query using Analytical functions ?

    Hi,
    I have the SQL script as shown below ,
    SELECT cd.cardid, cd.cardno,TT.TRANSACTIONTYPECODE,TT.TRANSACTIONTYPEDESC DESCRIPTION,
    SUM (NVL (CASE tt.transactiontypecode
    WHEN 'LOAD_ACH'
    THEN th.transactionamount
    END, 0)
    ) AS load_ach,
    SUM
    (NVL (CASE tt.transactiontypecode
    WHEN 'FUND_TRANSFER_RECEIVED'
    THEN th.transactionamount
    END,
    0
    ) AS Transfersin,
    ( SUM (NVL (CASE tt.transactiontypecode
    WHEN 'FTRNS'
    THEN th.transactionamount
    END,
    0
    ) +
    SUM (NVL (CASE tt.transactiontypecode
    WHEN 'SEND_MONEY'
    THEN th.transactionamount
    END, 0)
    )) AS Transferout,
    SUM (NVL (CASE tt.transactiontypecode
    WHEN 'WITHDRAWAL_ACH'
    THEN th.transactionamount
    END, 0)
    ) AS withdrawal_ach,
    SUM (NVL (CASE tt.transactiontypecode
    WHEN 'WITHDRAWAL_CHECK'
    THEN th.transactionamount
    END, 0)
    ) AS withdrawal_check,
    ( SUM (NVL (CASE tt.transactiontypecode
    WHEN 'WITHDRAWAL_CHECK_FEE'
    THEN th.transactionamount
    END,
    0
    ) +
    SUM (NVL (CASE tt.transactiontypecode
    WHEN 'REJECTED_ACH_LOAD_FEE'
    THEN th.transactionamount
    END,
    0
    ) +
    SUM (NVL (CASE tt.transactiontypecode
    WHEN 'WITHDRAWAL_ACH_REV'
    THEN th.transactionamount
    END,
    0
    ) +
    SUM (NVL (CASE tt.transactiontypecode
    WHEN 'WITHDRAWAL_CHECK_REV'
    THEN th.transactionamount
    END,
    0
    ) +
    SUM
    (NVL (CASE tt.transactiontypecode
    WHEN 'WITHDRAWAL_CHECK_FEE_REV'
    THEN th.transactionamount
    END,
    0
    ) +
    SUM
    (NVL (CASE tt.transactiontypecode
    WHEN 'REJECTED_ACH_LOAD_FEE_REV'
    THEN th.transactionamount
    END,
    0
    ) +
    SUM (NVL (CASE tt.transactiontypecode
    WHEN 'OVERDRAFT_FEE_REV'
    THEN th.transactionamount
    END, 0)
    ) +
    SUM (NVL (CASE tt.transactiontypecode
    WHEN 'STOP_CHECK_FEE_REV'
    THEN th.transactionamount
    END,
    0
    ) +
    SUM (NVL (CASE tt.transactiontypecode
    WHEN 'LOAD_ACH_REV'
    THEN th.transactionamount
    END, 0)
    ) +
    SUM (NVL (CASE tt.transactiontypecode
    WHEN 'OVERDRAFT_FEE'
    THEN th.transactionamount
    END, 0)
    ) +
    SUM (NVL (CASE tt.transactiontypecode
    WHEN 'STOP_CHECK_FEE'
    THEN th.transactionamount
    END, 0)
    )) AS Fee,
    th.transactiondatetime
    FROM carddetail cd,
    transactionhistory th,
    transactiontype tt,
    (SELECT rmx_a.cardid, rmx_a.endingbalance prev_balance, rmx_a.NUMBEROFDAYS
    FROM rmxactbalreport rmx_a,
    (SELECT cardid, MAX (reportdate) reportdate
    FROM rmxactbalreport
    GROUP BY cardid) rmx_b
    WHERE rmx_a.cardid = rmx_b.cardid AND rmx_a.reportdate = rmx_b.reportdate) a
    WHERE th.transactiontypeid = tt.transactiontypeid
    AND cd.cardid = th.cardid
    AND cd.cardtype = 'P'
    AND cd.cardid = a.cardid (+)
    AND CD.CARDNO = '7116734387812758335'
    --AND TT.TRANSACTIONTYPECODE = 'FUND_TRANSFER_RECEIVED'
    GROUP BY cd.cardid, cd.cardno, numberofdays,th.transactiondatetime,tt.transactiontypecode,TT.TRANSACTIONTYPEDESC
    Ouput of the above query is :
    CARDID     CARDNO     TRANSACTIONTYPECODE     DESCRIPTION     LOAD_ACH     TRANSFERSIN     TRANSFEROUT     WITHDRAWAL_ACH     WITHDRAWAL_CHECK     FEE     TRANSACTIONDATETIME
    6005     7116734387812758335     FUND_TRANSFER_RECEIVED     Fund Transfer Received     0     3.75     0     0     0     0     21/09/2007 11:15:38 AM
    6005     7116734387812758335     FUND_TRANSFER_RECEIVED     Fund Transfer Received     0     272     0     0     0     0     05/10/2007 9:12:37 AM
    6005     7116734387812758335     WITHDRAWAL_ACH     Withdraw Funds via ACH     0     0     0     300     0     0     24/10/2007 3:43:54 PM
    6005     7116734387812758335     SEND_MONEY     Fund Transfer Sent     0     0     1     0     0     0     19/09/2007 1:17:48 PM
    6005     7116734387812758335     FUND_TRANSFER_RECEIVED     Fund Transfer Received     0     1     0     0     0     0     18/09/2007 7:25:23 PM
    6005     7116734387812758335     LOAD_ACH     Prepaid Deposit via ACH     300     0     0     0     0     0     02/10/2007 3:00:00 AM
    I want the output like for Load_ACH there should be one record etc.,
    Can any one help me , how can i rewrite the above query using analytical functions .,
    Sekhar

    Not sure of your requirements but this mayhelp reduce your code;
    <untested>
    SUM (
       CASE
       WHEN tt.transactiontypecode IN
          ('WITHDRAWAL_CHECK_FEE', 'REJECTED_ACH_LOAD_FEE', 'WITHDRAWAL_ACH_REV', 'WITHDRAWAL_CHECK_REV',
           'WITHDRAWAL_CHECK_FEE_REV', 'REJECTED_ACH_LOAD_FEE_REV', 'OVERDRAFT_FEE_REV','STOP_CHECK_FEE_REV',
           'LOAD_ACH_REV', 'OVERDRAFT_FEE', 'STOP_CHECK_FEE')
       THEN th.transactionamount
       ELSE 0) feeAlso, you might want to edit your post and use &#91;pre&#93; and &#91;/pre&#93; tags around your code for formatting.

  • How can I write this query

    Customer Trans          Transaction     Invoice
    Code     Date Type      Amount
    A001     01-JAN-2004     invoice      1000
    A001     01-FEB-2004      Receipt      -1500
    A001     01-MAR-2004     invoice          2000
    A001     01-APR-2002     invoice          2500
    OUTPUT wanted to be...
    Customer Trans     Transaction     Invoice          
    Code     Date Type      Amount     Balance
    A001 01-JAN-2004 invoice 1000          1000
    A001     01-FEB-2004 receipt -1500          500     
    A001     01-MAR-2004 invoice     2000          2500
    A001     01-APR-2002 invoice     2500          5000
    Hi All,
    Please look into the above data, If analytic function LAG(),CASE expression are possible to locate the cursor position in the single query, then any one can help me out about it. I tried but could not.
    Regards,
    Neel.

    You can do this with the SUM analytic function. Taking the emp table, for example,
      1  select ename, sal, SUM(sal) OVER (order by empno)
      2    from emp
      3*  order by empno
    SQL> /
    ENAME                                 SAL SUM(SAL)OVER(ORDERBYEMPNO)
    SMITH                                 800                        800
    ALLEN                                1600                       2400
    WARD                                 1250                       3650
    JONES                                2975                       6625
    MARTIN                               1250                       7875
    BLAKE                                2850                      10725
    CLARK                                2450                      13175
    SCOTT                                3000                      16175
    KING                                 5000                      21175
    TURNER                               1500                      22675
    ADAMS                                1100                      23775
    JAMES                                 950                      24725
    FORD                                 3000                      27725
    MILLER                               1300                      29025
    14 rows selected.Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How can I write this SQL?

    the statement have the question:
         stxh-tdname  length 70
         itab-vbeln       length 10
    select tdobject into table it_stxh
        from stxh
        for all entries in  itab
        where ( tdid = 'Z006' and tdspras = 'E'      and tdname+0(10) = itab-vbeln and tdobject = 'VBBK' ).
    tdname+0(10) = itab-vbeln  ???

    When you define the first Internal Table ITAB, define vbeln as the same type of stxh-tdname.
    Eg.
      data: begin of itab occurs 0,
              vbeln like STXH-TDNAME,
              erdat like vbak-erdat,
              end of itab.
    START-OF-SELECTION.
    Select VBELN
              ERDAT
      from vbak
      into CORRSPONDING FIELDS of table itab.
    Then you can directly use  this ITAB in the next query
      select tdobject into table it_stxh
      from stxh
      for all entries in itab
      where ( tdid = 'Z006' and tdspras = 'E' and tdname = itab-vbeln
      and tdobject = 'VBBK' ).
    Pls reward it if it is useful.

  • How can I write this short/simple bit of php so it will work?

    Hello!
    I have this code in template.php...
    <?php @ require_once ("$pagename.php"); ?>
    ...to bring content into the template.
    I've got a folder called 'news' for all the news articles so
    how could I edit the code to say 'look for files in the news folder
    as well as the current folder'?
    I guess I would need something like:
    <?php @ require_once ("$pagename.php" or
    "news/$pagename.php"); ?>
    ...but that doesn't work. How would I change it to work?
    Thank you very much and hope to hear from you.
    Mark

    You would need to use the "or" operator in PHP. I'm not too
    sure if that
    will work or not but you can give it a go - I'm currently at
    work now, so I
    can't really test anything at this moment in time.
    This is the operator for "or" in PHP: ||
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    ===============================
    Proud GAWDS Member
    http://www.gawds.org
    Delivering accessible websites to all...
    ===============================
    "Spindrift" <[email protected]> wrote in
    message
    news:e5fhh5$sgv$[email protected]..
    > Hello!
    >
    > I have this code in template.php...
    >
    > <?php @ require_once ("$pagename.php"); ?>
    >
    > ...to bring content into the template.
    >
    > I've got a folder called 'news' for all the news
    articles so how could I
    > edit
    > the code to say 'look for files in the news folder as
    well as the current
    > folder'?
    >
    > I guess I would need something like:
    >
    > <?php @ require_once ("$pagename.php" or
    "news/$pagename.php"); ?>
    >
    > ...but that doesn't work. How would I change it to work?
    >
    > Thank you very much and hope to hear from you.
    >
    > Mark
    >

  • How can i write this syntax in script logic....

    hi all
    i need to write below syntax in bpc script logic..
    If Headcount = 0, then Salary = 0 Else:
    If Month <> March and Month <> September:
    Salary = Salaryprevious month1 + [(Headcountcurrent month - Headcountprevious month1) * (Band Rate + Band Salary Factor)]
    If Month = March:
    Salary = [Salaryprevious month1 + [(Headcountcurrent month - Headcountprevious month1) * (Band Rate + Band Salary Factor)]  ] * (100% + Band Annual Increase + Band Annual Increase Factor)
    in the above code headcount,salary,bandrate etc all got ids.
    thanks guys

    Hi,
    In your query, when you say that headcount = 0, do you mean the signed data? In this case, it will difficult to do. When you have a signed data as 0 in SQL, once you optimize the application or compress it, that particular record will go and your logic will not work.
    If I look at your logic,
    If Headcount = 0, then Salary = 0 Else:
    If Month March and Month September:
    Salary = Salaryprevious month1 + (Headcountcurrent month - Headcountprevious month1) * (Band Rate + Band Salary Factor)
    If Month = March:
    Salary = [Salaryprevious month1 + (Headcountcurrent month - Headcountprevious month1) * (Band Rate + Band Salary Factor)] * (100% + Band Annual Increase + Band Annual Increase Factor)
    If the application has been compressed or optimized, it will not get any record for that particular headcount and will directly go into the "else" loop. Though, its not correct.
    I hope you got my point.

  • How can I write this query In parameterize form so That I can prevent sql Injection

    String strQry = "INSERT INTO tblVoucherType (VhrTypeCode,moduleCode,transCCode,"
    + "voucherType,OrderNumber,active,AccountId) "
    + " values('" + txtVhrCode.Text + "','" + ddlModule.SelectedValue.ToString() + "',"
    + "'" + ddlTrans.SelectedValue.ToString() + "','" + txtVhrName.Text + "','" + btnRadio.SelectedValue + "'"
    + ", '" + status.Checked + "', '" + txtAccount.Text + "')";

    Basically it will look like:
    String strQry = "INSERT INTO tblVoucherType (VhrTypeCode,moduleCode,transCCode, ...)"
    + " values(@VhrCode, @moduleCode, @transCCode, ....)";
    sqlCommand.Parameters.AddWithValue("@VhrCode", txtVhrCode.Text );
    sqlCommand.Parameters.AddWithValue("@moduleCode", ddlModule.SelectedValue.ToString() );
    sqlCommand.Parameters.AddWithValue("@transCCode", ddlTrans.SelectedValue.ToString() );
    .. and so on
    sqlCommand.ExecuteNonQuery();
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How do I write this as a loop?

    How do I write this code to function as follows.
    When btn1 is clicked, SenderLoad should be "clay" AND when btn2 is clicked, SenderLoad should be "iron", etc...
    var mgB:Array = [btn1, btn2, btn3, btn4];
    var mgBW:Array = ["clay", "iron", "cotton", "leather"];
    var SenderLoad:LoadVars = new LoadVars();
    var ReceLoad:LoadVars = new LoadVars();
    var mgNum:Number=0;
    for (i=0; i<mgBW.length ; i++){
    mgBW[i].onRelease = function () {
    mgNum++
    SenderLoad.word = mgB[mgNum];
    SenderLoad.sendAndLoad("http://www.web.com/my.php",ReceLoad,"POST");
    ReceLoad.onData = function(src) {
    var messageA:Array = src.split(",,,");
    ldrB2.html=true;
    for(var i:Number=0; i<messageA.length; i++){
               var a:Array=messageA[i].split(",,");
       ldrB1.htmlText +=a[0];
       ldrB2.htmlText +=a[1];

    if you want different words in different colors you can use:
    ldrB1.html=true;
    ldrB1.text = formatF("REJECT",0xff0000,ldrB1)
    ldrB1.text = formatF("ACCEPT",0x000000,ldrB1);
    ldrB1.text = "formatF("BANNED",0xc0c0c0,ldrB1);
    function formatF(s:String, col:Number, tf:TextField):Void {
    if(tf.text.indexOf(s)==-1){
    return;
        tfor.color = col;
        var startindex:Number = 0;
        while (startindex>-1 && startindex<tf.text.length-1) {
            var bindex:Number = tf.text.indexOf(s, startindex);
            var eindex:Number = bindex+s.length;
            tf.setTextFormat(bindex,eindex,tfor);
            startindex = eindex;
    var tfor:TextFormat = new TextFormat();

  • How can we write the excel function =Normsdist() in Java?

    Hi,
    I need to use one function in my java program to compute N(z) . In excel the function is =Normsdist(z). Is there any built-in library function for this in Java? How can I accomplish this? Please give me some solutions...
    Thanks.

    I need to use one function in my java program to
    compute N(z) . In excel the function is
    =Normsdist(z). Is there any built-in library
    function for this in Java? No.
    How can I accomplish
    this? Please give me some solutions...
    Thanks.Write your own, or use a 3rd party library.

  • How can I write the analogous code to the logic:iterate tag functionality

    Hai This is Rayalu .And I am very new to the Java World. I have a doubt?.How can I write the analogous code to the<logic:iterate> tag functionality using the JSP Tag Libraries . Pleae Send me some examples .

    Hi,
    SELECT objnr objid aufnr
            from afih
            into table t_afih.
    SELECT objnr
            from JEST
            into table t_JEST
            where stat = 'A0045'
               OR stat = 'A0046'
               AND inact 'X'.
    SELECT objnr
            from COBRB
            into table t_cobrb.
    SELECT arbpl werks objid objty
          from crhd
          INTO table it_crhd
          FOR ALL ENTRIES IN it_afih
          WHERE objty eq 'D'
          AND gewrk = it_afih-objid.
    SELECT aufnr objnr auart txjcd pspel gstrp werks aufnr
            FROM caufv
            INTO table t_caufv
            FOR ALL ENTRIES IN it_afih
            WHERE aufnr = it_afih-aufnr
              And pspel = ' '
              AND txjcd = ' '
             ANd objnr ne it_crhd-objnr
              AND auart in s_wtype
              AND werks in s_plant.
             AND objnr ne it_jest-objnr.
    dont use NE in the select statements, it may effect performance also. Instead use if statements inside
    loops.
    loop at t_caufv.
    read table it_chrd............
      if t_caufv-objnr ne it_chrd-objnr.
      read table it_jest..........
       if   if t_caufv-objnr ne it_jest-objnr.
        (proceed further).
       endif.
      endif.
    endloop.
    hope this helps.
    Reward if useful.
    Regards,
    Anu

Maybe you are looking for

  • Unable to open database in READ ONLY mode

    When trying to open database in READ ONLY MODE it says needs recovery. How ever database opens succesfully in READ WRITE MODE. 1) Startup mount 2) SQL> ALTER DATABASE OPEN READ ONLY; ALTER DATABASE OPEN READ ONLY ERROR at line 1: ORA-16005: database

  • Windows media player for intel macs?

    im so bumbed that windows media player wont run on intel macs...does anyone know when they plan on getting it for intel macs!..i need it!...Flip4mac *****...the formats that it plays i have not come across yet..and thats even if its working properly.

  • GNOME 3.2.2 black lock screen

    Ok I'm on a fully upgraded Gnome 3.2.2 arch system. If I lock the screen and walk away then come back I don't get the login prompt with my profile pic coming up anymore. The screen is blank most the time, sometimes it comes up with the time on the to

  • Install serial number

    Each time I attempt to install my store purchased Adobe Photoshop Elements 13 and Premiere Elements 13 disc on my Mac, I get to the Serial Number page, and type in the serial number. Then it says it does not recognize the number, even though I've typ

  • Remote Computers login

    Hi people, at work I have a Mac Pro, at home I have an iMac, and I also use a Time Machine, now, I will like to remote login from work to home, and yes, I have enable Remote Login, from system preferences, but I still cant login, so what can I do?, a