Return function issue

Hi All,
I am trying to use @RETURN function in one of the requirments and unfortunately it is not behaving as I expect out to be.
My sample psuedo code is:
FIX(A,B,C)
"SomeAccount"
if("Account%age" <> 1)
<do some calc>
else
@RETURN("Percentage is not 1",INFO);
/* SampleAccount2= -9; */
endif
ENDFIX
Everytime I run it always goes to the RETURN statement. If I replcae the RETURN line by SampleAccoun2, it retrieves -9;
Any help would be greatly appreciated!

996012 wrote:
Everytime I run it always goes to the RETURN statement. If I replcae the RETURN line by SampleAccoun2, it retrieves -9;
If you are replacing RETURN with any other statement if its still going to else clause then check the IF condition.
And regarding RETURN you may want to use ERROR instead of INFO, it will help you in displaying the right message in Planning.
Cheers...
Rahul S.

Similar Messages

  • Calc manager: @RETURN function with WARNING as message type issue

    Hi Gurus,
    I m working in version 11.1.2.2 in IE 9. I have created a simple calculation script as below to test the @Return essbase function.
    function
    FIX ( .....)
    "502100"(
    IF( ("YearTotal" > 50000))
    @RETURN("True:test message" , WARNING);
    ELSE
    @RETURN("False:test message" , WARNING);
    ENDIF
    This script validates fine , however when executed on Save of Data Form gives a Job console error with no error code but message as below
    Invalid network data. Type is matched but length is zero. An application protocol error might exist between server and client processes..
    The same script executed using error message type as *"ERROR"* executes successfuly on save of data form and gives exepected custom error message.
    I read a thread in forum saying the @Return function works only with ERROR as message type for vesrion 11.1.2.1
    How to use Essbase @RETURN function to displayed messages in 11.1.2.1
    I have tried using WARNING and INFO , both doesnt seem to work even in 11.1.2.2, Only ERROR as message type works.
    Has anyone experienced the same with version 11.1.2.2 as well? Is this still a bug?
    Please let me know your inputs.
    Thanks
    SN

    Hi,
    I am sorry for the late response!
    Thank you for all your suggestions!
    I had used in the followng way and it resolved my issue.
    SELECT GUID_PRGEN  "Primary Key as GUID in "RAW" Format
             GUID_PR     "Primary Key as GUID in "RAW" Format
             ATTR20A     "SUBSTANCE ID
             ATTR05A     "Materail Type
             ATTR10A     "Materail Group
             ATTR05B     "Sub-Family
             FROM /SAPSLL/PRGEN
             INTO TABLE T_PRGEN
             WHERE ATTR20A IN S_AT20A.
      IF T_PRGEN IS INITIAL.
        MESSAGE : I007(ZMSSG) WITH 'Data not available for this entry'.
        STOP.
      ENDIF.
    Regards,
    Kittu

  • Function issue of Cross-Reference

    Hi,
    thanks for your attention on this topic.
    there is function issue of Cross-Reference.
    when click the Cross-Reference after re-installed the software (adobe Framemaker 7.10), the function is not working. please kindly check the screenshots below:
    Error message below:
    Please help to check this issue.
    software: Adobe Framemaker 7.10
    System: windows xp sp3
    thanks in advance for your support .
    Message was edited by: Lu Steven

    Fire the error log off to the e-mail address indicated in the error message and then contact Adobe Support.

  • Use of boolean returning functions in a project

    Hello all gurus,
    in my project, we have a fairly important packaged functions that return boolean values. Working with these ones in pl/sql is very fine. But sometimes we need to reuse these functions in SQL, but no luck because bools are usable under pl/sql only and can't interact in any way in SQL statements. So the workaround should be to use these functions to return us some Y/N or 1/0 to emulate boolean behavior in SQL statements.
    Here what i tested with not luck:
    -- not work
    select r.role, sys.diutil.bool_to_int(dbms_session.is_role_enabled(r.role)) as is_role_enabled
    from   dba_roles r;
    -- not work
    select r.role
    from   dba_roles r
    where  sys.diutil.bool_to_int(dbms_session.is_role_enabled(r.role)) = 1;
    -- not work
    select t1.id,
           bool_to_char(my_bool_func(t1.x, t1.y, ...)) as is_something
    from   t1;
    -- not work
    select t1.id,
           sys.diutil.bool_to_int(my_bool_func(t1.x, t1.y, ...)) as is_something
    from   t1;The odd wrapping trick as a last resort solution is working....
    -- Works! Seems the only way, but a lot of wrapping work...
    create or replace function my_bool_func_wrap(p_x number, p_y number, ...) return varchar2 as
    begin
       return bool_to_char(my_bool_func(p_x, p_y, ...));
    end;
    select t1.id,
           my_bool_func_wrap((t1.x, t1.y, ...)) as is_something
    from   t1;I read a lot, but no elegant and working way.
    Is there a more standard, elegant universal way to call bool functions from SQL?
    Is creating a custom type visible and usable from both pl/sql and sql, if possible, a way to go?
    Any other pointers?
    For new development, is it good to make my boolean type returning functions using SQL compatible type like CHAR (Y/N) or NUMBER (1/0) ? It will make us less wrapping job, but more and less elegant bool handling code on the pl/sql side.
    What is the goal to have bool only in pl/sql and not usable in SQL? It's kind of a feature incompatibility in the same product. Strange...
    Thanks a lot
    Bruno

    brlav wrote:
    Finally, I'll have to dump the BOOLEAN return type to all our boolean functions and return char instead. With this I will be able to call then from SQL.... From this perspective, BOOLEAN is useless.I would not say that. Let's assume that you implement boolean in SQL as a single byte character string containing either Y or N, enforce that with a constraint and also add a not-null constraint to it.
    You simply define two PL functions (not usable from SQL) that deals with the conversion. You use the one function to change boolean to char before hitting the SQL engine, and the other to convert char to boolean when getting data from the SQL engine.
    As I/O routines are modularised, it means that you need to deal with these conversions once only when writing and once only when reading (per module).
    Simple example:
    SQL> create or replace function to_bool( c varchar2 ) return boolean is
      2  begin                                                            
      3          return( c = 'Y' );                                       
      4  end;                                                             
      5  /                                                                
    Function created.
    SQL>
    SQL> create or replace function bool_to_char( b boolean ) return varchar2 is
      2  begin
      3          if b then
      4                  return( 'Y' );
      5          else
      6                  return( 'N' );
      7          end if;
      8  end;
      9  /
    Function created.
    SQL>
    SQL> declare
      2          i       integer;
      3          b       boolean;
      4          flag    all_tables.temporary%type;
      5          tab     all_tables%rowtype;
      6  begin
      7          flag := bool_to_char(true);  
      8          select count(*) into i from all_tables where temporary = flag;
      9
    10          select t.* into tab from all_tables t where rownum = 1;
    11          b := to_bool( tab.temporary );
    12  end;
    13  /
    PL/SQL procedure successfully completed.
    SQL>

  • How to use Essbase @RETURN function to displayed messages in 11.1.2.1

    Hi,
    I found Business Rule support Essbase @RETURN function in Hyperion Planning 11.1.2.1 new feature.
    If I create a simple BR for planning app as below:
    "@RETURN("test return message" , WARNING);"
    The validation returns error and BR can not be deployed.
    Does any one how to use @RETURN function in BR?
    Thanks!

    Hi,
    From Essbase Technical Reference Guide: http://download.oracle.com/docs/cd/E17236_01/epm.1112/esb_tech_ref/frameset.htm?launch.html
    Example+
    The following example stops the calculation and returns a custom warning message if maximum values specified in the IF statement are empty:+
    FIX("Actual")
    . "Profit"(
    IF( ("Marketing" < 0) OR ("Payroll" < 0) OR ("Misc" < 0) )
    @RETURN( @CONCATENATE(
    @CONCATENATE("The violation of data integrity : Market [", @NAME(@CURRMBR("Market"))),
    "] has a negative expenses. Calculations are interrupted")
    , WARNING);
    ELSE
    "Profit" = ("Margin" - "Total Expenses")*0.9;
    ENDIF
    ENDFIX
    Cheers,
    Alp

  • Urgent- returnable packaging issue

    Hi guys,
    am working on returnable packaging issue
    Scenario:If the customer does not returns the preslings then sales order is created for presling and issued to customers with proper invoicing
    am creating a sales order with order type CLN(customised for returnable packaging) and i have give material with qty 1, immediately the system is taking me to availability overview screen where it shows the following.
    Confirmed quantity: 0
    Dely proposal: Not possible.
    i have checked for material in MMBE and see the stock is much sufficient. y am i getting this? please answer immediately.
    thanks in advance.
    kumar.

    Hi pathik,
    the system is already configured and i have to give UAT to the users. i have done according to what UAT says. now plz suggest me what i should i do in this scenario? moreover, shld i use two line items i mean the main item and also the sub item? this is the first time am working on returnable packating so plz help me in as detail as possible.
    u can also plz send me the doc with screen shots(if possible) to this id
    [email protected]
    thanks in advance.
    kumar

  • Returning material issue

    Hi,
    I have configured standar process for material issues with services rule also, but I need to know the standar process
    in order to returning material (issue by mistake for example).
    There is an indicator in report NMCOL where it suppose used to bring canceled consumptions, but where do we
    cancel consumptions? (standar only please).
    Best regards.

    Hello Milasanz,
    To be able to reverse/cancel a material consumption in IS-H, an appropriate good issue must be reversed/canceled. To cancel a good issue you must use, for example, the following MM t-code: MBST - Cancel/Reverse. It is the logic, BUT actually once you cancel a good issue, a system still issues an error message when you try to cancel a material consumption (it is wrong behavior of SAP). We've written to SAP about the mistake.
    To cancel a material consumption, you must use t-code NMMC1.
    Regards,
    Alexander.

  • Functional Issues w/ IOS7

    Depending on how this discussion board works, I will attempt to update functional issues with this operating system.
    9/21/13: Alarm:  Setting the alarm is rather akward, the numbers are too rigid, fine, and small.  I feel the numbers being larger would be more user friendly.
    9/21/13 Calendar:  Previous version was superior in certain ways.  Shading out a part of the day which you typically don't use (ex:  1am-5:30am) would be great.  I feel lost in this update, it does not feel refined.  Please allow me to send an appointment through imessage already as well!

    Tell Apple.
    http://www.apple.com/feedback/iphone.html

  • Forum for functional issue

    Hi All!
    Is there any forum related to functional issues in SD and MM.Please do forward me the names if there are any.
    Regards
    Pavan

    Check these
    http://www.sapfans.com/
    http://www.erpfans.com/
    http://www.sap.com/community/default.epx?logonStatusCheck=0 (Login required)
    Regards,
    Vikas Madaan

  • SGD 4.5 Desktop Functionality Issue

    I've come across an odd functionality issue on SGD 4.5. When I start "My Desktop" everything works fine. However if I start a new Full JDS Desktop session on another server, the JDS session doesn't appear to load correctly. New windows automatically open in the upper left corner and can't be moved. If I close both JDS Desktop sessions and open the other system first, then "My Desktop" session doesn't open windows properly. Has anyone come across this? It's not to big of deal right now, but it might become more of an issue when more users start using our SGD instance.
    Adam

    @JRoesler :
    The script for installing the users during installation when the users are not created is included some version before the 4.50.907
    The SGD version here is only 1 minor version before the latest release.
    @aspenhedge:
    If I look into the rpm (for Linux install) I don't see a check for a valid shell. It does however try to 'su' into those accounts. I might be wrong in this one.
    Can you manually use 'su ttaserv' and 'su ttasys' without any problem? Do these users have a valid home-dir for example.
    - Remold

  • Function issue:  inconsistent datatypes?

    Hi all.
    I'm having an issue with a function that converts coordinates to a spatial data type.
    My database version is:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
    PL/SQL Release 11.2.0.2.0 - Production
    CORE     11.2.0.2.0     Production
    TNS for Linux: Version 11.2.0.2.0 - Production
    NLSRTL Version 11.2.0.2.0 - Production
    Here's my package that I'm using
    create or replace package make_geometry
    as
                function get_geometry_from_coords (p_coords in clob  )
              return sdo_geometry;
    end;
    create or replace package body make_geometry
    as
              function get_geometry_from_coords (p_coords in clob)
              return sdo_geometry
              is
                 v_geometry sdo_geometry;
              begin
                 --with t as (select p_coords coords from dual)
              select MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1)
                                  ,cast(multiset(
                                      select ordset
                                     from (
                                            select regexp_substr( regexp_replace(
                                                                                replace(p_coords,chr(10))
                                                                                 ,' {1,}',',')
                                                                  ,'[^,]+',1,level)  ordset
                                                  ,rownum rn
                                              from dual
                                                               connect by level <= length(regexp_replace(regexp_replace(
                                                                                                   replace(p_coords,chr(10))
                                                                                                   ,' {1,}',','),'[^,]+')) + 1
                                            where mod(rn,3) <> 0
                        ) as sdo_ordinate_array))
                  into v_geometry
                  from dual;
                  return v_geometry;
              end;
    end;
    /basically, it takes a list of coordinates, in the following format:
    with t as (select '130.88214073599997,-12.377589935499998,0 130.88189276799997,-12.378437734999997,0 130.88164895999998,-12.379271400499997,0 ' coords from dual)replaces the spaces with commas and splits the resultant string by comma, then removes the third coordinate in each set (sets delimited by spaces in above example) and converts the result to sdo_geometry type.
    This logic is not where my problem is occurring
    If I run the query found in the package separately, it works fine:
    SQL> with t as (select '130.88214073599997,-12.377589935499998,0 130.88189276799997,-12.378437734999997,0 130.88164895999998,
    -12.379271400499997,0 ' coords from dual)
      2            select MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1)
      3                                ,cast(multiset(
      4                                    select ordset
      5                                   from (
      6                                          select regexp_substr( regexp_replace(
      7                                                                              replace(coords,chr(10))
      8                                                                               ,' {1,}',',')
      9                                                                ,'[^,]+',1,level)  ordset
    10                                                ,rownum rn
    11                                            from t
    12                                                             connect by level <= length(regexp_replace(regexp_replace(
    13                                                                                                 replace(coords,chr(10))
    14                                                                                                 ,' {1,}',','),'[^,]+')) +
    1
    15                                                               )
    16                                          where mod(rn,3) <> 0
    17                      ) as sdo_ordinate_array))
    18                from dual;
    MDSYS.SDO_GEOMETRY(2003,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1),CAST(MULTISET(SELECTORDSETFROM(SELECTREGEXP_SUBSTR(REGE
    XP_REPL
    SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(130.882141, -12.37759, 130.881893, -12.378
    438, 13
    0.881649, -12.379271, NULL))but if I call the function:
    SQL> with t as (select '130.88214073599997,-12.377589935499998,0 130.88189276799997,-12.378
    -12.379271400499997,0 ' coords from dual)
      2  select make_geometry.get_geometry_from_coords(coords)
      3    from t;
    select make_geometry.get_geometry_from_coords(coords)
    ERROR at line 2:
    ORA-00932: inconsistent datatypes: expected NUMBER got CLOB
    ORA-06512: at "HR.MAKE_GEOMETRY", line 13If I change the package to expect varchar2 the above example coordinate list works fine, but obviously that doesn't work when the coordinate list exceeds 4000 characters.
    any thoughts?

    not sure that is the problem:
    SQL> create table foo (mr_clob clob);
    Table created.
    SQL>
    SQL> insert into foo values ('testing'||chr(10)||'testing');
    1 row created.
    SQL>
    SQL> select replace(mr_clob,chr(10),'blah') from foo;
    REPLACE(MR_CLOB,CHR(10),'BLAH')
    testingblahtesting
    1 row selected.

  • Keyboard Functionality Issues in Finder (Mac OS X 10.5.4)

    I've recently begun to experience loss of the functionality of my keyboard in Finder on my personal laptop and work computer whenever I have a Wacom tablet plugged in. Restarting and unplugging the tablet sometimes works, but only after the 2-3 try.
    Basically, the modifier keys and Function keys continue to work and the middle portion of keyboard fails to respond whenever I try to type a letter or use the spacebar. For example, when I attempt to create a folder it's first untitled. Whenever I try to rename the folder I can highlight the text, I just can't rename the folder. The keys appropriate keys don't work. Now if I use a web browser (Safari 3.1.2) or any other application other than Finder the keyboard functionality returns. I am able to type and use the spacebar, as well as use the other keys. It's as if nothing is wrong.
    Has anyone else experienced this issue?
    I recently started to experience it on my work computer and wondered if it had something to do with a Wacom tablet being connected. It seemed whenever I left the tablet unplugged and restarted my Mac everything was normal. Only when the tablet is plugged in does the keyboard functionality loss bother me.
    Thanks to any who can help.

    Did ever you try the "Relaunch Finder" option in the force quit menu?

  • Enable data paging with parameters count() on new php function issue (BUG?)

    I've got my app prototyped quickly with the default settings in Flex Builder 4.  Now I'm going back and adding/modifying features to polish the app off.
    For this application I'm using PHP5 as the server side.
    The data paging is really cool and simple to call using the default settings.  However, I'm running into issues with customizing the data paging feature.
    This is the default header of the php function that was created for me:
    public function getTblbrowserrecord_paged($startIndex, $numItems){...}
    Instead of dumping all data back to the function I want to be able to search on certain fields so I created a new function called:
    getTblbrowserrecord_search_paged ($szName, $szIP, $szRule, $szURL, $szDateLow, $szDateHigh, $szCode, $startIndex, $numItems  ) {...}
    The new function is tested and operates as designed.
    I set the input types of the variables and return type (Tblbrowserrecord[]) of the new function then went to enable data paging.  The first screen came up and asked me for the key to use which I selected.  The next screen came up and asked me for the number of records which I set to 100 then went to select the count operation.
    I initially selected the automatically created count() function but it came up with the error " Count operation parameters should match the paged operation parameters list."
    So I created another function to match the search function's parameter's list:
    public function count_searched($szName, $szIP, $szRule, $szURL, $szDateLow, $szDateHigh, $szCode, $startIndex, $numItems)  {...}
    But I still ge the error "Count operation parameters should match the paged operation parameters list."
    But they DO match.  I looked at the default functions that were created by FB4 and noticed that the automatically generated function count() has no parameters and the paged function has the two functions $startIndex and $numItems which are not identical yet they work.  I tried removing those two fields from the count function but got the same results.
    What am I doing wrong?
    Thanks!

    Nevermind... For some reason my FB4 is not updating correctly.  After removing the two control fields at the end of the list AND exiting the app/re-entering everything worked ok.  I've been having this issue a lot lately and am thinking that is is a bug of some sort?

  • Function issue in oracle 8i (817)

    Hello,
    Following objects are created in database
    1.     CREATE OR REPLACE TYPE PARAMETER_OBJ AS OBJECT
         RUN                VARCHAR2(2000),
         BATCH_NO                VARCHAR2(2000),
         DAY_NO                VARCHAR2(2000),
         PARAMETER_NAME      VARCHAR2(2000),
         PARAMETER_VALUE      VARCHAR2(2000),
         PARAMETER_UOM           VARCHAR2(2000)
    2.     CREATE OR REPLACE TYPE PARAMETER_TYP AS TABLE OF PARAMETER_OBJ ;
    Info abt the function
    1. function return type is PARAMETER_TYP.
    2. Inside the function i initialize tblParameters PARAMETER_TYP:=PARAMETER_TYP();
    3. Create a temporary table[TMP_PARAMETER] .The structure of the table is same as "PARAMETER_OBJ"
    4. In a loop Insert data into temporary table
    5. At the end issue following select statement
              SELECT CAST (MULTISET (SELECT * FROM TMP_PARAMETER)
    AS PARAMETER_TYP )
    INTO tblParameters FROM DUAL;
    6. issue commit (which flushes temp table)
    7. return RETURN tblParameters
    Finally issue following sql statement to get data from the function
    select * from table(T_Get_ParameterValue('A03052','-1-SPINNER-CELL_AGE-15L,3-SPINNER-DOUBLING_TIME-15L'))
    It works oracle 10g. In oracle 817 function compiles.But if i select as shown above it gives erorr says nested table not found..
    Can any body help me.

    1. CREATE OR REPLACE TYPE PARAMETER_OBJ AS OBJECT
    RUN VARCHAR2(2000),
    BATCH_NO VARCHAR2(2000),
    DAY_NO VARCHAR2(2000),
    PARAMETER_NAME VARCHAR2(2000),
    PARAMETER_VALUE VARCHAR2(2000),
    PARAMETER_UOM VARCHAR2(2000)
    2. CREATE OR REPLACE TYPE PARAMETER_TYP AS TABLE OF PARAMETER_OBJ ;
    # Code
    CREATE OR REPLACE Function T_Get_ParameterValue
    a_run CLOB,
    a_dytblcoleqp CLOB
    -- [T]: TO_REMOVE: Changed return type.
    -- 1. Need to create a temporary table TMP_PARAMETER which has the same structure as your object.
    --RETURN PARAMETER_TYP PIPELINED
    RETURN PARAMETER_TYP
    AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    TYPE cursor_type IS REF CURSOR;
    TYPE STR_LST IS TABLE OF VARCHAR2(2000) INDEX BY BINARY_INTEGER;
    l_sql varchar2(4000);
    l_cr cursor_type;
    -- [T]: TO_REMOVE: Added variable.
    tblParameters PARAMETER_TYP:=PARAMETER_TYP();
    l_batch_lst STR_LST;
    l_tblcl_lst STR_LST;
    l_tbl_lst STR_LST;
    l_col_lst STR_LST;
    l_day_lst STR_LST;
    l_sign_lst STR_LST;
    l_eqp_lst STR_LST;
    l_con CLOB;
    l_tmp varchar2(4000);--Tmp store
    l_pos number:=0; -- LOcator of the seperaotr
    s_pos number:=0; -- start position
    l_k number:=0; -- Array controller
    l_n number:=0; -- Array controller
    f_sp varchar2(1):=','; -- First seperator
    s_sp varchar2(1):='-'; -- Second seperator
    l_col_desc varchar2(2000);
    l_column_type varchar2(2000);
    l_capture_date varchar2(2000);
    -- ipc list
    l_parameter_uom varchar2(2000);
    l_action_limit_max varchar2(2000);
    l_action_limit_min varchar2(2000);
    l_control_limit_max varchar2(2000);
    l_control_limit_min varchar2(2000);
    l_center_line varchar2(2000);
    l_parameter_value varchar2(2000);
    l_batch_id varchar2(2000);
    l_batch_no varchar2(2000);
    l_day_no varchar2(2000);
    l_eqp varchar2(2000);
    l_date date;
    -- Loop Control
    l_cont number;
    i number;
    --remove
    l_sqlerm varchar2(2000);
    BEGIN
    l_pos:=0; -- LOcator of the seperaotr
    -- Parsing
    -- Parsing the tbl and col list
    s_pos:=1;
    l_cont:=1; -- loop control
    i:=0; -- loop control
    while (l_cont=1) loop
    i:=i+1;
    l_k:=l_k+1;
    --determine position
    l_pos:=instr(a_dytblcoleqp,f_sp,1,i);
    if l_pos=0 and i=1 then -- no need to parse ,only 1 record
    l_tmp:=a_dytblcoleqp;
    l_tblcl_lst(l_k):=l_tmp;
    --exit;
    l_cont:=0;
    elsif l_pos=0 and i!=1 then
    l_tmp:=substr(a_dytblcoleqp,s_pos);
    l_tblcl_lst(l_k):=l_tmp;
    l_k:=l_k-1; re caluclate. nothing else to parse
    --exit;
    l_cont:=0;
    else -- continue parse
    l_tmp:=substr(a_dytblcoleqp,s_pos,l_pos-s_pos);
    l_tblcl_lst(l_k):=l_tmp;
    s_pos:=l_pos+1;
    end if;
    end loop; -- end of while loop
    for j in 1..l_k loop
    -- validate sign
    if substr(l_tblcl_lst(j),1,1)='-' then
    l_tblcl_lst(j):=substr(l_tblcl_lst(j),2);
    l_sign_lst(j):='-';
    else
    l_sign_lst(j):='';
    end if;
    l_day_lst(j):=substr(l_tblcl_lst(j),1,instr(l_tblcl_lst(j),s_sp,1,1)-1);
    l_day_lst(j):=l_sign_lst(j)||l_day_lst(j);
    l_tbl_lst(j):=substr(l_tblcl_lst(j),instr(l_tblcl_lst(j),s_sp,1,1)+1,instr(l_tblcl_lst(j),s_sp,1,2)-instr(l_tblcl_lst(j),s_sp,1,1)-1);
    l_col_lst(j):=substr(l_tblcl_lst(j),instr(l_tblcl_lst(j),s_sp,1,2)+1,instr(l_tblcl_lst(j),s_sp,1,3)-instr(l_tblcl_lst(j),s_sp,1,2)-1);
    l_eqp_lst(j):=substr(l_tblcl_lst(j),(instr(l_tblcl_lst(j),s_sp,1,3)+1));
    end loop;
    -- Parsing Batch List
    s_pos:=1;
    l_cont:=1; -- loop control
    i:=0; -- loop control
    while (l_cont=1) loop
    i:=i+1;
    l_n:=l_n+1;
    --determine position
    l_pos:=instr(a_run,f_sp,1,i);
    if l_pos=0 and i=1 then -- no need to parse ,only 1 record
    l_tmp:=a_run;
    l_batch_lst(l_n):=l_tmp;
    l_cont:=0;--exit while loop
    elsif l_pos=0 and i!=1 then
    l_tmp:=substr(a_run,s_pos);
    l_batch_lst(l_n):=l_tmp;
    l_cont:=0;--exit while loop
    else -- continue parse
    l_tmp:=substr(a_run,s_pos,l_pos-s_pos);
    l_batch_lst(l_n):=l_tmp;
    s_pos:=l_pos+1;
    end if;
    end loop;
    --- end of Parsing
    -- Build con catenate list
    for k in 1..l_n loop
    --l_con:=NULL;
    --l_con:='('; 
    --l_con:=l_con||''''||l_batch_lst(k)||''')';
    --dbms_output.put_line(l_con);
    for j in 1..l_k loop
    -- 1 -- Get col desc
    begin
    select COLUMN_DESCR,COLUMN_TYPE,CAPTURE_DATE
    into l_col_desc,l_column_type,l_capture_date
    from MDM_ALL_PARAMETER_LIST
    where table_name=upper(l_tbl_lst(j))
    and column_name=upper(l_col_lst(j));
    exception
    when others then
    l_col_desc:=NULL;
    l_column_type:=NULL;
    l_capture_date:=NULL;
    end;
    --dbms_output.put_line(l_batch_lst(k)||'-'||l_tbl_lst(j)||'-'||l_col_lst(j)||'-'||l_col_desc||'-'||to_char(l_capture_date));
    --Build Sql Statement  
    if l_tbl_lst(j)='THAW' then
    l_sql:=NULL;
    l_sql:='select distinct spinner.BATCH_ID as batch_id,thaw.BIN_NO as bin_no,ipc.DAY_NO as day_no,NULL as eqp,ipc.PARAMETER_UOM as parameter_uom ,ipc.IPC_ACTION_LIMIT_MAX as ipc_action_limit_max,ipc.IPC_ACTION_LIMIT_MIN as ipc_action_limit_min,ipc.IPC_CONTROL_LIMIT_MAX as ipc_control_limit_max,ipc.IPC_CONTROL_LIMIT_MIN as ipc_control_limit_min,ipc.CENTER_LINE as center_line,thaw.'||l_col_lst(j)||','||l_capture_date;
    l_sql:=l_sql||' from SPINNER spinner, BIN_HIER bin_hier, THAW thaw,IPC_LIMITS ipc';
    l_sql:=l_sql||' where spinner.bin_no = bin_hier.bin_no';
    l_sql:=l_sql||' and bin_hier.PROCESS_STEP =30';
    l_sql:=l_sql||' and bin_hier.Revival_no = thaw.Revival_no';
    l_sql:=l_sql||' and spinner.bin_no=ipc.LOT(+)';
    l_sql:=l_sql||' and spinner.BATCH_ID=ipc.BATCH_ID(+)';
    l_sql:=l_sql||' and spinner.BATCH_ID=:1';
    l_sql:=l_sql||' and ipc.TABLE_NAME(+)=:2';
    l_sql:=l_sql||' and ipc.COLUMN_NAME(+)=:3';
    l_sql:=l_sql||' and ipc.SITE_ID(+)=:4';
    --dbms_output.put_line(l_sql);
    elsif l_tbl_lst(j)='THAW_SAMPLES' then
    if l_col_lst(j)!='CALC' then
    l_sql:=NULL;
    l_sql:='select distinct spinner.BATCH_ID as batch_id,thaw_samples.BIN_NO as bin_no,thaw_samples.DAY_NO as day_no,NULL as eqp,ipc.PARAMETER_UOM as parameter_uom ,ipc.IPC_ACTION_LIMIT_MAX as ipc_action_limit_max,ipc.IPC_ACTION_LIMIT_MIN as ipc_action_limit_min,ipc.IPC_CONTROL_LIMIT_MAX as ipc_control_limit_max,ipc.IPC_CONTROL_LIMIT_MIN as ipc_control_limit_min,ipc.CENTER_LINE as center_line,thaw_samples.'||l_col_lst(j)||',thaw_samples.'||l_capture_date;
    else
    l_sql:=NULL;
    --l_sql:='select spinner.BATCH_ID as batch_id,thaw_samples.BIN_NO  as bin_no,thaw_samples.DAY_NO as day_no,NULL as eqp,ipc.PARAMETER_UOM as parameter_uom ,ipc.IPC_ACTION_LIMIT_MAX as ipc_action_limit_max,ipc.IPC_ACTION_LIMIT_MIN as ipc_action_limit_min,ipc.IPC_CONTROL_LIMIT_MAX as ipc_control_limit_max,ipc.IPC_CONTROL_LIMIT_MIN as ipc_control_limit_min,ipc.CENTER_LINE as center_line,null as Parameter_value,thaw_samples.'||l_capture_date;          
    l_sql:='select distinct spinner.BATCH_ID as batch_id,thaw_samples.BIN_NO as bin_no,thaw_samples.DAY_NO as day_no,NULL as eqp,ipc.PARAMETER_UOM as parameter_uom ,ipc.IPC_ACTION_LIMIT_MAX as ipc_action_limit_max,ipc.IPC_ACTION_LIMIT_MIN as ipc_action_limit_min,ipc.IPC_CONTROL_LIMIT_MAX as ipc_control_limit_max,ipc.IPC_CONTROL_LIMIT_MIN as ipc_control_limit_min,ipc.CENTER_LINE as center_line,Get_IPC_Parameter_Value('''||l_tbl_lst(j)||''''||','||''''||l_col_lst(j)||''',spinner.BATCH_ID,thaw_samples.BIN_NO,thaw_samples.DAY_NO),thaw_samples.'||l_capture_date;
    end if;
    l_sql:=l_sql||' from SPINNER spinner, BIN_HIER bin_hier, THAW thaw,THAW_SAMPLES thaw_samples,IPC_LIMITS ipc';
    l_sql:=l_sql||' where spinner.bin_no = bin_hier.bin_no';
    l_sql:=l_sql||' and bin_hier.PROCESS_STEP =30';
    l_sql:=l_sql||' and bin_hier.Revival_no = thaw.Revival_no';
    l_sql:=l_sql||' and thaw_samples.bin_no=thaw.bin_no';
    l_sql:=l_sql||' and spinner.bin_no=ipc.LOT(+)';
    l_sql:=l_sql||' and spinner.BATCH_ID=ipc.BATCH_ID(+)';
    l_sql:=l_sql||' and spinner.BATCH_ID=:1';
    l_sql:=l_sql||' and ipc.TABLE_NAME(+)=:2';
    l_sql:=l_sql||' and ipc.COLUMN_NAME(+)=:3';
    l_sql:=l_sql||' and ipc.SITE_ID(+)=:4';
    l_sql:=l_sql||' and ipc.day_no(+)=:5';
    l_sql:=l_sql||' and thaw_samples.day_no=:6';
    elsif l_tbl_lst(j) in ('F1250L_TEST','F200L_TEST','F4000L_TEST','F8000L_TEST') then
    l_sql:=NULL;
    l_sql:='select t.batch_id,t.bin_no,t.DAY_NO as day_no,NULL as eqp,ipc.PARAMETER_UOM as parameter_uom ,ipc.IPC_ACTION_LIMIT_MAX as ipc_action_limit_max,ipc.IPC_ACTION_LIMIT_MIN as ipc_action_limit_min,ipc.IPC_CONTROL_LIMIT_MAX as ipc_control_limit_max,ipc.IPC_CONTROL_LIMIT_MIN as ipc_control_limit_min,ipc.CENTER_LINE as center_line,t.'|| l_col_lst(j)||',t.'||l_capture_date;
    l_sql:=l_sql||' from '||l_tbl_lst(j)||' t,IPC_LIMITS ipc ';
    l_sql:=l_sql||' where 1=1';
    l_sql:=l_sql||' and t.BATCH_ID=ipc.BATCH_ID(+)';
    l_sql:=l_sql||' and t.BIN_NO=ipc.LOT(+)';
    l_sql:=l_sql||' and t.day_no=ipc.day_no(+)';
    l_sql:=l_sql||' and t.batch_id=:1';
    l_sql:=l_sql||' and ipc.TABLE_NAME(+)=:2';
    l_sql:=l_sql||' and ipc.COLUMN_NAME(+)=:3';
    l_sql:=l_sql||' and ipc.SITE_ID(+)=:4';
    l_sql:=l_sql||' and t.day_no=:5';
    elsif l_tbl_lst(j) in ('SPINNER_SAMPLES') then
    l_sql:=NULL;
    l_sql:='select smp.batch_id,smp.bin_no,smp.DAY_NO as day_no,spn.src_vessel_id as eqp,ipc.PARAMETER_UOM as parameter_uom ,ipc.IPC_ACTION_LIMIT_MAX as ipc_action_limit_max,ipc.IPC_ACTION_LIMIT_MIN as ipc_action_limit_min,ipc.IPC_CONTROL_LIMIT_MAX as ipc_control_limit_max,ipc.IPC_CONTROL_LIMIT_MIN as ipc_control_limit_min,ipc.CENTER_LINE as center_line,smp.'|| l_col_lst(j)||',smp.'||l_capture_date;
    l_sql:=l_sql||' from SPINNER spn , SPINNER_SAMPLES smp,IPC_LIMITS ipc ';
    l_sql:=l_sql||' where 1=1';
    l_sql:=l_sql||' and spn.bin_no=smp.bin_no';
    l_sql:=l_sql||' and smp.BATCH_ID=ipc.BATCH_ID(+)';
    l_sql:=l_sql||' and smp.DAY_NO=ipc.DAY_NO(+)';
    l_sql:=l_sql||' and smp.BIN_NO=ipc.LOT(+)';
    l_sql:=l_sql||' and smp.batch_id=:1';
    l_sql:=l_sql||' and ipc.TABLE_NAME(+)=:2';
    l_sql:=l_sql||' and ipc.COLUMN_NAME(+)=:3';
    l_sql:=l_sql||' and ipc.SITE_ID(+)=:4';
    l_sql:=l_sql||' and smp.DAY_NO(+)=:5';
    l_sql:=l_sql||' and upper(trim(replace(spn.src_vessel_id,'' '')))=:6';
    elsif l_tbl_lst(j) in ('SPINNER') then
    l_sql:=NULL;
    l_sql:='select t.batch_id,t.bin_no,null as day_no,t.src_vessel_id as eqp,ipc.PARAMETER_UOM as parameter_uom ,ipc.IPC_ACTION_LIMIT_MAX as ipc_action_limit_max,ipc.IPC_ACTION_LIMIT_MIN as ipc_action_limit_min,ipc.IPC_CONTROL_LIMIT_MAX as ipc_control_limit_max,ipc.IPC_CONTROL_LIMIT_MIN as ipc_control_limit_min,ipc.CENTER_LINE as center_line,t.'|| l_col_lst(j)||',t.'||l_capture_date;
    l_sql:=l_sql||' from '||l_tbl_lst(j)||' t,IPC_LIMITS ipc ';
    l_sql:=l_sql||' where 1=1';
    l_sql:=l_sql||' and t.BATCH_ID=ipc.BATCH_ID(+)';
    l_sql:=l_sql||' and t.BIN_NO=ipc.LOT(+)';
    l_sql:=l_sql||' and t.batch_id=:1';
    l_sql:=l_sql||' and ipc.TABLE_NAME(+)=:2';
    l_sql:=l_sql||' and ipc.COLUMN_NAME(+)=:3';
    l_sql:=l_sql||' and ipc.SITE_ID(+)=:4';
    l_sql:=l_sql||' and upper(trim(replace(t.src_vessel_id,'' '')))=:5';
    else
    -- rest
    l_sql:=NULL;
    l_sql:='select t.batch_id,t.bin_no,ipc.DAY_NO as day_no,NULL as eqp,ipc.PARAMETER_UOM as parameter_uom ,ipc.IPC_ACTION_LIMIT_MAX as ipc_action_limit_max,ipc.IPC_ACTION_LIMIT_MIN as ipc_action_limit_min,ipc.IPC_CONTROL_LIMIT_MAX as ipc_control_limit_max,ipc.IPC_CONTROL_LIMIT_MIN as ipc_control_limit_min,ipc.CENTER_LINE as center_line,t.'|| l_col_lst(j)||',t.'||l_capture_date;
    l_sql:=l_sql||' from '||l_tbl_lst(j)||' t,IPC_LIMITS ipc ';
    l_sql:=l_sql||' where 1=1';
    l_sql:=l_sql||' and t.BATCH_ID=ipc.BATCH_ID(+)';
    l_sql:=l_sql||' and t.BIN_NO=ipc.LOT(+)';
    l_sql:=l_sql||' and t.batch_id=:1';
    l_sql:=l_sql||' and ipc.TABLE_NAME(+)=:2';
    l_sql:=l_sql||' and ipc.COLUMN_NAME(+)=:3';
    l_sql:=l_sql||' and ipc.SITE_ID(+)=:4';
    end if;
    -- Open the cursor and filled up object
    if l_tbl_lst(j)='THAW_SAMPLES' then
    open l_cr for l_sql using l_batch_lst(k),l_tbl_lst(j),l_col_lst(j),1,l_day_lst(j),l_day_lst(j);
    loop
    null;
    fetch l_cr into l_batch_id,l_batch_no,l_day_no,l_eqp,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_parameter_value,l_date;
    exit when l_cr%notfound;
    --PIPE ROW(PARAMETER_OBJ (l_batch_id,l_batch_no,l_day_no,l_col_desc,l_parameter_value,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_eqp,'1',l_tbl_lst(j),l_col_lst(j),l_date) );
    -- [T]: TO_REMOVE: Changed code to populate the temporary table.
    INSERT INTO TMP_PARAMETER VALUES (l_batch_id,l_batch_no,l_day_no,l_col_desc,l_parameter_value,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_eqp,'1',l_tbl_lst(j),l_col_lst(j),l_date);
    end loop;
    close l_cr;
    elsif l_tbl_lst(j) in ('SPINNER_SAMPLES') then
    open l_cr for l_sql using l_batch_lst(k),l_tbl_lst(j),l_col_lst(j),1,l_day_lst(j),l_eqp_lst(j);
    loop
    null;
    fetch l_cr into l_batch_id,l_batch_no,l_day_no,l_eqp,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_parameter_value,l_date;
    exit when l_cr%notfound;
    --PIPE ROW(PARAMETER_OBJ (l_batch_id,l_batch_no,l_day_no,l_col_desc,l_parameter_value,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_eqp,'1',l_tbl_lst(j),l_col_lst(j),l_date) );
    -- [T]: TO_REMOVE: Changed code to populate the temporary table.
    INSERT INTO TMP_PARAMETER VALUES (l_batch_id,l_batch_no,l_day_no,l_col_desc,l_parameter_value,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_eqp,'1',l_tbl_lst(j),l_col_lst(j),l_date);
    end loop;
    close l_cr;
    null;
    elsif l_tbl_lst(j) in ('SPINNER') then
    open l_cr for l_sql using l_batch_lst(k),l_tbl_lst(j),l_col_lst(j),1,l_eqp_lst(j);
    loop
    null;
    fetch l_cr into l_batch_id,l_batch_no,l_day_no,l_eqp,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_parameter_value,l_date;
    exit when l_cr%notfound;
    -- PIPE ROW(PARAMETER_OBJ (l_batch_id,l_batch_no,l_day_no,l_col_desc,l_parameter_value,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_eqp,'1',l_tbl_lst(j),l_col_lst(j),l_date) );
    -- [T]: TO_REMOVE: Changed code to populate the temporary table.
    INSERT INTO TMP_PARAMETER VALUES (l_batch_id,l_batch_no,l_day_no,l_col_desc,l_parameter_value,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_eqp,'1',l_tbl_lst(j),l_col_lst(j),l_date);
    end loop;
    close l_cr;
    elsif l_tbl_lst(j) in ('F1250L_TEST','F200L_TEST','F4000L_TEST','F8000L_TEST') then
    null;
    open l_cr for l_sql using l_batch_lst(k),l_tbl_lst(j),l_col_lst(j),1,l_day_lst(j);
    loop
    null;
    fetch l_cr into l_batch_id,l_batch_no,l_day_no,l_eqp,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_parameter_value,l_date;
    exit when l_cr%notfound;
    -- PIPE ROW(PARAMETER_OBJ (l_batch_id,l_batch_no,l_day_no,l_col_desc,l_parameter_value,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_eqp,'1',l_tbl_lst(j),l_col_lst(j),l_date) );
    -- [T]: TO_REMOVE: Changed code to populate the temporary table.
    INSERT INTO TMP_PARAMETER VALUES (l_batch_id,l_batch_no,l_day_no,l_col_desc,l_parameter_value,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_eqp,'1',l_tbl_lst(j),l_col_lst(j),l_date);
    end loop;
    close l_cr;
    else
    open l_cr for l_sql using l_batch_lst(k),l_tbl_lst(j),l_col_lst(j),1;
    loop
    null;
    fetch l_cr into l_batch_id,l_batch_no,l_day_no,l_eqp,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_parameter_value,l_date;
    exit when l_cr%notfound;
    -- PIPE ROW(PARAMETER_OBJ (l_batch_id,l_batch_no,l_day_no,l_col_desc,l_parameter_value,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_eqp,'1',l_tbl_lst(j),l_col_lst(j),l_date) );
    -- [T]: TO_REMOVE: Changed code to populate the temporary table.
    INSERT INTO TMP_PARAMETER VALUES (l_batch_id,l_batch_no,l_day_no,l_col_desc,l_parameter_value,l_parameter_uom,l_action_limit_max,l_action_limit_min,l_control_limit_max,l_control_limit_min,l_center_line,l_eqp,'1',l_tbl_lst(j),l_col_lst(j),l_date);
    end loop;
    close l_cr;
    null;
    end if;
    end loop;-- end of for loop for j in 1..l_k loop
    end loop; --end of for j in 1..l_n loop
    -- [T]: TO_REMOVE: Return the data from the temporary table into the table type.
    -- Return data into table type.
    SELECT CAST (MULTISET (SELECT * FROM TMP_PARAMETER)
    AS PARAMETER_TYP )
    INTO tblParameters FROM DUAL;
    -- [T]: TO_REMOVE: Added commit so that the data in the temporary table is deleted.
    COMMIT;
    -- [T]: TO_REMOVE: Return the table type.
    -- return ;
    RETURN tblParameters;
    EXCEPTION
    WHEN OTHERS THEN
    --l_sqlerm:=substr(sqlerrm,1,200);
    ROLLBACK;
    RAISE_APPLICATION_ERROR (-20001, SQLERRM);
    return NULL;
    END;
    # Select sql statement
    select *
    from table(T_Get_ParameterValue('A03052','-1-SPINNER-CELL_AGE-15L,3-SPINNER-DOUBLING_TIME-15L'))

  • AGO function issue

    Hello
    Im trying to use the AGO function in in my Column Formula to compare the difference between month to month. The formula is as follows:
    AGO("Fact - Revenue"."Revenue - DW","Period"."Period",1)
    ... but every time im getting the error message:
    Formula syntax is invalid.
    [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27037] Unresolved level: "Period"."Period". (HY000)
    SQL Issued: SELECT AGO("Fact - Revenue"."Revenue - DW","Period"."Period",1) FROM "LC ELT - Revenue and Margin"
    Not sure why this is. I have tried not inserting the 'time level' option which doesn't give me an error but does give me slightly incorrect results, just off the correct value.
    Has anyone experienced this before? If so, could you please let me know what you did to resolve it?

    The Ago syntax is
    Ago(<<Measure>>, <<Level>>, <<Number of Periods>>)
    I dont think "Period"."Period" is a level from time dimension.
    In your case valid Levels are
    - Year
    - Half
    - Quarter
    Pls mark as correct/helpful if helps
    Edited by: veeravalli on Nov 19, 2012 5:31 PM

Maybe you are looking for