Calling user defined function in Oracle BI Answers?

Hi
I am new in Oracle BI . I want to use the user defined function in Oracle BI Answers as a column,function written in Oracle database to calculate the Sales Revenue.
I am using Oracle BI Standard Edition One and Oracle 10g database.
Please suggest me.
Thanks
Nusrat

Search for EVALUATE function you can call function and pass parameters
Example:
EVALUATE Function
This function is intended for scalar and analytic
calculations.
Syntax: EVALUATE('DB_Function(%1)', {
Comma separated Expression})
Example: SELECT
e.lastname,sales.revenue,EVALUATE('dense_rank()
over(order by %1
)',sales.revenue) FROM sales s, employee e;

Similar Messages

  • Matscript node void ouputs when calling user-defined functions

    Hi,
    I have a (for most of you, probably simple) problem with calling user defined function within a mathscript node.
    I have a script inside a MathScript node which calls three UD functions. When I try to output variables, LabView sets their type to void, so I cannot use them further. this would imply, that the script is nondeterministic, (since the types would get set at runtime). However, if I replace the call to the UD function with the actual contents of the function, the variable becomes deterministic. Now, since I have several call to these functions, I have no desire in writing all of them many time, introducing many variables etc. What would you advise me to do?
    Find attached my scripts and functions.
    I need this script running on a RT Target, and have been battling this for weeks, with almost no success!
    Thanks, Regards,
    Luka
    Attachments:
    Scripts.zip ‏2 KB

    MArtin, hello!
    As far as I know, LabView checks the syntax as you write in the MS Node, and since there is no X mark next to the line number, it indicates, that the syntax is correct. Since i have set the path to the UDF in both the VI options and in the general MAthScript setting, how does adding the path command help? even if I add path('directory') command, a yellow exclamation mark appears, saying the command is slowing down performance.
    (this is the original help explanation:
    The warning glyph indicates that LabVIEW operates with reduced error checking at edit time and slower run-time performance for the MathScript Node. The following conditions cause the warning glyph to appear. To remove the warning glyph from the MathScript Node and improve run-time performance, modify your script as follows to resolve the condition in your script:
    Your script calls addpath or pathremove (legacy name rmpath), or calls cd, path, or userpath with one or more inputs, which change the MathScript search path list at run time. Remove these functions and use the MathScript page to configure the default search path)
     Could you please post a screenshot of your VI, just to see, if you've got anything different set up?
    I am running LV2012.
    Luka

  • Converting db2 user defined functions to oracle .

    Hi gurus
    this is a user defined function for getting current timestamp for a null value how to do this in oracle .i am getting a problem at the input values.can anyone suggest me the changes to convert it into oracle udfs.
    drop function Get_DateId()
    CREATE FUNCTION Get_DateId()
    RETURNS BIGINT
    BEGIN ATOMIC
    DECLARE      R BIGINT;
    DECLARE      v_Day CHAR(2);
    DECLARE      v_Month CHAR(2);
    DECLARE      v_Year CHAR(4);
         SET V_Day     = SUBSTR( DIGITS (DAY(CURRENT DATE)),9);
         SET V_Month     = SUBSTR( DIGITS (MONTH(CURRENT DATE)),9);
         SET V_Year     = RTRIM(CHAR(YEAR(CURRENT DATE)));
         SET R= BIGINT(v_Year||V_Month||V_Day|| '00000000' );
    RETURN R ;
    END
    @

    You'll need to get the syntax for PL/SQL function calls right. You will need something like
    create or replace function whatever( arg datatype, arg datatype...) return varchar2 is
      --define any local variables here
    begin
       return to_number(to_char(systimestamp,'the edit mask you want to use'));
    end;
    /You might do the conversion inline and dispense with the function compeletly if you're just generating a value.

  • Converting the iif function in MS Access97 to an user defined function in Oracle

    Hi ,
    I have a problem here we are working with Visual Basic 6.0(ADOs 2.5) with Oracle 8i release 2. we have some queries stored in the tables which contains the iif function of MS Access 97 do we have a similar built in function in Oracle which replaces this iif function of Ms Access 97.
    we cannot use decode (built in function) of oracle b'cos it cannot be used in a where clause and we cannot write a user defined function also because it cannot be generalized for use b'cos sometimes we use
    field names and sometimes values as expression in the iif functions
    If anybody could suggest me some idea
    please mail me at [email protected]
    with best regards
    Jai

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Jai:
    Hi ,
    I have a problem here we are working with Visual Basic 6.0(ADOs 2.5) with
    Oracle 8i release 2. we have some queries stored in the tables which contains the iif function of MS Access 97 do we have a similar built in function in Oracle which replaces this iif function of Ms Access 97.we cannot use DECODE (built in function) of oracle b'cos it cannot be used in a where clause and we cannot write a user defined function also because it cannot be generalized for use b'cos sometimes we use field names and
    sometimes string values as expression in the iif functions. is there any other built in function ? can anybody suggest me some idea
    please mail me at [email protected]
    regards
    Jai<HR></BLOCKQUOTE>
    Hi,
    You still can use the seccond approach - with a udf IIF() that you place in a package and OVERLOAD it. See the documentation for limitations of Overloading
    Overloading permits you to declare several functions with the same name but havind different behaviours depending on the number and type of the parameters.
    George

  • InvocationTargetException in User Defined Function in Oracle CEP

    I was trying to use a UDF in my CQL query. But I got the following error:
    An InvocationTargetException was encountered while attempting to register the user defined function
    "mymod".  The message was: null
    My code snippet is bellow:
    Bean:
    package com.bea.wlevs.example.function;
    import com.bea.wlevs.oracle.ci.event.CiMessages;
    public class UpdateMessage  {
        public CiMessages addChannel(CiMessages cm, String channel){
            System.out.println("I am in function");
            cm.setChannel(channel);
            return cm;
    config.xml:
    <processor>
    <name>CiRuleEngine</name>
    <rules>
    <query id="filterRule"> <![CDATA[ select addChannel(*,"SMSData") from DCInputChannel[now] as dc ]]> </query>
    </rules>
        </processor>
    content.xml:
    <wlevs:processor id="CiRuleEngine">
    <wlevs:listener ref="IntermediateChannel" />
    <wlevs:function function-name="mymod" exec-method="addCHannel">
    <bean class="com.bea.wlevs.example.function.UpdateMessage"/>
    </wlevs:function>
        </wlevs:processor>
    Can any one help me to resolve this error?

    The asterisk * in invocation addChannel(*,"SMSData") does not mean the event object. This is the cause of the exception.
    For your case, it's much easier to implement a userbean to do the insertion of the channel.
    Thanks
    Junger

  • Calling user defined functions through OBIEE

    Can anyone tell me how I can call the user defined functions on database through the new BI tool.
    The idea is to collect certain parameters through the prompt when launching the request, the function is supposed to pick up the parameters, make a certain calculation, and return a value.
    I wrote the function, I just need help over how to call the function through the BI tool - that was pretty easy in the old Discoverer.
    Thanks.
    Message was edited by:
    user611377

    Hi Kresimir ,
    You can use EVALUATE function to call a user defined function.
    EVALUATE('FUNCTIONNAME(%1,..)' As DATATYPE,parameter1,...)
    Here DATATYPE is the returntype of function.
    Hope this will help.
    Thanks
    Ashok

  • Calling user defined functions in Matlab Script Node

    Greetings!
    I am not successful in calling a user defined function inside a Matlab Script Node.
    The path has been added to Matlab, but the Matlab script node is not calling my function.
    I am calling it as follows:
    a= fcd(b,c);
    and the fcd.m file is calculating the 'first central difference' - works in Matlab, but not in LabVIEW:
    function MtxOut=fcd(MtxIn,dt)
    %MtxOut=fcd(MtxIn,dt)
    %first central difference method of finding instantaneous
    %first derivatives
    %MtxIn = MxN matrix of inputs
    %dt = time change between inputs
    %MtxOut = MxN matrix of first derivatives of inputs
    r=size(MtxIn,1);
    c=size(MtxIn,2);
    MtxOut(1,=(MtxIn(2,-MtxIn(1,)/dt;
    MtxOut(r,=(MtxIn(r,-MtxIn(r-1,)/dt;
    for i=2:r-1
        for j=1:c
            MtxOut(i,j)=(MtxIn(i+1,j)-MtxIn(i-1,j))/(2*dt);
        end
    end

    Matthew:
    What version of MatLab, LabVIEW are you using?. Also, what type of errors are you running into?.
    Thanks,
    Rudi N.

  • How to call User defined functions in Mathscript Node ?

    Hi,
    I have created a user defined function and saved it to Search path of Labview as an M file. If I run my program in Math script window, the function is recognized and the program works properly. If I do the same with MathScript node , the user defined functions are not identified.
    Kindly help me with this problem. Thanks in advance
    Cheers
    Lenord Melvix

    This page may help:
    http://zone.ni.com/reference/en-XX/help/373123C-01/lvtextmathmain/caveats_recommendations_ms_search_...
    Kevin C.

  • How can I find user defined functions in oracle

    Hello All,
    I need to find out what are the user defined functions available in my schema?
    Please let me know on what system tables shall I query and find out the user defined functions?
    Thanks,
    Milind.

    Thanks Satish,
    One more query. Can I find what are the parameters that needs to be passed?
    Here is what I have to do..
    I have to find all the accessible user defined functions. If I select one of them in my UI, I need to show the parameters used in the respective function.
    Please let me know if these parameters are stored anywhere..
    Thanks again,
    Milind

  • How to distinguish the User-Defined-Function from Oracle Build-In function

    Hi Friends,
    I could get the function list form all_objects table by the SQL:
    select * from all_objects where object_type = 'FUNCTION'
    but there is no column in all_objects specify the function is build-in or user-defined.
    But I found in SQL Server there is a column "is_ms_shipped" in the sys.all_objects table. This column will specify the object is build-in or user-defined. I want to get the equivalent column in Oracle but failed.
    Could anyone tell me how to solve this problem?
    Thanks,
    Ricky

    Thanks Pavan.
    But if an user connects to database using "conn /as sysdba" syntax and creates a function. This user-defined funtion goes into the "SYS" schema also. I know it is not the best practise to create objects using sys user so I think your solution is right.
    Regards,
    Ricky

  • How to call User Define Function

    Hi,
    I need a help....
    In my Project I have Login.jspx page in which there is a textbox Username.
    I have second success.jspx page which has its success.java bean class in which i have define a method "display()".Now i want to cal display() in my success.jspx page.
    can anyone help me out what is the way to do this.
    Thanks in advance...
    Thanks,
    Nehal

    Hi Abhijit,
    Sure i can give you more details on the same:
    I have written a displayVal method in ForgotPassword.java bean class
    public String displayVal() {    
    String txtVal = AdfFacesContext.getCurrentInstance().getPageFlowScope().get("testValue").toString();
    nameID.setValue(txtVal);
    return txtVal;
    Now in ForgotPassword.jspx page i have one input text box named "nameID" in which i want to display some value from the user-define method called displayVal()
    now i am trying to call my user-define method in my ForgotPassword.jspx page:
    <af:inputText label="Name"
    binding="#{backingBeanScope.backing_FrgtPwd.nameID}"
    id="nameID"
    value="#{backingBeanScope.backing_FrgtPwd.displayVal}">
    </af:inputText>
    but is is showing an error that: backingBeanScope.backing_FrgtPwd.displayVal is not a property as this a method.
    So now my query is : Is there any way by which i can call my user-define method on the jspx page from the bean class of the same page.

  • Calling User-Defined Function in SELECT

    Can I do something like:
    SELECT my_func(col_1) from tab_1

    SQL> CREATE OR REPLACE TYPE varchar2_pair_ot AS OBJECT
      2  ( var1 VARCHAR2(1000)
      3  , var2 VARCHAR2(1000) );
      4  /
    Type created.
    SQL> CREATE OR REPLACE FUNCTION my_func
      2      ( p_blah VARCHAR2 )
      3      RETURN varchar2_pair_ot
      4  AS
      5  BEGIN
      6      RETURN varchar2_pair_ot(LOWER(p_blah), UPPER(p_blah));
      7  END my_func;
      8  /
    Function created.
    SQL> CREATE TABLE blah
      2  ( b1 VARCHAR2(10)
      3  , b2 VARCHAR2(10) );
    Table created.
    SQL> CREATE TABLE xyz
      2  ( abc VARCHAR2(10) );
    Table created.
    SQL> INSERT INTO xyz VALUES ('Blah');
    1 row created.
    SQL> INSERT INTO blah(b1, b2)
      2  SELECT v.f.var1, v.f.var2
      3  FROM   ( SELECT my_func(abc) AS f
      4           FROM   xyz ) v;
    1 row created.
    SQL> SELECT * FROM blah;
    B1         B2
    blah       BLAH
    1 row selected.

  • Error while using user defined function in reports

    Hi,
    When I use the below user defined function in oracle reports I got the wrong number of arguments error
    select test_function(id,a_number,v_date-14,b_number) from dual;
    If I remove -14 from the argument it works. But iIneed to subtract 14 days from the date.
    Thanks for your help.

    select test_function(id,a_number,v_date-14,b_number) from dual;
    you have to give the command like this to_date(v_date,'dd-mon-yyyy')-14
    because the v_Date you choose in the parameter form is not having the corrent date format
    the format dd-mon-yyyy is the format in which v_date is passed by the user.

  • CALL USER DIFINED FUNCTION IN SQLLDR

    Is is it possible to call User defined function in SQLLDR ?
    COL1 COL2 COL3
    1 2 06
    1 2 06
    1 3 06
    1 4 06
    2 1 06
    2 1 06
    I have to ignore 2nd and 6th row while loading the data . because it is duplicate records .
    Is it possible in SQLLDR.

    If there is a unique index on the columns the duplicate rows are not loaded and sqlldr makes a *.bad-Datei (Parameter BAD=...) with the rows which are not loaded.
    What should the user defined function do?

  • Calling ORACLE Store Procedure with parameters in user define function

    Hi everybody,
    We have a scenario connecting Oracle DB thru JDBC adapter.
    We have to call store procedure with input parameter and output parameter to retrieve data from DB. The implementation was made using JDBC adapter by building the correct XML message with EXECUTE action, and it works fine.
    Now we need to use DB lookup within mapping. I wrote users define function with SELECT statement (using the JDBC adapter) and it works fine but I need to call store procedure in ORACLE instead of SELECT statement.
    I found lot of examples concerning DB lookup but none of them explained how to write UDF calling store procedure in ORACLE with input and output parameters.
    I am looking for an example.
    Thanks in advance,
    Gigi

    I agree with you, but issue is we have lots of existing store procedure, which we need to call where damn required. I am sure those will be few but still i need to find out.
    If you think you are going to get existing MS Stored Procedures  or Oracle Packages that had nothing to do with the ORM previously to work that are not geared to do simple CRUD operations with the ORM and the database tables, you have a rude awakening
    coming that's for sure. You had better look into using ADO.NET and Oracle Command objects and call those Oracle Packages by those means and use a datareader.
    You could use the EF backdoor, call Oracle Command object and use the Packages,  if that's even possible, just like you can use MS SQL Server Stored Procedures or in-line T-SQL via the EF backdoor.
    That's about your best shot.
    http://blogs.msdn.com/b/alexj/archive/2009/11/07/tip-41-how-to-execute-t-sql-directly-against-the-database.aspx

Maybe you are looking for

  • How to manage SAP Masters Data in Multi Lauguages

    Dear All; We are using ECC5 unicode version. So far we only use in Japan, but we are trying to use this system in Thailand too. And some of the customer and vendor master record will be used in JPN and THI. I would like to know how to save the 2 lang

  • Weird outline occuring in resized pics in Lightroom 1.x

    Hi, I have a question regarding pics that are exported in Lightroom. When I'm done editing, I click on the export button and change the sizing dimensions to 1000x1000 so that I don't have to open it up in photoshop again to resize it. Whenever I do t

  • SERVICE BATTERY ON MACBOOK PRO 13" MID2010

    I replaced the battery on my MACBOOKPRO 13" with an OEM battery but the battery indicator still says "Service Battery". I did an SMC reset and nothing happened. I tried to restart and the message is still there. It is charging just fine and holds the

  • OpenPortal Portlet Container and log4j

    Hi, I'm trying to get my first portlet to work in OpenPortal Portlet Container 2.0 (on Glassfish) and Eclipse. it works fine, but a couple of things are bugging me. Number one annoyance is that I don't understantd why my log4j logging doesn't work. I

  • Importing Metadata Options?

    I've got several thousand images in various folders by event, and each has an Excel file that has what will be the caption, title, keywords and image filename. ...and I'd like to merge these either with the importing to Aperture, or afterwards. Any t