Helper.eventURL( , , ) in MAM CODE - What this function does ??

Hi all,
Following are few code lines from MAM code :
// this is in common.inc"
<jsp:useBean id="helper"
    class="com.sap.mbs.core.web.ViewHelper" scope="request"/>
String allOrderURL = helper.eventURL("onOrderList", "orderListType", "ALL_ORDERS");
helper.getApplicationURL()
Could anyone please tell what this eventURL ,getApplicationURL methods are for ?
I couldnt find any documentation that explains it.
Regards,
Vipin

Hello Vipin.
Jo is rite.
The class is abstract but the class which is used to create the bean is the implementation class:
<b>DefaultViewHelper</b>
This is the implementation of the abstract class ViewHelper.
The ViewHelper is used to create URLs which are used to load a new page with our without submitting a form.
You can use eventURL to build an URL for a link you want to create (JO's example).
You can use submitEventURL in order to submit your form.
This method builds a call to a JavaScript method.
You can find this method in the file:
app-root/include/common.inc
function submitURL(url).
This function uses url as action for the submit.
So if you use something like this:
onClick="<%=helper.submitEventURL("onOK")%>"
all the form content is written to the context and the onOK method of the corresponding controller class is called. You can get the form content using the context in this controller method then.
When I started working with MAM I was also confused about the mbs.core Framework.
Read this maybe it helps:
SAP MAU MVC
Best regards,
Sascha
Message was edited by: Sascha Dingeldey

Similar Messages

  • How to use "url.openStream()" . What this function does?

    how to use "url.openStream()" . What this function does?
    Edited by: sahil1287 on Apr 16, 2009 10:02 PM

    http://java.sun.com/javase/6/docs/api/java/net/URL.html#openStream()
    http://java.sun.com/docs/books/tutorial/networking/urls/readingWriting.html

  • What this function does: AIB3_EVALUATE_ODS_ASSIGN in PS/IM?

    Dear all,
    I'm investigating for the possible cause of data lost in transit in PS/IM area. The suspect currently is an update rule involving a function AIB3_EVALUATE_ODS_ASSIGN, as based on its E_SUBRC output value a record is skipped or not. Though I'm working with Z-objects now, this turns to be a part of Business Content as well.
    Does anyone has an idea what is the logic of that function? SAP doesn't provide any documentation on that, so the only option I have at the moment is to play with that blackbox...
    Cheers!
    /RB

    I'm not worried about race conditions, as evaluation of the expression takes place as the last thing before the new execution is started. It must either be done just before the SequenceCall, or as the first thing in the Setup group of the subsequence.
    It's fragile to modify the expression at runtime to mimic a different context (by replacing stuff like "Locals." with "RunState.Caller.Locals." for instance, if they were in the same callstack), since such string replacement could never be exhaustive. What about "Step."? What about constructs like ("L" & "ocals.")? I could never identify them all.
    I could split the expression up in two, like this (evaluated in the subsequence):
    Evaluate("Locals." + Locals.TargetName) = Evaluate("RunState.Caller.Locals.SourceName")
    The above works if Locals.SourceName was in the caller context, but my problem is a bit more complex than that; I need the right hand side to evaluate any expression string, and I need to supply a context to do it within. It's too fragile to string-replace "Locals." with "RunState.Caller.Locals." etc., as the expression might contain "Parameters.", "FileGlobals.", or much more complex access patterns from the caller context.
    One way would be to make a new expression object and use Expression.Evaluate(context,evaloptions) on that in the subsequence, with context passed from the caller, but how do I make and pass an expression object to the sequence in which to set the TargetName local variable? It has something to do with Engine.NewExpression, but where do I store this expression object in the caller? And how do I set its Text property to "Locals.SourceName" (in this particular example, but remember it could be any expression)? And finally how do I pass this expression object to the subsequence via a parameter (what type should the parameter be)?
    Cheers,
    Steen
    CLA, CTA, CLED & LabVIEW Champion

  • Any idea what this function is meant for?

    DB version:10gR2
    Have you guys any idea what this function does?
    create or replace function separate_1
        in_list varchar2,
        in_del varchar2 := ','
    ) return split_tbl pipelined
    is
        l_idx    pls_integer;
        l_list    varchar2(32767) := in_list;
        l_value    varchar2(32767);
    begin
        loop
            l_idx := instr(l_list,in_del);
            if l_idx > 0 then
                pipe row(substr(l_list,1,l_idx-1));
                l_list := substr(l_list,l_idx+length(in_del));
            else
                pipe row(l_list);
                exit;
            end if;
        end loop;
        return;
    end separate_1;The comment for this functions says that this is used to split a string delimited by a comma separator. But i didn't understand this function. Can this functionality be achieved without a table function?

    user10450365 wrote:
    DB version:10gR2
    Have you guys any idea what this function does?Odd that. Apart from a couple of parameter name changes it looks almost identical to a function I posted a couple of years back...
    SQL> CREATE OR REPLACE TYPE split_tbl IS TABLE OF VARCHAR2(32767);
      2  /
    Type created.
    SQL> CREATE OR REPLACE FUNCTION split (p_list VARCHAR2, p_delim VARCHAR2:=' ') RETURN SPLIT_TBL PIPELINED IS
      2      l_idx    PLS_INTEGER;
      3      l_list   VARCHAR2(32767) := p_list;
      4      l_value  VARCHAR2(32767);
      5    BEGIN
      6      LOOP
      7        l_idx := INSTR(l_list, p_delim);
      8        IF l_idx > 0 THEN
      9          PIPE ROW(SUBSTR(l_list, 1, l_idx-1));
    10          l_list := SUBSTR(l_list, l_idx+LENGTH(p_delim));
    11        ELSE
    12          PIPE ROW(l_list);
    13          EXIT;
    14        END IF;
    15      END LOOP;
    16      RETURN;
    17    END SPLIT;
    18  /
    Function created.
    SQL> SELECT column_value
      2  FROM TABLE(split('FRED,JIM,BOB,TED,MARK',','));
    COLUMN_VALUE
    FRED
    JIM
    BOB
    TED
    MARK

  • Since upgrading to CFB 3, I am unable to view "ColdFusion Documentation" (Help).  How do I restore this functionality?

    Since upgrading to CFB 3, I am unable to view "ColdFusion Documentation" (Help).  How do I restore this functionality?

    I found a workaround.
    Close Builder
    Navigate to:
    /Applications/ColdfusionBuilder3/plugins/com.adobe.coldfusion.help_3.0.0/toc.xml
    Copy it to
    tocOrig.xml
    Edit:
    /Applications/ColdfusionBuilder3/plugins/com.adobe.coldfusion.help_3.0.0/toc.xml
    <?xml version="1.0" encoding="UTF-8"?><toc label="Adobe ColdFusion Documentation"> 
       <topic label="Configuring and Administering ColdFusion" href="docs/Configuring+and+Administering+ColdFusion.html"/>
       <topic label="CFML Reference" href="docs/Adobe+ColdFusion+CFML+Reference.html"/>
       <topic label="Developing Applications with ColdFusion" href="docs/Developing+Adobe+ColdFusion+Applications.html"/>
       <topic label="Installing And Using ColdFusion" href="docs/Installing+Adobe+ColdFusion.html"/>
    </toc>
    Change to:
    <?xml version="1.0" encoding="UTF-8"?><toc label="Adobe ColdFusion Documentation">
       <topic label="Configuring and Administering ColdFusion" href="docs/Configuring_and_Administering_ColdFusion.html"/>
       <topic label="CFML Reference" href="docs/Adobe_ColdFusion_Reference.html"/>
       <topic label="Developing Applications with ColdFusion" href="docs/Developing_Adobe_ColdFusion_Applications.html"/>
       <topic label="Installing And Using ColdFusion" href="docs/Installing_Adobe_ColdFusion.html"/>
    </toc>
    Next go to folder: 
    /Applications/ColdfusionBuilder3/plugins/com.adobe.coldfusion.help_3.0.0/docs
    1.  Copy
    Adobe+Coldfusion+CFML_Reference.html
    and rename the copy to
    Adobe_Coldfusion_Reference.html
    2. Copy Configuring+and+Administering+ColdFusion.html
    and rename the copy to
    Configuring_and_Administering_ColdFusion.html
    3. Copy
    Developing+Adobe+ColdFusion+Applications.html
    and rename the copy to
    Developing_Adobe_ColdFusion_Applications.html
    4.  Copy
    Installing+Adobe+ColdFusion.html
    and rename the copy to
    Installing_Adobe_ColdFusion.html
    e.g.  I took the '+' out of the file name and inserted a '_'
    NOTE: this worked for all but
    Adobe+ColdFusion+CFML+Reference.html
    It did not work with:
    Adobe_ColdFusion_CFML_Reference.html
    but renaming it to this worked:
    Adobe_ColdFusion_Reference.html
    I don't know why.
    You must restart Builder for it to take effect.

  • What this one does?

    I tried http://kuba.zilp.pl/?id=1, and don't understand the statement " ADFUtils.executeOperation("downloadingPageDef", "Execute");". What this one does?
    Thanks in advance!, I am using jdeveloper 10g.
    Rgds!

    xsyang wrote:
    I tried http://kuba.zilp.pl/?id=1, and don't understand the statement " ADFUtils.executeOperation("downloadingPageDef", "Execute");". What this one does?
    Thanks in advance!, I am using jdeveloper 10g.
    ADFUtils is a utility helper class for usage in the ViewController. I am not familiar with the specific 10g version of executeOperation() method but it seems to be used to execute a method binding. In this case the method binding is called Execute and is bound in the downloadingPageDef page definition file.
    Searching the forum will yield these results:
    http://forums.oracle.com/forums/search.jspa?objID=f83&q=ADFUtils

  • Help....I am trying to set up iClould on my pc....the set up was complete....when I try to sign in to set up it says the Apple ID is valid but is not an iCloud account.  Please help me and tell me what I am doing wrong.

    Help....I am trying to set up iClould on my pc....the set up was complete....when I try to sign in to set up it says the Apple ID is valid but is not an iCloud account.  Please help me and tell me what I am doing wrong. Thx

    Hi DesCoop,
    You must initiallly activate iCloud from an IOS device or a Mac. You cannot inititally activated from a PC.
    Sorry.
    GB

  • TS1368 Have downloaded the latest version of ITunes and now i get "Incompatable Application" I tunes will no longer open. have worked my way through FAQ and help to no avail. What am i doing wrong? currently running windows 7.

    Have downloaded the latest version of ITunes and now i get "Incompatable Application" I tunes will no longer open. have worked my way through FAQ and help to no avail. What am i doing wrong? currently running windows 7.

    Have downloaded the latest version of ITunes and now i get "Incompatable Application" I tunes will no longer open. have worked my way through FAQ and help to no avail. What am i doing wrong? currently running windows 7.

  • Can anyone tell me what this is doing

    hey this is part of some parser code from an earlier java forum post
    http://forum.java.sun.com/thread.jspa?threadID=506162&messageID=2399163#239 9163
    i modified the code slightly to work with my program which involves its use in an applet and to solve logical equations. However i'm still uncertain as to what certain sections of the code are doing
    i know that this code evaluates the variables within the given equation, begins a for loop that does not exit until i = codeSize which is the length of the given String. However i'm not so certain as to how it achieves this. I'd like to know
    private int eval(int variableX, int variableY, int variableZ)
                    try {
                            int top = 0;
                            for (int i = 0; i < codeSize; i++)
                                    if (code[i] >= 0)
                                            stack[top++] = constants[code];
    else if (code[i] >= POWER)
    int y = stack[--top];
    int x = stack[--top];
    int ans = (int)Double.NaN;
    switch (code[i])
    case PLUS: ans = x | y; break;
    case MINUS: ans = x & y; break;
    case TIMES: ans = x & y; break;
    case DIVIDE: ans = x / y; break;
    // case POWER: ans = Math.pow(x,y); break;
    if (Double.isNaN(ans))
    return ans;
    stack[top++] = ans;
    else if (code[i] == VARIABLEX)
    stack[top++] = variableX;
    else if (code[i] == VARIABLEY)
    stack[top++] = variableY;
    else if(code[i] == VARIABLEZ)
    stack[top++] = variableZ;
    /* else {
    double x = stack[--top];
    double ans = Double.NaN;
    int d;
    d = (int) ans;
    switch (code[i])
    case SIN: ans = Math.sin(x); break;
    case COS: ans = Math.cos(x); break;
    case TAN: ans = Math.tan(x); break;
    case COT: ans = Math.cos(x)/Math.sin(x); break;
    case SEC: ans = 1.0/Math.cos(x); break;
    case CSC: ans = 1.0/Math.sin(x); break;
    case ARCSIN: if (Math.abs(x) <= 1.0) ans = Math.asin(x); break;
    case ARCCOS: if (Math.abs(x) <= 1.0) ans = Math.acos(x); break;
    case ARCTAN: ans = Math.atan(x); break;
    case EXP: ans = Math.exp(x); break;
    case LN: if (x > 0.0) ans = Math.log(x); break;
    case LOG2: if (x > 0.0) ans = Math.log(x)/Math.log(2); break;
    case LOG10: if (x > 0.0) ans = Math.log(x)/Math.log(10); break;
    case ABS: ans = Math.abs(x); break;
    case SQRT: if (x >= 0.0) ans = Math.sqrt(x); break;
    case UNARYMINUS: ans = -x; break;
    if (Double.isNaN(ans))
    return d;
    stack[top++] = d;
    catch (Exception e)
    double b = Double.NaN;
    int i = (int)b;
    return i;
    } double d2;
    if (Double.isInfinite(stack[0]))
    d2 = Double.NaN;
    int i2 = (int) d2;
    return i2;
    }else
    return stack[0];
    any help much appreciated
    cheers
    podger

    Well this is a very basic interpreter. What this piece of code does is:
    1) take an opcode from the code array, and retrieves the description for it from the constants array. This description is stored in the stack array.
    stack[top++] = constants[code];
    2) check what opcode it is
    switch (code)
    3) "execute" the opcode with simple java math operators.
    case PLUS:    ans = x | y;  break;
    case MINUS:   ans = x & y;  break;
    case TIMES:   ans = x & y;  break;
    case DIVIDE:  ans = x / y;  break;4) store the result of the opcode in the stack array, after the description of the opcode retrieved in step 1)
    stack[top++] = ans;There is also some sort of error check in there: initially the result of the opcode is "NaN", (not a number). If the opcode passed to this code is not known, the result is not added to the stack according to this piece of code:
    if (Double.isNaN(ans))
    return ans;

  • Where/how can i find out what this is doing

    I know this old but not concerned with that, just what is it doing,  this is java script in an .asp that loads
    a flash application, I'm most concerned/interested
    why it references a clsid?
    what is the code base all about? (is this embedding code in the browser? it does the embed everytime the app is loaded?)
    what is the PLUGINSPAGE?
    how does all this affect the opertion of the flash apps that run after this initializtion?
    this is kinda/somewhat/ normal for anytime /anyone running a flash app?
    It seems there's a lot going here, if too much to answer please just point me somewhere where i can RTFM, but
    please make it a good RTFM not a FWOT!!!
    flName = "default-app.swf"
    document.write('<OBJECT'
             + ' CLASSID=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
             + ' CODEBASE=":http//download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0 ,79,0"'
             + ' ID="flash"'
             + ' WIDTH=' + flWidth
             + ' HEIGHT=' + flHeight + '>'
             + '<PARAM NAME=movie VALUE="' + flName + cookString + '">'
             + '<PARAM NAME=menu VALUE="false">'
             + '<PARAM NAME=quality VALUE=high>'
              etc more params
             finally
             + ' TYPE="application/x-shockwave-flash"'
             + ' PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">'
             + '</EMBED></OBJECT>'

    that's standard flash embedding code with variable swf name, width and height.

  • What this method does ?

    Q1.
    boolean isInterface()
              Determines if the specified Class object represents an interface type. what this method means ?
    Look it is saying "....object represents an interface type.. But an interface can not refer objects unless it is implemented by some concrete class.
    is there any polymorphism involved(i guess) ?
    i mean like this ......
    interface ABC
    // blah
    class CDE implements ABC
    // defined everything here
    ABC s = new CDE(); // it is legal
    does this method relates to this ?
    Am i right ? However code below is not comfortable.........
    Q2:
    Here is the code i stumbled................ It usues that method.
    Description: Determining If a Class Object Represents a Class or Interface
    Code:
    Class cls = java.lang.String.class; // Line-1.....is it valid !!!!
    boolean isClass = !cls.isInterface(); // true
    cls = java.lang.Cloneable.class; 
    isClass = !cls.isInterface(); // falseLook at Line-1.................i dont see any heirchy down the String class in the API.....( java.lang.String.class .....is it valid ? yes that bold .class !! ) its a peculiar use of String class !!.
    can anybody explain what is happening here. what reference who calls ?
    Thank you

    good explanation indeed.
    Look ur comment
    // By way of a string........why String ? why
    do i hardcode
    Class.forName("java.lang.String");......there
    are lots of Classes in the API who extends Object
    class.
    Look
    cls = java.lang.String.class // again u have
    hardcoded String class !!!
    It seems to me i need to hardcode always with
    String class( right ? no other class can be
    usued !!) to get the Class or Inteface type out of
    object.No, you can do it for any class: Class c1 = List.class;
    Class c2 = new List().getClass();
    Class c3  = Class.forName("java.util.List"); All are legal, and you can do that with any class or interface, not just String.
    So if you do something that gets a Class object--say the user enters a class name or interface name, and you pass that to Class.forName()--you can then call isInterface() to see if it's an interface.
    String classname = getStringFromUser(); // assume user enters "java.util.Comparator"
    Class klass = Class.forName(classname);
    boolean  isIxfc = klass.isInterface(); // true for java.util.Comparator

  • Plz help me in writing code to assign functionality to any function keys

    How to assign function(F1,F2...) keys or ctrl, shift keys for any
    functionality?
    For eg: If we click F1 while the cursor is in any text box, it should be
    able to retrieve some data from database and it should display the
    retrevied data in the dropdown form in the text box, so that we can
    select one value among them....(JSP/Servlets).

    That would be happening on the client. And the servlets run on the server. In other words hot-keys have nothing to do with servlets. Perhaps there is some Javascript way of doing that.

  • Can anyone pls explain what this procedure does?

    i could only figure out that it will be performing a transpose.
    create or replace
    PROCEDURE TEST_TRANSPOSE(o_test OUT SYS_REFCURSOR) AS
    report_exists number(3);
    report_name varchar(30) := 'REPORT_TBL' ;
    query_main varchar(16000) := 'create table ' || report_name || ' as select MAGAZINE ' ;
    query_part varchar(1024) ;
    my_var varchar2(5);
    cursor cur_region is select distinct REGION from MAIN_TBL order by region;
    begin
    select count(*) into report_exists
    from tab
    where tname = report_name;
    if ( report_exists = 1 ) then
    execute immediate 'drop table ' || report_name ;
    end if;
    open cur_region ;
    loop
    fetch cur_region into my_var ;
    exit when cur_region%NOTFOUND;
    query_part := 'select nvl(sum(quantity),0) from MAIN_TBL x where x.magazine = main.magazine and x.region='''||my_var||'''' ;
    query_main := query_main || chr(10) || ',(' || query_part || ')"' || my_var || '"';
    end loop;
    close cur_region ;
    query_main := query_main || ' from (select distinct MAGAZINE from MAIN_TBL ) main' ;
    DBMS_OUTPUT.PUT_LINE(query_main);
    --execute immediate query_main ;
    open o_test for query_main;
    end;
    {code}
    i need to transpose  a table which has dynamic number of rows.This was what i tried.Could you pls bhelp me out to correct this i get "P_TRAN_YEAR" invalid identifier
    [code]
    create or replace
    PROCEDURE         PRM_R_MAT_RPT (p_EmpID     IN  Integer,
    P_TRAN_YEAR IN NUMBER,
    P_TRAN_MONTH IN NUMBER,O_rc OUT sys_refcursor) IS
    v_cnt NUMBER;
    v_sql VARCHAR2(32767);
    v_basic Number(16, 4);
    BEGIN
    select PPH_ORG_AMOUNT into v_basic from prm_p_hop
    where pph_emp_id=p_empid
    and pph_tran_year=p_tran_year
    and pph_tran_month=P_TRAN_MONTH
    and pph_hop_code=5
    and PPH_SALARY_THRU='R';
    -- SELECT  distinct count(*)
    --  INTO v_cnt
    --  FROM PRM_T_VAR_HOP
    --  where PTVH_EMP_ID=p_EMPID
    --  and PTVH_TRAN_YEAR=p_TRAN_YEAR
    --  and PTVH_TRAN_MONTH=P_TRAN_MONTH;
    v_sql := 'select  distinct PCH_SHORT_DESCRIPTION,v_basic,PTVH_AMOUNT Amount ';
    --  FOR i IN 1..v_cnt
    --  LOOP
    v_sql := v_sql || ',max(decode(rn, PCH_SHORT_DESCRIPTION)) as description ';
    --v_sql := v_sql || ',max(decode(rn, '||to_char(i)||', PDSL_INTEREST)) as interest'||to_char(i);
    -- v_sql := v_sql || ',max(decode(rn, '||to_char(i)||', PDSL_PRINCIPAL_SALARY)) as principle'||to_char(i);
    -- v_sql := v_sql || ',max(decode(rn, '||to_char(i)||', PDSL_SOCIETY_CODE)) as SOC_CODE'||to_char(i);
    --  END LOOP;
    v_sql := v_sql || ' from (select  PRM_T_VAR_HOP.*, PRM_C_HOP.*, row_number() over (partition by PTVH_EMP_ID order by PTVH_EMP_ID) as rn
    from  
    PRM_T_VAR_HOP,
    PRM_C_HOP
    WHERE PTVH_EMP_ID         =P_empid
    And   PTVH_TRAN_YEAR      =P_TRAN_YEAR
    And   PTVH_TRAN_MONTH     =P_TRAN_MONTH
    And   PTVH_HOP_CODE       =PCH_HOP_CODE
    AND   PCH_CALCULATION_BASIS=''V''
    AND   PCH_TAG              =''C''
    AND   PTVH_SALARY_THRU     =''R'')';
    OPEN O_rc FOR v_sql;
    END;
    [/code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Your first piece of code does not work, because a create table statement cannot be issued using a ref cursor like that. When executed with the "execute immediate" command, it works. Then, the refcursor is only a "select * from report_tbl".
    What it does, is dynamically dropping and creating a table report_tbl and filling it with the results of a horribly inefficient pivot query. If the report_tbl has no other purpose after running this procedure, then I'd suggest to not drop and create tables dynamically like that. In the second variant of test_transpose, you can see how you can do that.
    SQL> create table main_tbl (magazine,region,quantity)
      2  as
      3  select 'MAGAZINE1','REGION1',1 from dual union all
      4  select 'MAGAZINE1','REGION2',2 from dual union all
      5  select 'MAGAZINE1','REGION3',3 from dual union all
      6  select 'MAGAZINE2','REGION1',4 from dual union all
      7  select 'MAGAZINE2','REGION2',5 from dual union all
      8  select 'MAGAZINE2','REGION3',6 from dual
      9  /
    Tabel is aangemaakt.
    SQL> create or replace PROCEDURE TEST_TRANSPOSE(o_test OUT SYS_REFCURSOR)
      2  AS
      3    report_exists number(3);
      4    report_name varchar(30) := 'REPORT_TBL' ;
      5    query_main varchar(16000) := 'create table ' || report_name || ' as select MAGAZINE ' ;
      6    query_part varchar(1024) ;
      7    my_var varchar2(7);
      8
      9    cursor cur_region is select distinct REGION from MAIN_TBL order by region;
    10  begin
    11    select count(*) into report_exists
    12    from tab
    13    where tname = report_name;
    14    if ( report_exists = 1 ) then
    15    execute immediate 'drop table ' || report_name ;
    16    end if;
    17
    18    open cur_region ;
    19    loop
    20      fetch cur_region into my_var ;
    21      exit when cur_region%NOTFOUND;
    22      query_part := 'select nvl(sum(quantity),0) from MAIN_TBL x where x.magazine = main.magazine and x.region='''||my_var||'''' ;
    23      query_main := query_main || chr(10) || ',(' || query_part || ')"' || my_var || '"';
    24    end loop;
    25    close cur_region ;
    26
    27    query_main := query_main || ' from (select distinct MAGAZINE from MAIN_TBL ) main' ;
    28    execute immediate query_main;
    29    open o_test for 'select * from ' || report_name;
    30  end;
    31  /
    Procedure is aangemaakt.
    SQL> var rc refcursor
    SQL> exec test_transpose(:rc)
    PL/SQL-procedure is geslaagd.
    SQL> print rc
    MAGAZINE     REGION1    REGION2    REGION3
    MAGAZINE1          1          2          3
    MAGAZINE2          4          5          6
    2 rijen zijn geselecteerd.
    SQL> create or replace procedure test_transpose (o_test out sys_refcursor)
      2  as
      3    l_query varchar2(1000) := 'select magazine';
      4  begin
      5    for r in (select distinct region from main_tbl)
      6    loop
      7      l_query := l_query || ', sum(decode(region,''' || r.region || ''',quantity)) ' || r.region;
      8    end loop;
      9    l_query := l_query || ' from main_tbl group by magazine';
    10    open o_test for l_query;
    11  end;
    12  /
    Procedure is aangemaakt.
    SQL> exec test_transpose(:rc)
    PL/SQL-procedure is geslaagd.
    SQL> print rc
    MAGAZINE     REGION1    REGION2    REGION3
    MAGAZINE1          1          2          3
    MAGAZINE2          4          5          6
    2 rijen zijn geselecteerd.Regards,
    Rob.

  • Anyone know what this sign does?

    Good morning all,
    Just a quick question. Ive tried googling this and checking my books but after an hour of doing so I just thought Id ask. Why would one use th (+) in a query, especially when joining two tables?
    I saw this:
    SELECT inv.item, inv.price, recpt.recept
    FROM inventory inv, receipts recpt
    WHERE inv.item(+) = recpt.item;
    But dont know why you need that plus sign. Whats its purpose?

    Spot the difference:
    SQL> create table t1 as select level col from dual connect by level <= 3;
    Table created.
    SQL> create table t2 as select level col from dual connect by level <= 5;
    Table created.
    SQL> select col from t1;
           COL
             1
             2
             3
    3 rows selected.
    SQL> select col from t2;
           COL
             1
             2
             3
             4
             5
    5 rows selected.
    SQL> select t1.col t1col
      2  ,      t2.col t2col
      3  from   t1
      4  ,      t2
      5  where  t1.col = t2.col;
         T1COL      T2COL
             1          1
             2          2
             3          3
    3 rows selected.
    SQL> select t1.col t1col
      2  ,      t2.col t2col
      3  from   t1
      4  ,      t2
      5  where  t1.col(+) = t2.col;
         T1COL      T2COL
             1          1
             2          2
             3          3
                        5
                        4
    5 rows selected.

  • Please explain what this program doing- I see the results but don't underst

    public class Mystery2{
    public static void main(String []args){
    int count = 1;
    while (count <= 10){
    System.out.println(count % 2==1? "****":"++++++");
    ++count;
    }//end while
    }//end main
    }//end class

    Hello! First of all - where did you find this code (just for information, so it's easier to answer the question)
    Secondly, pls be so kind as to use code tags. Here's the same program, reformatted and in code tags:
    public class Mystery2
        public static void main (String [] args)
            int count = 1;
            while (count <= 10)
                System.out.println (count % 2 == 1 ? "****" : "++++++");
                ++count;
            }//end while
        }//end main
    }//end class

Maybe you are looking for