GetParameter() function breaks my loops...

I'm trying to build an array of indices over which to iterate using a WHILE loop. The indices are passed to my java applet from a known parameter name using the function getParameter(that_name).
Once the array is built over which to iterate; I want to get each parameter associated with the param names specified by that array from my HTML and draw the parameter values using drawString() one-by-one.
The array is properly built, the arguments being passed to getParameter are right. The problem is that it stops after only the first iteration of the loop.
Here is my code:
THE JAVA:
import java.applet.*;
import java.awt.*;
import java.lang.Math.*;
import java.lang.String;
import java.lang.reflect.Array;
public class DenGen extends Applet {
@Override
public void paint(Graphics g) {
int radius = 250;
int layers = Integer.parseInt(getParameter("layers"));
int nodes = Integer.parseInt(getParameter("nodes"));
double radii = radius/(layers+2);
boolean String;
String delimeter = ",";
String call = Integer.toString(layers-1);
String make_layer = "00";
String fin = call.concat(make_layer);
String str = getParameter(fin);
String[] final_layer = str.split(delimeter);
int start = 0;
int stop = 0;
int index = 0;
int i = 0;
String param;
while(Integer.parseInt(final_layer) < Array.getLength(final_layer)){
param = getParameter(Integer.toString(i));
g.drawString((String) getParameter(Integer.toString(i)), 250, 10);
i++;
THE HTML:
<html>
<head>
     <style type = text/css>
     .applet{
          border: 1px solid black;
     </style>
</head>
<body>
<center>
<APPLET CODE="DenGen.class" codebase = "build/classes" WIDTH="550" HEIGHT="550" class = applet>
     <PARAM NAME = "layers" VALUE = "2">
     <PARAM NAME = "nodes" VALUE = "102">
     <PARAM NAME = "000" VALUE = "4, 5">
     <PARAM NAME = "100" VALUE = "0, 1, 2, 3">
     <PARAM NAME = "0" VALUE = "3.52941176471, 158.823529412">
     <PARAM NAME = "1" VALUE = "162.352941176, 204.705882353">
     <PARAM NAME = "2" VALUE = "208.235294118, 345.882352941">
     <PARAM NAME = "3" VALUE = "349.411764706, 360">
</APPLET>
</center>
</body>
</html>

Try this variant. Note that it can be run like this..
prompt>javac DenGen.java
prompt>appletviewer DenGen.java // the '.java' xtn is not a mistake! AppletViewer is smart enough to parse the applet element out of the comment at the top of the file. This is handy for testing purposes, as AppletViewer saves problems with class caching in browsers, and makes the console more easily accessible. It is also handy in that we do not need to create a separate HTML file for it to work. ;)
<APPLET CODE="DenGen" WIDTH="550" HEIGHT="550">
  <PARAM NAME = "layers" VALUE = "2">
  <PARAM NAME = "nodes" VALUE = "102">
  <PARAM NAME = "000" VALUE = "4, 5">
  <PARAM NAME = "100" VALUE = "0, 1, 2, 3">
  <PARAM NAME = "0" VALUE = "3.52941176471, 158.823529412">
  <PARAM NAME = "1" VALUE = "162.352941176, 204.705882353">
  <PARAM NAME = "2" VALUE = "208.235294118, 345.882352941">
  <PARAM NAME = "3" VALUE = "349.411764706, 360">
</APPLET>
import java.applet.Applet;
import java.awt.Graphics;
public class DenGen extends Applet {
  String[] params;
  @Override
  public void init() {
    int radius = 250;
    int layers = Integer.parseInt(getParameter("layers"));
    int nodes = Integer.parseInt(getParameter("nodes"));
    double radii = radius/(layers+2);
    String delimeter = ",";
    String call = Integer.toString(layers-1);
    String make_layer = "00";
    String fin = call.concat(make_layer);
    String str = getParameter(fin);
    String[] final_layer = str.split(delimeter);
    int start = 0;
    int stop = 0;
    int index = 0;
    params = new String[final_layer.length];
    for (int ii=0; ii<final_layer.length; ii++) {
      String countString = "" + ii;
      params[ii] = getParameter(countString);
  @Override
  public void paint(Graphics g) {
    for (int ii=0; ii<params.length; ii++) {
      g.drawString(params[ii], 20, 15 + (ii*20));
}

Similar Messages

  • Calling a function in a loop

    Hello,
    I have something like this:
             declare
             cursor c is
               select 2,3,4 from dual;
             begin
             for r in c loop
               dbms_output.put_line( prod_stb(81852225, r, 'STB 1 HORECA'));
             end loop;
             end;I wanna call (and output the results) that function in a loop, for all 2,3,4 values for the 2nd parameter.
    How can i do this?
    with simple 'r' in the 2nd parameter does not work
    Thanks!

    So the 2nd parameter should be 2,3 and 4 (in a loop).Well, as far as I understand, that's exactly what you'll get:
    SQL> begin
      2    for r in ( select level+1 col from dual connect by level <= 3 )
      3    loop
      4      dbms_output.put_line( r.col);
      5    end loop;
      6  end;
      7  /
    2
    3
    4
    PL/SQL procedure successfully completed.

  • Calling Function in a loop for CM

    Hi,
    I have the program to create Credit Memo with user selected records. It is working if the user selects any one customer and it will create CM for that customer. But now user wants to select different customers and based on each different vkorg vtweg spart kunnr it has to create different Credit Memo's. How should I put the function in the loop so that it creates different CM's based on each customer.
    Please help me.
    Thanks,
    Neelu.
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'CMEMO'.
          DESCRIBE TABLE gt_zprice LINES lv_cnt.
          DO lv_cnt TIMES.
            lv_index = sy-index + 1.
            READ LINE lv_index FIELD VALUE chbox.
            IF chbox = 'X'.
              READ TABLE gt_zprice INTO gs_zprice1 INDEX sy-index.
              IF sy-subrc EQ 0.
                gs_zprice1-index = sy-index.
                APPEND gs_zprice1 TO gt2_zprice.
                CLEAR gs_zprice1.
              ENDIF.
            ENDIF.
            CLEAR chbox.
          ENDDO.
          gt4_zprice[] = gt2_zprice[].
    *      SORT gt2_zprice BY vkorg vtweg spart kunnr.
    *      DELETE ADJACENT DUPLICATES FROM gt2_zprice
    *                      COMPARING vkorg vtweg spart kunnr.
    *      DESCRIBE TABLE gt2_zprice LINES lv_lines.
    *      IF lv_lines = 1.
              LOOP AT gt4_zprice INTO gs_zprice1.
                AT NEW kunnr.
                  MOVE 'Y' TO lv_flg.
                ENDAT.
                IF lv_flg EQ 'Y'.
                  PERFORM headerdata.
                  PERFORM texts.
                  CLEAR lv_flg.
                ENDIF.
                PERFORM itemdata.
                APPEND gs_zprice1 TO gt3_zprice.
                CLEAR gs_zprice1.
              ENDLOOP.
              lv_itemno = 10.
              PERFORM call_function.
              PERFORM update_pricetable.
              PERFORM errorcheckandcommit.
              PERFORM displaydata.
              REFRESH gt2_zprice.
              CLEAR chbox.
              CLEAR lv_lines.
              REFRESH partner.
              REFRESH item.
              REFRESH itemx.
              REFRESH lt_schedules_in.
              REFRESH lt_schedules_inx.
              REFRESH conditions1.
              REFRESH order_text.
            ELSE.
              REFRESH gt2_zprice.
              CLEAR chbox.
              EXIT.
            ENDIF.
      ENDCASE.

    call the credimemo create routines at end of kunnr inside the loop.
    LOOP AT gt4_zprice INTO gs_zprice1.
                AT NEW kunnr.
                  MOVE 'Y' TO lv_flg.
                ENDAT.
                IF lv_flg EQ 'Y'.
                  PERFORM headerdata.
                  PERFORM texts.
                  CLEAR lv_flg.
                ENDIF.
                PERFORM itemdata.
                APPEND gs_zprice1 TO gt3_zprice.
                CLEAR gs_zprice1.
    <b>at end of kunnr.
          PERFORM call_function.
              PERFORM update_pricetable.
              PERFORM errorcheckandcommit.
              PERFORM displaydata.
              REFRESH gt2_zprice.
              CLEAR chbox.
              CLEAR lv_lines.
              REFRESH partner.
              REFRESH item.
              REFRESH itemx.
              REFRESH lt_schedules_in.
              REFRESH lt_schedules_inx.
              REFRESH conditions1.
              REFRESH order_text.
    endat.</b>
              ENDLOOP.
              lv_itemno = 10.
           ELSE.
              REFRESH gt2_zprice.
              CLEAR chbox.
              EXIT.
            ENDIF.
      ENDCASE.

  • How to use reverse function in FOR loop

    Hi,
    Can we use REVERSE function in for loop.
    If so can u please give an explanation with some example.
    Thanks in advance.
    Satya.

    In SQL you could do this...
    SQL> ed
    Wrote file afiedt.buf
      1  select empno, ename, replace(sys_connect_by_path(ch,'|'),'|') as rev_ename
      2  from (
      3    select empno, ename, case when rn <= length(ename) then substr(ename, length(ename)-rn+1, 1) else null end as ch, rn
      4    from emp
      5        ,(select rownum as rn from dual connect by rownum <= (select max(length(ename)) from emp))
      6    where case when rn <= length(ename) then substr(ename, length(ename)-rn+1, 1) else null end is not null
      7    )
      8  where connect_by_isleaf = 1
      9  connect by empno = prior empno and rn = prior rn + 1
    10  start with rn = 1
    11* order by empno
    SQL> /
         EMPNO ENAME      REV_ENAME
          7369 SMITH      HTIMS
          7499 ALLEN      NELLA
          7521 WARD       DRAW
          7566 JONES      SENOJ
          7654 MARTIN     NITRAM
          7698 BLAKE      EKALB
          7782 CLARK      KRALC
          7788 SCOTT      TTOCS
          7839 KING       GNIK
          7844 TURNER     RENRUT
          7876 ADAMS      SMADA
          7900 JAMES      SEMAJ
          7902 FORD       DROF
          7934 MILLER     RELLIM
    14 rows selected.
    SQL>

  • Not Breaking the loop but how to continue with the next iteration in a For

    Hi all
    i have the following piece of code
    Please let me know, what is the /*some construct*/ which will not break the loop but goes to the next iteration skipping Login b
    Loop
    Login A
    /*some construct*/
    Login B
    End loop;
    P.S
    I should do this without Label or Exception ... I am using oracle 8i
    Thanks
    Hariharan
    T

    An [url http://www.oracle.com/pls/tahiti/tahiti.tabbed?section=48911]IF statement?
    loop
      login_a;
      if false
      then
        login_b;
      end if;
    end loop;Regards,
    Rob.

  • Functions in a Loop

    I'm trying to create multiple Functions inside a Loop. Can I not do this?
    for (var i:Number = 1; i<5; i++)
      function this["closeButOut"+i](event:MouseEvent)
                                  closeBar["but0" + i].gotoAndStop(1);
    I essentially want to make 4 Functions called closeButOut1, closeButOut2, closeButOut3 and closeButOut4.
    This is the error message I get:
    1084: Synax error: expecting identifier before this.
    1084: Syntax error: expecting leftparen before rightbracket.

    Sorry, it should look like this:
    for (var i:Number = 1; i<5; i++)
    closeBar["but0" + i].addEventListener(MouseEvent.ROLL_OUT, this["closeButOut"+i])
      function this["closeButOut"+i](event:MouseEvent)
                                  closeBar["but0" + i].gotoAndStop(1);
    When I tried your change, it seemed to accept it, but the listener doesn't recognize it as the same function it's looking for.

  • How to use select a vi function inside a loop?

    I am modifying the notifier basics part 2.vi to send a notifier to each of 64 sub-vi's. How can you use the 'select a vi' function inside a loop for 64 iterations to access the individual filenames??
    Attachments:
    Notifier_BASICS_Part_2.vi ‏87 KB

    If all you are trying to do is send notifiers to each of these 64 subVIs, I would suggest not doing it in a loop, but rather just placing the 64 subVIs in your diagram.
    The alternative is of course to use the call by reference node and have an array of VI names. This is a little cleaner on the diagram, but 1) doesn't occur in parallel and 2) is a bit tricky. Additionally, you have to be sure that your array of filenames is correct, and that you NEVER move or rename those VIs. Of course, you could always put them in a directory and create an array by reading the directory contents.
    Either way, good luck, it doesn't sound like fun.

  • Function module in loop

    i m using "BAPI_GL_GETGLACCPERIODBALANCES" FUNCTION MODULE.
    LOOP AT IT_OUTPUT INTO WA_OUTPUT .
    CALL FUNCTION 'BAPI_GL_GETGLACCPERIODBALANCES'
      EXPORTING
        COMPANYCODE                   = WA_OUTPUT-BUKRS
        GLACCT                        = WA_OUTPUT-HKONT                                         (A/C NO)
        FISCALYEAR                    = WA_OUTPUT-GJAHR
        CURRENCYTYPE                  = '10'
    * IMPORTING
    *   BALANCE_CARRIED_FORWARD       =
    *   RETURN                        =
      TABLES
        ACCOUNT_BALANCES              = IT_OUTPUT.
    ENDLOOP.
    I M GETTING ALL RECORDS IN IT_OUTPUT.BUT WHEN I AM USING THIS FM, I AM NOT GETTING RECORDS FOR ALL A/C NO.
    PLZ SUGGEST .....
    THANKS
    Moderator message: please do not post in all upper case.
    Edited by: Thomas Zloch on Mar 15, 2011 9:06 AM

    Hi Sanket,
    You need to have three tables of type IT_OUTPUT,
    1) One which will have the input values that you need to pass to the BAPI - IT_OUTPUT_IN.
    2) The second table to get the out from the BAPI - IT_OUTPUT_OUT.
    3) The third table to accumulate the output from the BAPI - IT_OUTPUT_FINAL.
    change the code as given below,
    LOOP AT IT_OUTPUT_IN INTO WA_OUTPUT .
    CALL FUNCTION 'BAPI_GL_GETGLACCPERIODBALANCES'
    EXPORTING
    COMPANYCODE = WA_OUTPUT-BUKRS
    GLACCT = WA_OUTPUT-HKONT (A/C NO)
    FISCALYEAR = WA_OUTPUT-GJAHR
    CURRENCYTYPE = '10'
    IMPORTING
    BALANCE_CARRIED_FORWARD =
    RETURN =
    TABLES
    ACCOUNT_BALANCES = IT_OUTPUT_OUT.
    append lines of IT_OUTPUT_OUT to IT_OUTPUT_FINAL.
    REFRESH: IT_OUTPUT_OUT.
    ENDLOOP.
    With your current code: You are overwriting the entries of IT_OUTPUT every time you are calling the BAPI, and re-using the same entries in the loop.
    Regards,
    Chen

  • GetParameter function in 1.4.1

    Hi,
    I want to get parameters from an applet.
    The parameter's value contains carriage return. When I use the getParameter() function, all the carriage return are deleted. The problem is that I need them !
    Below a kind of parameters I used :
    <PARAM NAME="USER_TXT" VALUE="<B>title 1</B><br>
    4685006|GV2L|LC1D25/32|LR2DZ3|6
    4686506|GS1F|LC1D09/12/18|LR2Z13|6
    ">
    The Java code I used:
    strTxt= parent.getParameter("USER_TXT");
    The string displayed in the Java Console:
    <B>title 1</B><br>4685006|GV2L|LC1D25/32|LR2DZ3|64686506|GS1F|LC1D09/12/18|LR2Z13|6
    It worked fine when I used the 1.3.1_01 JVM but it does not work in 1.4.1_01....
    Does anyone have a solution to get the value with the carriage return?
    Thank you for your help,
    Scrb.

    How about encoding your CRs somehow? Try using the unicode escape sequence for CR, \u000D or maybe even the Java/C-style \n.
    .P.

  • How to define function within for loop pls help?????

    Hi this is the problem i have a class, and within that class there is an actionPerformed function, in this class i also create an instance of another class, this other class also contains an actionPerformed function, which wis executed if a jButton has been pressed, when I try to place this actionPerfromed function within a for loop of a function i get an error saying illegal start of experssion, and that the class should be defined abstract as it does not define actionPerformed, when i take it out of the for loop it compliles fine, i need the function to be placed within the for loop because it needs to know the variable of the for loop, is there anyway around this? Thanks, below is the code:
    public class DisplayTransitions extends JFrame implements ActionListener
    public void add()
    for(int i = 0; i < char2.size(); i ++)
    mPanel.add(tim[i] = new JButton("Time"));
    tim.addActionListener(this);
    public void actionPerformed(ActionEvent ae)
         if (ae.getSource() == tim[i])
              timeIncr();

    This is your for loop using an anonymous inner class for the listener:
                for (int i = 0; i < char2.size(); i++) {
                    mPanel.add(tim[i] = new JButton("Time"));
                    tim.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent ae) {
    if (ae.getSource() == tim[i]) {
    timeIncr();
    Learn more about anonymous inner classes from a good Java book or the Java tutorial (try http://java.sun.com/docs/books/tutorial/java/javaOO/QandE/nested-answers.html).

  • Opening PDF in IE "breaking" for loop

    Hi,
    I have a dynamic PDF that is uploaded to a website.  When the PDF opens, the user has to fill in certain fields before clicking the "Next" button.  Upon clicking the Next button, I have a JavaScript function that sets certain fields access to required and then runs a for loop to check if any are empty.  The next event is setting those fields access back to optional. Lastly, a popup window refers the user to the empty fields (fields are shaded red, but not their borders).
    The problem occurs for one user who is using IE9 and has Reader X installed on his machine.  It only occurs when he opens it directly with his browser, if he downloads it to his desktop first he encounters no problem.  But using the browser makes filling in the fields on Page 1 glitchy, and then the loop doesn't work properly when he hits "Next".  The event setting the fields back to optional doesn't seem to be firing, and the popup never comes up.  So he's left with fields with red borders-which should not be happening.
    Any idea what could be causing this bug only when accessing via browser? I can't replicate the problem on any of my browsers, even after disabling Adobe add-ons in IE. 
    Thanks for any suggestions!

    Hi,
    I have a dynamic PDF that is uploaded to a website.  When the PDF opens, the user has to fill in certain fields before clicking the "Next" button.  Upon clicking the Next button, I have a JavaScript function that sets certain fields access to required and then runs a for loop to check if any are empty.  The next event is setting those fields access back to optional. Lastly, a popup window refers the user to the empty fields (fields are shaded red, but not their borders).
    The problem occurs for one user who is using IE9 and has Reader X installed on his machine.  It only occurs when he opens it directly with his browser, if he downloads it to his desktop first he encounters no problem.  But using the browser makes filling in the fields on Page 1 glitchy, and then the loop doesn't work properly when he hits "Next".  The event setting the fields back to optional doesn't seem to be firing, and the popup never comes up.  So he's left with fields with red borders-which should not be happening.
    Any idea what could be causing this bug only when accessing via browser? I can't replicate the problem on any of my browsers, even after disabling Adobe add-ons in IE. 
    Thanks for any suggestions!

  • Performance issue: CALL FUNCTION inside a Loop.

    Hi Friends
    I have a Performance Issue. That is, inside a loop...endloop a CALL FUNCTION has been used which gets data from another database table. Finally it's appended into another internal table. Please see this :
      LOOP AT i_mdkp.
        REFRESH lt_mdtbx.
        CLEAR lt_mdtbx.
        CALL FUNCTION 'READ_MRP_LIST'
          EXPORTING
            idtnum        = i_mdkp-dtnum
            icflag        = 'X'
          tables
            mdtbx         = lt_mdtbx
        APPEND LINES OF lt_mdtbx TO i_mdtb.
      ENDLOOP.
    It happens for each record available in i_mdkp. Suppose, i_mdkp have around 50000 records, it needs to call the function module till that much time.
    So, I want to split it. Can I?
    Please give me your valueable suggestions.
    Regards
    Senthil

    If internal table i_mdkp has 50,000 records it does not mean that you need to run 50,000 iterations. You just need dtnum from internal table i_mdkp so you number of iterations should be eqaul to the unique number of dtnum in the internal table. Sort the internal table by dtnum and delete adjacent duplicates from the internal table comparing dtnum before looping. Look at the code below.
    DATA i_mdkp_tmp LIKE TABLE OF i_mdkp.
    IF NOT i_mdkp[] IS INITIAL.
      i_mdkp_tmp[] = i_mdkp[].
      SORT i_mdkp BY dtnum.
      DELETE ADJACENT DUPLICATES FROM i_mdkp COMPARING dtnum.
      REFRESH i_mdtb.
      LOOP AT i_mdkp.
        CALL FUNCTION 'READ_MRP_LIST'
          EXPORTING
            idtnum = i_mdkp-dtnum
            icflag = 'X'
          TABLES
            mdtbx = lt_mdtbx.
        APPEND LINES OF lt_mdtbx TO i_mdtb.
        REFRESH lt_mdtbx.
      ENDLOOP.
      i_mdkp[] = i_mdkp_tmp[]
    ENDIF.

  • Function with for loop and parameter table/column names ... syntax help

    I'm trying to create a function that returns the distinct values and counts from a user defined schema/table/column.
    The code below defines an object type [stats_on_column_obj] and creates a single table of this type [stats_on_column_tab].
    The function is supposed to take three input variables: p_schema_name, p_table_name, p_column_name and return a table (above).
    I can hard code a SELECT statement into the () ... but once I try to convert it to parameters & exec immediate I am stuck. The red section is where the issue is (i think).
    Oracle 10g.
    CREATE TYPE stats_on_column_obj IS OBJECT(
      COL_VAL      VARCHAR2(500),
      COL_VAL_CNT  NUMBER    (7)
    CREATE TYPE stats_on_column_tab IS TABLE OF stats_on_column_obj;
    CREATE OR REPLACE FUNCTION get_STATS_ON_COLUMN
       p_schema_name IN varchar2,
       p_table_name IN varchar2,
       p_column_name IN  varchar2
       RETURN STATS_ON_COLUMN_tab
    IS
       l_STATS_ON_COLUMN_tab   STATS_ON_COLUMN_tab := STATS_ON_COLUMN_tab ();
       n                       INTEGER := 0;
       str_select_tbl          varchar2(5000);
    BEGIN
       str_select_tbl := 'SELECT '||p_column_name||' as col_val, count(*) as col_val_cnt FROM '||p_schema_name||'.'||p_table_name||' group by '||p_column_name;
       FOR r IN (str_select_tbl)
       LOOP
          l_STATS_ON_COLUMN_tab.EXTEND;
          n := n + 1;
          l_STATS_ON_COLUMN_tab (n) := STATS_ON_COLUMN_obj (r.col_val, r.col_val_cnt);
       END LOOP ;
       RETURN l_STATS_ON_COLUMN_tab;
    END;
    [Error] PLS-00103 (124: 4): PLS-00103: Encountered the symbol "LOOP" when expecting one of the following:   * & - + / at mod remainder rem .. <an exponent (**)> ||   multiset year DAY_
    [Error] PLS-00103 (126: 9): PLS-00103: Encountered the symbol "=" when expecting one of the following:   constant exception <an identifier>   <a double-quoted delimited-identifier> table LONG_ double ref   char time timestam
    [Error] PLS-00103 (127: 29): PLS-00103: Encountered the symbol "(" when expecting one of the following:   constant exception <an identifier>   <a double-quoted delimited-identifier> table LONG_ double ref   char time timestam
    [Error] PLS-00103 (128: 4): PLS-00103: Encountered the symbol "END" when expecting one of the following:   begin function package pragma procedure subtype type use   <an identifier> <a double-quoted delimited-identifier> form
    SELECT * FROM TABLE (get_STATS_ON_COLUMN('SCHEMAS_X','TABLE_X','COLUMN_X'));

    SCOTT@orcl > CREATE OR REPLACE
      2    FUNCTION get_STATS_ON_COLUMN(
      3                                 p_schema_name IN varchar2,
      4                                 p_table_name IN varchar2,
      5                                 p_column_name IN  varchar2
      6                                )
      7      RETURN STATS_ON_COLUMN_tab
      8      IS
      9          v_STATS_ON_COLUMN_tab STATS_ON_COLUMN_tab := STATS_ON_COLUMN_tab ();
    10          v_n                   INTEGER := 0;
    11          v_str_select_tbl      VARCHAR2(5000);
    12      BEGIN
    13          v_str_select_tbl := 'SELECT stats_on_column_obj(' || p_column_name || ',count(*)) FROM ' ||
    14                              p_schema_name || '.' || p_table_name || ' group by ' || p_column_name;
    15      EXECUTE IMMEDIATE v_str_select_tbl
    16        BULK COLLECT
    17        INTO v_STATS_ON_COLUMN_tab;
    18       RETURN v_STATS_ON_COLUMN_tab;
    19  END;
    20  /
    Function created.
    SCOTT@orcl > select  *
      2            from  table(
      3                        get_STATS_ON_COLUMN(
      4                                            'SCOTT',
      5                                            'EMP',
      6                                            'JOB'
      7                                           )
      8                       )
      9  /
    COL_VAL              COL_VAL_CNT
    CLERK                          4
    SALESMAN                       4
    PRESIDENT                      1
    MANAGER                        3
    ANALYST                        2
    SCOTT@orcl >
    Or better change it to pipelined function.
    SY.

  • Rank function breaks drill down 11g

    I have a simple drill down report standard hierarchy and am having a weird issue with the rank function.
    This report works on 10g but the upgraded 11g version does not.
    When I drill down past the 2nd level it adds an is null filter to the revenue column.  This is also the column we are using to base our rank function.
    If I move the rank column to the first or last position in the table the drills work perfectly.  If I move it to the second column it breaks on the first drill instead of the 2nd.
    It works perfectly if drilling on the headings instead of the values.  That seems to point to some sort of null coming through when being passed.  I've tried using an ifnull and a case statement and neither method works, it just applies the is null filter to the entire column formula.
    The client doesn't want to change the position of the rank column so that work around will not do.  Any ideas?

    A similar thread was recently talked about here:
    In OBIEE charts, how do you make drill downs work on custom formulas?
    With a calculated column, you need to make sure the source query and destination query have the EXACT same formula and the same name for the field. If it is not 100% identical, it may not work correctly. (I typically use the NAVIGATE function to get to the second query rather than the Drill function.)
    Now in some cases, if you try to create a second drill down query with more details in it, the original formula doesn't work the way you want it to. The calculated formulas have to make sense in both source query and destination query in order to work properly. If you have a ranking of the Top 5 Products in the source query, the destination query also has to have the same ranking of Top 5 products in order to work. If you add more fields into the destination query (e.g., adding on product attributes, or # of records associated with that product name etc.), then sometimes the ranking / aggregation in the destination doesn't add up the same way. This causes the system to think that the formulas are different and prevents the drill down.
    I managed to get around this by having a 3rd query in between the original summary view and the detailed data view. So the sequence would be (for example):
    - Dashboard based summary query (including the calculated ranked product names formula)
    - drill down into virtually identical query (add on one slight bit of difference here, for example adding on a second Product Name field ... not a calculated version, but the actual name). Create a drill down this time by clicking on the regular Product Name field (don't drill down on the custom formula)
    - final detailed drill-down query
    You can format this intermediary drill down query to explain to users that they need to click a second time.
    It's not ideal, but it should work. Hope this helps.
    Ted

  • Using the Wait function in while loops?

    Hi,
    I have a rather complicated top level VI with about 20 subVIs and the main VI has on big while loop around it and another smaller one inside, basically it runs rather slow and I have no idea how to set the wait function. I mean what factors should I consider..what would be the difference between setting it to 10 and 100 (besides the obvious 10ms vs 100ms)? I just want to increase the performance of the executable, so it is not that slow. Can you offer some hints as to what I need to take into consideration when determining my delay? And also, are while loops the only place that I should use the delay or are there other instances too?

    Adding waits is not a fix-all for slow running applications. Its just one thing that can be done to improve things. If you determine that a sub-vi is causing your problems then you need to find out exactly what that vi is doing to slow you down. If its because there is a loop inside it that is running constantly as fast as it can, then a delay in that loop may help. If that is not your problem then you need to look at other ways to boost performance. It sounds like you have alot of locals variables, each instance of a local variable makes a copy of the data that's in the control. If the controls/indicators that you have local variables of contain large amounts of data then you may be filling up memor
    y with copies of it.
    I suggest that you study the "Performance and Memory Management" chapter of the LabVIEW manual. This can found in the printed manual of the older versions, in the online manuals that install with 6i, or on NI's web site here: http://zone.ni.com/devzone/conceptd.nsf/2d17d611efb58b22862567a9006ffe76/732cec772aa4fbe586256a37005541d3?OpenDocument , which is Application Note 168. This should give you some good ideas of what to look for to improve your performance.
    Hope this helps.
    Brian

Maybe you are looking for

  • Dead Pixel or dirt under the screen.

    So i got a new macbook last week, and so far i love it. I noticed a small green dot on my screen, and told apple about it (after an exhausting chain of calls and trips to the apple store). They said they could either repair it or replace it. Both wou

  • Pop up window on dock freezes...

    When I click on an icon in the dock, the pop up window freezes...(Keep In Dock, Open at Login, Show in finder, etc... for example), the window will freeze and I get no action, nothing happens in the dock at this point...Everything else on my computer

  • Iphotos not showing up in iMovie project

    I am dragging my photos from iphoto into iMovie to add to a new project.  Then when I play the project, they are not showing up.  What is going wrong?

  • Installing Mac OS X Lion on a new drive fails

    I got a new SSD to replace my HDD with. I followed the directions on apple's website: I erased and formatted my usb drive, I downloaded and installed Lion Recovery Assistant on it, then I put the SSD in. Then I boot up holding the option key and I co

  • Determine where badi is called from : webshop, GUI or webUI

    Hi Experts, I am working on BADI com_partner_badi. I want to determine where this badi is being called from, ie, either from webshop, GUI or webUI in the ABAP debugger. Which parameter of the badi should i check , which will provide me with the calli