Efficient way of calling DB functions in OBIEE

Hi All,
I am using version 11.1.1.5
In a particular requirement, I am calling a DB function to fetch a value based on certain inputs for a Column in the analysis. This Column serves as the Input to another column in the same analysis. This new column again becomes input to another column. In the final query generated, there will be 3 calls to the Db function.
Now, Just wanted to know if there is a better way of doing it.
I mean call the function once and have the  output stored in a variable and then use that as input to other columns..or something on that front.
Please advice.
Regards,
HPR

only one option use EVALUATE() expression in the report for calling DB function. In anlysis you can store value only in presentation variable which you can set only in the dashboard prompt so in answers not possible to store the value in variable.

Similar Messages

  • Is there a way to call a function with in the initializer of a ArrayCollection?

        Is there a way to call a function with in the initializer of a ArrayCollection?
    It won't let me do this:
    var ac:ArrayCollection = new ArrayCollection([
                        {childName:'addTrade',index:addTradeIndex },
                        {childName:'tradeList',dealsCanvas.getChildIndex(tradeList) }

    The correct syntax is
    var ac:ArrayCollection = new ArrayCollection([
                        {childName:'addTrade',index:addTradeIndex },
                        {childName:'tradeList',index:dealsCanvas.getChildIndex(tradeList) }

  • Best way to call a function in a generic class from a base class

    Hi,
    I have a generic class that works with subclasses of some other baseclass. When I construct the subclass, I call the constructor of the baseclass which I want to call a function in the generic class. e.g. suppose I have the following classes
    public class List<T extends BaseClass>
        newTCreated(T t)
    }

    Sorry, I pressed Tab and Enter last time when typing the code so I posted without meaning to
    Hi,
    I have a generic class that works with subclasses of some other baseclass. When I construct the subclass, I call the constructor of the baseclass which I want to call a function in the generic class. e.g. suppose I have the following classes
    public class List<T extends BaseClass>
        public void newTCreated(T t)
            // add the t to some internal list
        public T getT(int index)
            // get the object from the internal list
    public class BaseClass
        public BaseClass(List<?> list)
            list.newTCreated(this);
    public class SubClass extends BaseClass
        public SubClass(List<SubCass> list)
            super(list);
    }This doesn't compile because of the call to newTCreated in the BaseClass constructor because BaseClass is not necessarily of type T. Is there any way of checking when I call the newTCreated function that the BaseClass is actually of type SubClass? I could either add the call explicitly in each SubClass's constructor or have a function addToList in BaseClass that is called from the BaseClass constructor but overloaded in each subclass but both of those rely on future subclasses doing the same. Or I could change the newTCreated function to take an argument of type BaseClass and then cast it to type T but this doesn't give a compilation error, only a runtime exception.
    It seems like there should be solution but having only recently started writing Generic classes I can't find it. Thanks in advance for any help,
    Tom

  • Any way to call function from impdp except remap_data?

    HI Friends,
    I have a requirement of load prd data into stage by masking some sensitive columns.Iam using impdp of datapump utility to load data.iam using remap_data option to call mask functions.But remap_data option is supporting upto 10 columns.
    we have more than 20 columns to mask.
    is there any other way to call oracle function from impdp?
    eg:-
    impdp pa_data_sub/******@qdssih30 NETWORK_LINK=qdspih30 schemas=RESP remap_data=col1.mask,col2.mask,col3.mask... CONTENT=all table_exists_action=replace
    Please suggest me different options.
    Thanks,
    Venkat Vadlamudi

    No,
    I didn't realize that there was a limit of 10 for remap data. As a work-around, can you remap 10 of the columns during export, and then 10 during import? Not sure if you want to give someone a dumpfile with sensitive data in it. If you could, you could at least double the limitation to 20 rows.
    Dean

  • Issues with integrating Java script functions in OBIEE 11G

    Hello experts..
    I am trying to integrate some Javascript functions in my OBIEE 11G Dashboard..
    I have modified the original common.js file and renamed it as insight_common.js in the following directory (backed up the original file of course)
    OBIEE 11G Folder/user_projects/domains/bifoundation_domain/servers/bi_server1/tmp/_WL_user/analytics_11.1.1/7dezjl/war/res/b_mozilla/insight_common.js
    In my dashboard, I have a dashboard object as text component where I have checked 'Contains HTML Markup'. I have written the following code:
    hello
    <script src="/res/b_mozilla/insight_common.js" type="text/javascript"></script>
    <script type="text/javascript">
    sayHi();
    </script>
    However, when I launch the dashboard, it is not working.
    In the Google Chrome browser as I inspected the element to investigate the reason, I am getting the following error under 'console'
    Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost/res/b_mozilla/insight_common.js
    Uncaught ReferenceError: sayHi is not defined saw.dll:611
    It seems that OBIEE is not recognizing the new file that I made..
    Is there a way around this?
    Thanks

    Srini
    I don't have backgrounds in coding, so a lot of what I wrote came from my own researching...
    Now I have tried your latest suggestions again as the below:
    1.<script type="text/javascript" src="res/b_mozilla/insight_common.js">
    sayHi();
    </script>
    and
    2.
    <script type="text/javascript" src="res/test.js"></script> ----- in my case: <script type="text/javascript" src="res/b_mozilla/is_common,js"></script>
    Now both codes this time do not yield any outputs when launching the dashboard. The section is blank and the preview of the Text section in the dashboard is blank as well..
    So, are you sure these are all the steps I need to take to call javascript function in OBIEE?
    Do I need to define anything in weblogic or other places?
    I hope I am not missing any steps..
    Thanks and let me know..

  • Calling a function in another class that is not the App delegate nor a sngl

    Hi all-
    OK- I have searched and read and searched, however I cannot figure out an easy way to call a function in another class if that class is not the app delegate (I have that down) nor a singleton (done that also- but too much code)
    If you use the method Rick posted:
    MainView *myMainView = [[MainView alloc] init];
    [MyMainView goTell];
    That works, however myMainView is a second instance of the class MainView- I want to talk to the instance/Class already instantiated.
    Is there a way to do that without making the class a singleton?
    Thanks!

    I had some trouble wrapping my head around this stuff at first too.
    I've gotten pretty good at letting my objects communicate with one another, however I don't think my method is the most efficient or organized way but I'll try to explain the basic idea.
    When you want a class to be able to talk to another class that's initialized elsewhere, the class your making should just have a pointer in it to the class you want to communicate with. Then at some point (during your init function for example) you should set the pointer to the class you're trying to message.
    for example in the app-delegate assume you have an instance of a MainView class
    and the app-delegate also makes an instance of a class called WorkClass
    If you want WorkClass to know about MainView just give it a pointer of MainView and set it when it's instantiated.
    So WorkClass might be defined something like this
    //WorkClass.h
    @import "MainView.h"
    @interface WorkClass : NSObject
    MainView *myPointerToTheMainView;
    @property (retain) myPointerToTheMainView;
    -(void)tellMainViewHello;
    @end
    //WorkClass.m
    @import "WorkClass.h"
    @implementation WorkClass
    @synthesize myPointerToTheMainView;//this makes getter and setter functions for
    //the pointer and allows us to use the dot
    //syntax to refrence it.
    -(void)tellMainViewHello
    [myPointerToTheMainView hello]; //sends a message to the main view
    //assume the class MainView has defined a
    //method -(void)hello
    @end
    now somewhere in the app delegate you would make the WorkClass instance and pass it a reference to the MainView class so that WorkClass would be able to call it's say hello method, and have the method go where you want (to the single instance of MainView owned by the app-delegate)
    ex:
    //somewhere in app-delegate's initialization
    //assume MainView *theMainView exists and is instantiated.
    WorkClass *myWorkClass = [[WorkClass alloc] init];
    myWorkClass.myPointerToTheMainView = theMainView; //now myWorkClass can speak with
    // the main view through it's
    // reference to it
    I hope that gets the basic idea across.
    I'm pretty new to Obj-c myself so if I made any mistakes or if anyone has a better way to go about this please feel free to add
    Message was edited by: kodafox

  • Call a function at a specific time

    I am working on a large java project, and i need a way to call a function at a specific time(midnight of every night). How can i do this?

    I am working on a large java project, and i need a
    way to call a function at a specific time(midnight of
    every night). How can i do this?If your JVM is running all the time, use a [url http://java.sun.com/j2se/1.5.0/docs/api/java/util/Timer.html]java.util.Timer. Otherwise, it's an OS thing. You'll have to set up a cron job of some kind.

  • Calling another function if upate statement fails

    Hi there,
    I have written an update procedure and insert procedure. Is there a way of calling another function if the update statement fails? Thanks a lot for your help.
    Chris
    procedure update_costing(in_period in DATE,
                   in_project_id IN VARCHAR2,
                   in_user_id IN VARCHAR2,
                   in_thu IN VARCHAR2,
                   in_fri IN VARCHAR2,
                   in_sat IN VARCHAR2,
                   in_sun IN VARCHAR2,
                   in_mon IN VARCHAR2,
                   in_tue IN VARCHAR2,
                   in_wed IN VARCHAR2)
         UPDATE TBL_COSTING
              SET
                   HOURS_THU = to_date (in_thu, 'HH24:MI'),
                   HOURS_FRI = to_date (in_fri, 'HH24:MI'),
                   HOURS_SAT = to_date (in_sat, 'HH24:MI'),
                   HOURS_SUN = to_date (in_sun, 'HH24:MI'),
                   HOURS_MON = to_date (in_mon, 'HH24:MI'),
                   HOURS_TUE = to_date (in_tue, 'HH24:MI'),
                   HOURS_WED = to_date (in_wed, 'HH24:MI'),
                   WHERE PERIOD = in_period
         AND PROJECT_ID = in_project_id
         AND USER_ID = in_user_id;
    EXCEPTION
    --CALLL HERE THE INSERT FUNCTION WITH SAME DATAMEMBERS
    SOMETHING LIKE THIS---
    WHEN others then
         insert_costing(in_period, in_project_id, in_user_id ,in_thu,in_fri,in_sat,in_sun,in_mon,in_tue,in_wed ,in_submit);
    COMMIT;
    END update_costing;

    begin
    UPDATE statement
    IF SQL%ROWCOUNT =0
    then
    INSERT statement|procedure
    end if;
    end;
    /Hi,
    i have a simple doubt over here, i read somewhere that cursor attributes can be used only as long as the cursor is open, then in the above case whiel doing the update operation, oracle implicitly will open an cursor and will do the operation and then will close the cursor, then how does SQL%ROWcount works???please revert...
    cheere

  • Can i call a function module of SAP?

    Hi, i have a question... Can i call a function module of SAP... I need print a document from a device, can i call the function module of SAP in order that me it prints it?
    Thanks,

    Hi Victor,
    you can use the GenericSync Example of the MDK. This calls the Module to verify the user directly. Generic Sync is exactly for that purpose: call a BADI directly and no usage of SyncBO. Be aware, that you - out of the box- sync your app data as well at that moment, because a sync runs both - generic and smartsync. Even worse: even when you have nothing to sync in Generic Sync - so nothing to print - it will call the function module for generic sync as long as it is registered.
    Well,  anyway, this is the way to call a function module separate.
    If it works with you rparticular print module? I have no idea, but if this is a normal function module - well, it should be ok.
    Hope this helps.
    Regards,
    Oliver

  • Unable to call local function in select statement.

    Hi all,
    I am unable to call the local function in select statement in below scenario.
    DECLARE
    l_cnt NUMBER;
    FUNCTION FUN1 RETURN NUMBER
    AS
    BEGIN RETURN 2;
    END;
    BEGIN
    SELECT FUN1 INTO l_cnt FROM DUAL;
    DBMS_OUTPUT.PUT_LINE(l_cnt );
    END;
    /Any alternate way to call local function in select statement?
    Thanks
    Ram.

    Hi,
    Sorry, you can't call a locally defined function in a SQL statement, even if that SQL statement is in a PL/SQL block where the function is in scope.
    This applies to packages, also. If a function is not declared in the package spec, but only in the package body, then you can't call it from SQL statements in the package body.
    Why do you want a locally defined function? Why not a function defined outside the procedure?

  • Usage of TAble Functions in OBIEE

    Hello All,
    I have created a table function in the database.
    Is it possible to use/call table functions in obiee.Please let me know how to use table functions in OBIEE.
    Thanks in advance.

    Hi,
    Thanks for your reply.
    I want to use this table function to generate answers report.
    In the query i am using unions,bind variables.I can not create a database view on this query.The best solution would be creating a table function.
    But,i do not know how to access/use/call this table function to create answers report.
    Thanks in advance.

  • Calling a function in the application

    Whats the best way to call a function that is in the main application file from a custom component that is nested several layers down
    thanks

    Try to use FlexGlobals.topLevelApplication

  • Can call a function in the select statement?

    Is there any ways to call a function in the select statement?
    what I like to do is this:
    select deptno, totalEmployees(deptno), TotalSalary(deptno)
    from emp;
    I know it can be done by count(*) and join tables, but my case
    is much more complex and the where clauses are different from
    one function to another, and have many tables to join and many
    combinations
    Thanks

    Functions can be used in a select statement subject to certain
    restrictions, see
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/
    server.817/a85397/statem9b.htm#2062024
    It's under "CREATE FUNCTION> Keywords and Parameters> function>
    Restrictions on User-Defined Functions"
    Here is an except...
    When a function is called from within a query or DML statement,
    the function cannot:
    a) Have OUT or IN OUT parameters
    b) Commit or roll back the current transaction, create or roll
    back to a savepoint, or alter the session or the system. DDL
    statements implicitly commit the current transaction, so a user-
    defined function cannot execute any DDL statements.
    c) Write to the database, if the function is being called from a
    SELECT statement. However, a function called from a subquery in
    a DML statement can write to the database.
    d) Write to the same table that is being modified by the
    statement from which the function is called, if the function is
    called from a DML statement.
    Except for the restriction on OUT and IN OUT parameters, Oracle
    enforces these restrictions not only for the function called
    directly from the SQL statement, but also for any functions that
    function calls, and on any functions called from the SQL
    statements executed by that function or any function it calls.

  • Calling Database Functions

    Hi All,
    Just wondering whether anyone has experienced problems in calling a database function. We have Forte 3.0.L.2 and Oracle 8.1.7. Here's how the function is being called:
    l_tdCurrentStatus = (SQL EXECUTE PROCEDURE me_status.get_status(input I_MCR_ID = theMember.CurMCR.MCR_ID) ON SESSION self.DefaultDBSession);
    We are using SQL EXECUTE PROCEDURE syntax to call the function since there is no specific way to call functions.
    We have tried calling the function in a SELECT clause and didn't face any issues so far. But I'd like to know the right way to call a function.
    Any help is greatly appreciated.
    Thanks,
    Madhu
    Fri Feb 13 15:40:21 : Database Error: Procedure me_status.get_status was invoked with a parameter named I_MCR_ID which
    h is unknown.
    Fri Feb 13 15:40:21 :
    Fri Feb 13 15:40:21 : USER ERROR: Procedure me_status.get_status was invoked with a parameter named
      I_MCR_ID which is unknown.
        Class: qqdb_UsageException with ReasonCode: DB_ER_PARAMETERERROR
        Error #: [801, 166]
        Detected at: qqdb_OracleData::VendorInitProcedure
        Last TOOL statement: method MemberPOM.GetMemStatusDyn
        Error Time: Fri Feb 13 15:40:21
        Server: @taz2rr, UserName: ecuser
        Database Statement: begin
          me_status.get_status(I_MCR_ID=>:I_MCR_ID);
          end;
        Exception occurred (locally) on partition "MWRouting_cl1_Part3",
          (partitionId = DD242BB0-B4AC-11D7-989B-C2D07EBCAA77:0x10435:0x1, taskId =
          [DD242BB0-B4AC-11D7-989B-C2D07EBCAA77:0x1042b:0x1.53094]) in application
          "MWRouting_cl1", pid 1036484 on node ServerNode in environment frt1ec.
        USER ERROR: Procedure me_status.get_status was invoked with a parameter
          named I_MCR_ID which is unknown.
            Class: qqdb_UsageException with ReasonCode: DB_ER_PARAMETERERROR
            Error #: [801, 166]
            Detected at: qqdb_OracleData::VendorInitProcedure
            Last TOOL statement: method MemberPOM.GetMemberStatus
            Error Time: Fri Feb 13 15:40:21
            Server: @taz2rr, UserName: ecuser
            Database Statement: begin
              me_status.get_status(I_MCR_ID=>:I_MCR_ID);
              end;
            Exception occurred (locally) on partition "MWRouting_cl1_Part3",
              (partitionId = DD242BB0-B4AC-11D7-989B-C2D07EBCAA77:0x10435:0x1,
              taskId = [DD242BB0-B4AC-11D7-989B-C2D07EBCAA77:0x1042b:0x1.53094]) in
              application "MWRouting_cl1", pid 1036484 on node ServerNode in
              environment frt1ec.

    Hello Madhu,
         The best to do this is:
    l_intmcrid : integer;
    l_intmcrid = theMember.CurMCR.MCR_ID;
    l_tdCurrentStatus : TextData;
    SQL EXECUTE PROCEDURE me_status.get_status(l_intmcrid) ON SESSION self.DefaultDBSession);
    If you want to get some kind of information out from the procedure then you will need to make a output variable on the procedure:
    SQL EXECUTE PROCEDURE me_status.get_status(l_intmcrid, output l_tdCurrentStatus) ON SESSION self.DefaultDBSession);
    This is the only way I know to call Oracle procedure. There are many examples in the CSAPOM project.
    ka

  • Can call a function a few times in reports

    Hi
    Please help me to solve this problem:
    I have a function taking parameters and return a number, I tried
    2 ways to call this function but get same error saying the
    function may not be used in SQL:
    1. the function is in a package, and I use the pl/sql query
    (build from data model) to call it a few times by passing
    different parameters, I get error when compile the query
    2. the function is outside the package, and is called from
    another function in the package a few times, get error when
    compile the package body.
    3. by the way is weekly typed ref cursor allowed in reports?
    Below is part of my code:
    case 1:
    create or replace package perDiem AS
    PRAGMA SERIALLY_REUSABLE;
    TYPE curType IS REF CURSOR;
    function diemSum (
    party_id IN NUMBER,
    partytype IN NUMBER,
    fid IN NUMBER,
    freeday_type IN VARCHAR2,
    startdays IN NUMBER,
    enddays IN NUMBER)
    RETURN NUMBER;
    END;
    CREATE OR REPLACE PACKAGE BODY perDiem AS
    PRAGMA SERIALLY_REUSABLE;
    function diemSum (
    party_id IN NUMBER,
    partytype IN NUMBER,
    fid IN NUMBER,
    freeday_type IN VARCHAR2,
    startdays IN NUMBER,
    enddays IN NUMBER)
    RETURN NUMBER IS
    pdSum NUMBER(10);
    BEGIN
    IF partytype = 1 THEN
    IF freeday_type = 'gateout' THEN
    SELECT COUNT(*) INTO pdsum
    FROM equipment e,
    equipmenttrip et,
    facilitysegment s
    WHERE s.facilityid =fid
    AND et.lastfreeday between startdays AND enddays
    AND et.carrierpartyid =party_id;
    ELSIF freeday_type = 'strip' THEN
    SELECT COUNT(*) INTO pdsum
    FROM equipment e,
    END IF;
    ELSIF partytype = 3 THEN
    IF freeday_type = 'gateout' THEN
    SELECT COUNT(*) INTO pdsum
    FROM ...
    ELSIF freeday_type = 'strip' THEN
    SELECT COUNT(*) INTO pdsum
    FROM facility f,
    END IF;
    END IF;
    RETURN pdsum;
    END diemSum;
    END;
    /////////// pl/sql query//////////////
    function diemDet return perDiem.curType is
    sum_cv perDiem.curType;
         party_code VARCHAR2(20);     
              freeday_type VARCHAR2(20);
    begin
    party_code := :partycode;
              freeday_type := :freeday;
              OPEN sum_cv FOR SELECT      f.facilitycode,
                   perDiem.diemSum(p.partyid,
    p.partytypeid, f.facilityid, freeday_type, 1, 4 ) as days1,
              perDiem.diemSum(p.partyid, p.partytypeid,
    f.facilityid, freeday_type, 5, 10 ) as days2,
              perDiem.diemSum(p.partyid, p.partytypeid,
    f.facilityid, freeday_type, 11, 10000 ) as days3
              FROM equipmenttrip et,
                   facility f,
                   facilitysegment s,
                   party p
         WHERE f.facilityid = s.facilityid
              AND p.partycode = party_code ;
         RETURN sum_cv ;
    end;
    case 2 *** diemSum is a seperate function from package
    create or replace package perDiem AS
    PRAGMA SERIALLY_REUSABLE;
    TYPE curType IS REF CURSOR;
    function diemDet (
    party_code IN VARCHAR2,
    freeday_type IN VARCHAR2)
    RETURN curType;
    END;
    CREATE OR REPLACE PACKAGE BODY perDiem AS
    PRAGMA SERIALLY_REUSABLE;
    function diemDet (
    party_code IN VARCHAR2,
    freeday_type IN VARCHAR2)
    RETURN curType IS
    sum_cv curType;
    BEGIN
    OPEN sum_cv FOR SELECT f.facilitycode,
    diemSum(p.partyid, p.partytypeid, f.facilityid, freeday_type, 1,
    4 ) as days1,
    diemSum(p.partyid, p.partytypeid, f.facilityid, freeday_type, 5,
    10 ) as days2,
    diemSum(p.partyid, p.partytypeid, f.facilityid, freeday_type,
    11, 10000 ) as days3
    FROM equipmenttrip et,
    facility f,
    facilitysegment s,
    party p
    WHERE ...
    RETURN sum_cv ;
    END diemDet;
    END;

    My bet would be that the function doesn't promise not to update
    the database. Therefor it can't be called from a select statment.
    To overcome this you need to define a pragma. I don't remember
    its exact name but I think it is restricted_reference.

Maybe you are looking for