Custom function in a database view makes performance slow in OBI?

Hi,
I am facing a major performance problem.
I have a oracle view which is calling a database function ( which I created).
CREATE OR REPLACE VIEW ISRM_ECOX_NAK_REPLAY (ret)
as
select APP.ISRM_ECOX_NAK_REPLAY (CASHFLOW_MESSAGE.EXTERNAL_DEAL_NUMBER) ret from CASHFLOW_MESSAGE
It runs in the database in a couple of seconds. But when I import the view in the OBI repository the query keeps running for hours without returning any data.
If there are very few records in the database table used on the view then it runs in OBI after a couple of minutes, but not otherwise.
When I pick the query from Manage Sessions and run it in the database, again it runs fast
The OBIEE version is 10.1.3.4.1
thanks and regards,
Gaurav
Edited by: Gaurav on 22-Sep-2011 02:43

Hi guarav,
may be an idea...why not creating a materialized view in the db which you make use of in obi?
Can't that solve your perf problems?
Kr,
A

Similar Messages

  • Migrate custom folders over to database views

    Hi,
    Over time one of our business areas has had a number of custom folders added.
    Whilst the SQL is fine, I would like to put these into the database as views to reduce the length of SQL statements been parsed by Discoverer and hopefully reduce network traffic.
    The problem is that a number of reports have been written based upon the existing custom folders.
    Is there any way to refresh an existing custom folder so that it becomes a database folder, without having to reassign items in the existing reports.
    Ambitious I know, but sooner or later I know I'm going to get asked the question.
    Thanks.

    Hi,
    Is there any way to refresh an existing custom folder so that it becomes a database folder, without having to reassign items in the existing reports.No, there isn't. But what you could try doing is delete the custom folder and then create a base folder with exactly the same name, identifier, items and joins based on the new view. Hopefully, the workbook would then find the same items in the folder.
    If you cann't get that to work, you could just change the custom folder to select * from your custom view.
    Rod West

  • Database Link makes manipulation slow

    i have oracle 8.5 with developer 6i.
    my application uses two database server and there is a database link between both server.
    when user make a transaction and commit the manipulation procedures post the transaction on local server and on other server through database link.
    but some time it freezes when user press save button and resume after about 5 seconds. and even some time it hangs up for long time.
    is there any solution to get rid of this problem?
    i m working in a client server environment with LAN.
    regards
    adeel

    how much time does it take if you do the same amount of data transaction on sqlplus with the two linked databases?
    The solutions depend on the details of your task.
    e.g.,if data are huge, using the database night cronjob to make the tansactions to the linked one.

  • Bad performance when using  complex database view with Toplink

    Hi
    Problem description
    1. I have a complex query that collects the data from many DB tables. For this reason I create a database view based on this select. Using EJB 3.0 with Toplink I
    mapped this view to a java object the same way I map database tables. The method I use to get the results is:
    snippet code...
    public List<VwKartela> VwKartela(Integer pperid) {
    List<VwKartela> results = null;
    Session session = getSessionFactory().acquireSession();
    ExpressionBuilder bankfile = new ExpressionBuilder();
    Expression exp1 = bankfile.get("perid").equal(pperid);
    ReadAllQuery query = new ReadAllQuery();
    query.setReferenceClass(VwKartela.class);
    query.setSelectionCriteria(exp1);
    results =(List<VwKartela>)session.executeQuery(query);
    When running the select on the view prom SQL Plus I haven’t any performance problem.
    2.Question: How can I improve the performance? I referenced to Toplink docs but I didn't improve the it.
    Have anyone any experience is such cases?
    Thank you
    Thanos

    Hi
    After my last tests I conclude at the followings:
    The query returns 1-30 records
    Test 1: Using Form Builder
    -     Execution time 7-8 seconds
    Test 2: Using Jdeveloper/Toplink/EJB 3.0/ADF and Oracle AS 10.1.3.0
    -     Execution time 25-27 seconds
    Test 3: Using JDBC/ADF and Oracle AS 10.1.3.0
    - Execution time 17-18 seconds
    When I use:
    session.setLogLevel(SessionLog.FINE) and
    session.setProfiler(new PerformanceProfiler())
    I don’t see any improvement in the execution time of the query.
    Thank you
    Thanos

  • Can we call custom functions in view objects?

    Can we call custom functions in view objects?these custom functions are from my backing bean...
    Please help.....

    User,
    You can certainly add code to your view objects to do whatever you like.
    However, it would be considered a very bad practice to call something in the backing bean from your view object. It violates the whole MVC design principle of ADF.
    Perhaps if you can share your real use case, someone will give you ideas about the best way to do it, but I, for one, would advise you to forget about calling a backing bean function from your view object.
    Best,
    John

  • TABLE FUNCTION - Using database view - send parameters to the function.

    Hi everybody:
    1.- I have a function returning a TABLE OF, and that function recieve 2 parameters of type NUMBER.
    2.- I'm able to call this function as a table function like this:
    SELECT * FROM TABLE(my_function(3,4))
    3.- I want to create a database View, To use this query in diferent places of my app.
    CREATE OR REPLACE VIEW NAME_OF_MY_VIEW AS SELECT * FROM TABLE(my_function(:_idOne,:idTwo))
    4.- My problem is, that I want to send the parameters dinamically to the function, and use those parameters to populate the rows, using a database view, the previous code does not compile... and I don't know another way to do this.
    Please help.
    thnks in advance.
    Alex.

    Yes you can:
    SQL> CREATE PACKAGE pkg
    AS
       a_global   VARCHAR2 (30);
       FUNCTION f (a VARCHAR2)
          RETURN varchar_tab;
       FUNCTION ret_global
          RETURN VARCHAR2;
       FUNCTION set_ret_global (ret_global VARCHAR2)
          RETURN INTEGER;
    END;
    Package created.
    SQL> CREATE OR REPLACE PACKAGE BODY pkg
    AS
       FUNCTION f (a VARCHAR2)
          RETURN varchar_tab
       AS
          l_varchar_tab   varchar_tab := varchar_tab ();
       BEGIN
          FOR i IN 1 .. 10
          LOOP
             l_varchar_tab.EXTEND;
             l_varchar_tab (i) := a;
          END LOOP;
          RETURN l_varchar_tab;
       END f;
       FUNCTION ret_global
          RETURN VARCHAR2
       AS
       BEGIN
          RETURN a_global;
       END ret_global;
       FUNCTION set_ret_global (ret_global VARCHAR2)
          RETURN INTEGER
       AS
       BEGIN
          a_global := ret_global;
          RETURN 1;
       END set_ret_global;
    END pkg;
    Package body created.
    SQL> CREATE OR REPLACE VIEW v
    AS
       SELECT *
         FROM TABLE (pkg.f (pkg.ret_global))
    View created.
    SQL> SELECT *
      FROM v
    WHERE 1 = pkg.set_ret_global (5)
    COLUMN_VALUE                                                                   
    5                                                                              
    5                                                                              
    5                                                                              
    5                                                                              
    5                                                                              
    5                                                                              
    5                                                                              
    5                                                                              
    5                                                                              
    5                                                                              
    10 rows selected.
    SQL> SELECT *
      FROM v
    WHERE 1 = pkg.set_ret_global (4)
    COLUMN_VALUE                                                                   
    4                                                                              
    4                                                                              
    4                                                                              
    4                                                                              
    4                                                                              
    4                                                                              
    4                                                                              
    4                                                                              
    4                                                                              
    4                                                                              
    10 rows selected.

  • HR transactions and functionality and creation of Database view

    Hi Guys
        I am new to HR module . can anybody send me the list of transaction codes with HR functionalities.
    I also have to made a database view from hrp1001 and hrp1010 table to list all chief positions who are head of business group , Business unit , Site etc .
    Could you help me in creating this databse view.

    Hi,
    These are HR Infotypes
    0000    Events
    0001    Org assignment
    0002    Personal info
    0003    Payroll data
    0007    Work time
    0008    Basic pay
    0014    Reoccurring pay
    0015   1 X pay
    0027   Cost Center
    0041   Event Dates
    0057   Membership dues
    0165   Over ride  to limits on deductions
    0167   Health
    0168   Insurance
    0169   Savings
    0170   Spending   
    0194   Garnishment reduction
    0195   Garnishment order
    0207   Residence Tax
    0208   Work Tax
    0209   Unemployment Tax
    0210   Withholding
    0216   Garnishment adjustment
    0221   Adjustment
    0267   Off cycle
    2005   OT
    2010   Catts direct to cluster
    1000   Infotypes 1000 – 1999 are PD Relationship infotypes
    Logical Database (PNP) ·     
    Programming with Infotypes ·     
    Processing Time infotypes/Cluster ·     
    Processing Payroll infotypes/Cluster
    In OM level hrp 1001 and 1010 will be there.
    If u want total transactions goto SE11->TSTC Table.
    ****POINTS TO BE CONSIDERD
    Thanks
    P.SRIKANTH

  • Sharepoint 2013 Datasheet View Navigation performance Issues on large lists

    I was recently upgraded to SharePoint 2013.
    In SharePoint 2010 Datasheet View, one could scroll through and bulk select 100s of line items in Datasheet view very easily.   Navigating the datasheet view was just like navigating through a worksheet in Excel, and one could use quick select
    keys like ctrl-shift-right arrow / down arrow to bulk select items.
    After the upgrade to SharePoint 2013, using the "Quick Edit" tab in Datasheet view and changing the Item Limit to 5000 items, it takes an inordinately long time to load the list.   None of the quick select keys like ctrl-shift-right arrow
    works anymore and the browser keeps warning about a slow-running script when attempting to select multiple items while scrolling through the list. 
    The functionality I need is for users to be able to bulk delete all line items in a SP list and copy (from Excel) and paste new line items into the SP list through their browser. 

    I am running SP Server 2013 with the Dec CU on my internal farm.  This past week, I migrated 1 database containing 1 site collection (also ran the site upgrade to 2013).  Prior to the migration, the users were using Datasheet View in 2010 to bulk
    edit and also add attachments through the pop up window while in Datasheet View.  After the migration, performance on their list using IE8 with less than 300 items was horrible for the end user and also for me as a farm admin (I'm running iE11). 
    I created a new view and performance seemed better for me and a slight improvement for the end user, but still not satisfying.  The end user is using Chrome in the interim until I can test with IE9 to see if that makes a difference.
    My main concern is the Quick Edit view.  This user needs to be able to use the 2010 Datasheet View to manage attachments while in DS view.  I created a new DS view on the affected list, but it still defaults back to the Quick Edit view.  This
    list is on 1 of 3 web apps in my internal farm.  The interesting thing is that I can create a 2010 Datasheet View in a custom list on a site that was created in 2013 from scratch in another web app on my internal farm.  However, I can only do
    this on 1 of 3 web apps.  On my 2013 external farm, I can create a DS view in a 2013 site created from scratch in 1 of 2 web apps.  Creating a list on the 2nd web app in DS view defaults the list back to Quick Edit.  I checked in SharePoint
    Manager thinking there was a web app feature that wasn't getting activated.  There was only 1 web app feature that jumped out.  Academic Library Site Safe Controls was activated on the 2 web apps I could create the 2010 Datasheet View on, but
    not the other 3 web apps I could only seem to get the Quick Edit view when creating the DS view.
    Is there a feature that needs to get activated or one that might need to be deactivated/reactivated?  My internal farm with the 3 web apps is running the Dec 2013 CU and the external farm w/the 2 web apps is running the March 2013
    PU.
    Aside from that, I've received complaints on the list performance using IE and not being able to use the 2010 datasheet functionality as noted above.  I haven't received any complaints on being able to only copy 100 items in Quick Edit view at a time,
    but I have also noticed that issue.  In my case, the retry doesn't work and I have to delete anything over 100 items before it will save.  I would like to find a resolution on this as well.  Every bit of help I can get with this issue is very
    much appreciated.  Thanks in advance!

  • SSRS - Pass Field Value List To Custom Function Assembly And Display Result

    I have written a SQL Server Reporting Services custom function as a C# assembly DLL and added it to my report. The purpose of the function is to search for outlier records in a collection of data. The data is represented as an array of floating point -tuplets
    (float[][]). In a medical patient database, these might be things such as blood pressure, cholesterol, hight, weight, waist measurement, etc.
    Several user input parameters are provided in the report, including numeric seed values for this particular algorithm. One multivalued parameter is a list of the numeric columns to be used as input to the algorithm because, importantly,
    the user can choose any subset of the value columns. I have a tablix that will display columns from the dataset conditionally, based on which of those columns are chosen.
    At this point, there are two issues I'm having difficulty with:
    How do I, in the course of running the report, take just the numeric columns that the user has chosen (ignoring all others in the dataset) and pass them as a float[][] to my custom function? Or is there something in the
    Microsoft.ReportingServices namespace that I should use to query an input dataset and convert it to an array in my C# code?
    How can I present the array subset returned by my custom function in a tablix in the report?
    Note: One thought that occurs to me is that outlier records tablix could be contained in a subreport, but I'm not clear on the logistics of passing dataset field results from a master report to a subreport.
    I envision a final report when run to be similar to the following:
    - Mark Z.

    Hi Mark,
    Sorry for the delay.
    From your description, you want to pass the dataset data to a custom code array, and return the subset of the array, right? In this case, you can use a custom function to add the data to array, and use the a custom function to sort the data base on your
    requirement and then use a function to get the subset of the array. Here are some sample custom code for your reference.
    Add to arryay
    Dim values As System.Collections.ArrayList=New System.Collections.ArrayList()
    Function SetText(ByVal value As Integer) As Integer
        values.Add(value)
        return value
    End Function
    Sort array
    Function Sort()
    Dim i as Integer
    Dim j as Integer
    Dim t as Integer
    Dim n as Integer=values.Count-1
    For i=n To 1 Step-1
     For j=0 To i-1
     if values(j)<values(j+1) Then
        t=values(j)
        values(j)=values(j+1)
        values(j+1)=t
     End if
     Next j
    Next i
    End Function
    Return value.
    Function Rank(ByVal value As Integer)
       return values(value)
    End Function
    Assume that you pass [Weight] field to array, you can use the expression below on the Weight column:
    =Code.SetText(Fields!Weight.Value)
    Then use the expression below to get the values.
    PatientID:=Sort() & Lookup(Code.Rank(0),Fields!Weight.Value,Fields.Patient.Value,"Dataset")
    Height:=Lookup(Code.Rank(0),Fields!Weight.Value,Fields.Height.Value,"Dataset")
    Weight:=Code.Rank(0)
    Hope this helps.
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Disco 10G Custom Function for HTML Call to pass specific sheetid

    After learning that I cannot specify Disco 10G to open a particular worksheet in a workbook from a form menu launch (currently all I get is a listing of worksheets available in the workbook), I am told to create a custom function to handle this - instead of using OracleOASIS.RunDiscoverer.
    I have tried creating a custom function in our custom schema, but I only end up with an error page (Invalid Function) when I try to launch the report from the menu function. I even tried duplicating the Oracle OracleOASIS package and renaming it in APPS, only to receive the same results.
    Does anyone know the correct steps involved to create a new package for the HTML Call of a function in order to launch a Discoverer report?
    Thank you,
    Suzanne

    Hi Suzanne
    Here's a simple form that can be used to call Discoverer Plus:
    <br><br>
    <html><br>
    <form method="post" name="Login" action="http://myserver.com/discoverer/plus"> <br>
    Username: <input type="input" name="us" value="username"> <br>
    Password: <input type="input" name="pw" value="password"> <br>
    Database: <input type="input" name="db" value="database"> <br>
    EUL: <input type="input" name="eul" value="EUL"> <br>
    Workbook: <input type="input" name="opendbid" value="MY_AIRLINE"> <br>
    Worksheet: <input type="input" name="sheetid" value="222"> <br>
    <input type="submit" name="connect" value="Connect"><br>
    </form> <br>
    </html>
    <br><br>
    You will need to make sure you pass the correct username, password, database, eul, workbooks id (opendbid), and worksheet id (sheetid). Note that the EUL needs to be passed in uppercase and that the workbook id is case sensitive. You should also notice that this form displays the values in the form and allows the user to change them. After the user has entered their own values, they click the button called Connect.
    <br><br>
    A similar form for Viewer is as follows:
    <br><br>
    <html><br>
    <form method="post" name="Login" action="http://myserver.com/discoverer/viewer"> <br>
    <input type="hidden" name="us" value="username"> <br>
    <input type="hidden" name="pw" value="password"> <br>
    <input type="hidden" name="db" value="database"> <br>
    <input type="hidden" name="eul" value="EUL"> <br>
    <input type="hidden" name="wbk" value="MY_AIRLINE"> <br>
    <input type="hidden" name="wsk" value="222"> <br>
    <input type="submit" name="connect" value="Connect"><br>
    </form> <br>
    </html>
    <br><br>
    You will notice that for Viewer not only is there a different URL but the commands to pass the workbook and worksheet ids are different too. You should also notice that Viewer will execute the call without showing the values on the screen. All you will see is a button called Connect.
    <br><br>
    Does this help?<br><br>
    Regards<br><br>
    Michael

  • Forms procedures Vs. Database schema procedures - performance question

    Hi,
    What performs more efficiently, a procedure coded in a program unit or trigger in a form, or the same logic coded in a database procedure?
    Eg:
    I have a proc in a form program unit that runs a select sentence and does some data manipulation before inserting records in a table . If I susbstitute this select statement for a view and the general process for a procedure in the database, will this perform faster?

    Hi there
    You have to consider if your procedure is computing-intensive or dml-intensive. For example Designer attaches to every form a set of 4-5 libraries. If you look at them, they work completely with forms predefined procedures and objets (they work with internal forms objects). This is an extreme case in which there isn´t any reason to have those libraries in the database (they wouldn´t compile anyway).
    If you have to do queries, insert, update and delete records, the logic should be in the database, as stored procedures, functions and packages.
    The good think is that from the form´s point of view, it doesn´t matter if a procedure is local to the form, inside an attached library or compiled in the database.
    So, I would go for stored procedures, functions and packages first. Only If the performance of the database is in risk would I consider to put transactional logic in libraries attached to forms.
    Good luck.

  • How to use custom function.

    i write a custom funciton contain a sql sentence like this:
    SELECT sum(QTY) INTO SUM_OUTPUTQTY FROM V_DW_SALE_INVOICE
    WHERE V_DW_SALE_INVOICE.INVOICEDATE LIKE 'aaa%' AND
    P2=MENUFACTURER_ID AND P3=METERIELNAME AND P4 =SPEC AND
    P5=ORG_ID;
    the table V_DW_SALE_INVOICE is in the source database.
    when i deploy the function,it response table or view is not exist.
    how to deploy the function?
    thx

    How did you create your custom function? The step-by-step instructions are in the User Guide here http://download.oracle.com/docs/html/B12146_01/maptransf.htm#i1149862 Note you can also import existing PL/SQL packages as described there.
    Minor comment: INTO [variable] is a PL/SQL element, not SQL.
    Nikolai Rochnik

  • Query Rewrite with regular database Views

    Hi all,
    I'm trying to make my programmer's life easier by creating a database view for them to query the data, so they don't have to worry about joining tables. However, query rewrite doesn't work no matter how I define the MV and View. Here's an example:
    I've Sales tables with columns: PDate, CustCode, Amount
    and Customer table with columns: CustCode, CustDesc
    I create a view SALES_V with columns: PDate, CustCode, CustDesc, Amount by joining Sales table with Customer table as follows:
    create or replace view SALES_V as
    select PDate, c.CustCode, c.CustDesc, Amount
    from Sales s
    join Customer c on (s.CustCode=c.CustCode);
    For the sake of speed, I create a materialized view SALES_TOT_MV with columns: PDate, Amount with the following SQL:
    create materialized view SALES_TOT_MV
    enable query rewrite
    as select PDate, sum(Amount) Amount from Sales
    group by PDate;
    When I run the following query, I expect it to be rewritten to make use of SALES_TOT_MV:
    select PDate, sum(Amount) from SALES_V
    group by PDate;
    However, explain plan always tell me it's using SALES table, not the SALES_TOT_MV.
    Can somebody tell me it's a limitation of Oracle optimizer or I'm just missing something for this?
    Thanks in advance!!
    - Andrew
    Edited by: blackhole001 on Jan 28, 2010 12:34 PM

    blackhole001 wrote:
    Hi all,
    I'm trying to make my programmer's life easier by creating a database view for them to query the data, so they don't have to worry about joining tables. This sounds like a pretty horrible idea. I say this because you will eventually end up with programmers that know nothing about your data model and how to properly interact with it.
    Additionally, what you will get is a developer that takes one of your views and see's that of the 20 columns in it, it has 4 that he needs. If all those 4 columns comes from a simple 2 table join, but the view has 8 tables, you're wasting a tonne of resources by using the view (and heaven forbid they have to join that view to another view to get 4 of the 20 columns from that other view as well).
    Ideally you'd write stored routines that satisfy exactly what is required (if you are the database resource and these other programmers are java, .net, etc... based) and the front end developers would call those routines customized for an exact purpose.
    Creating views is not bad, but it's by no means a proper solution to having developers not learn or understand SQL and/or the data model.

  • Custom Function Help

    Post Author: edy80y
    CA Forum: Formula
    I have a report with many subreports which all contain the same formula to group teams.When a new team is added i need to update all instances of the formula so they are all up to date.I know of Custom Function so i created one out of the formula in the main report.  The problem im finding is that im unable to use that custom function in the sub reports.Am i wring in thinking that a custom function created in a main report can be used in its sub reports??Am i creating the custom function incorrectly? Heres what i have done:
    Our database has team names that have a prefix of the State they are in such as: Perth - Team Orange Perth - Team Apple Sydney - Team Grape Sydney - Team Pineapple
    At one stage the Teams in Perth had been split into Perth1 and Perth2 resulting in the following records in the database:
    Perth1 - Team Orange Perth - Team Orange
    Because of this i have created a formula that groups teams into sites:
    select Trimleft(mid({team.name},instr({team.name},'-')+1))case 'Team Orange', 'Team Apple': 'Perth'case 'Team Grape', 'Team Pineapple': 'Sydney'default:''
    I use this formula in all reports and subreports and i link by them as well, so if a new team is created (for example Perth - Team Pear) i need toupdate all instances of the formula by adding 'Team Pear' to the Perth case.
    To fix the problem i created a custom function (called 'site') out of the formula above and it created this:
    Funtion (stringvar v1)select Trimleft(mid(v1,instr(v1,'-')+1))case 'Team Orange', 'Team Apple': 'Perth'case 'Team Grape', 'Team Pineapple': 'Sydney'default:''
    Now within that main report i am able to go to the formula editor and when i type site() then wording becomes blue but when i go into a sub report to do the same it doesnt react.
    I hope i have explained my self well enough for you to understand my predicament without boring you.
    Thanks in advance for your help!

    Post Author: edy80y
    CA Forum: Formula
    Hi,
    Thanks for the reply.  Unfortunately it does make things easy for me.  If i add the custom function in the subreport then i will have to updae that as well whenever a new team is created.  I'm looking for a solution where i only have to update the custom function in the main report only and not in the 7 or 8 subreports within it.
    Unless i am doing something wrong.  I basically copied the contecnt of the Custom Function in the main report and then went into the sub report and created a new Custom Function and pasted the code in it.
    Regards,
    Eddie S

  • ODSI service using function from oracle database

    Hi ,
    I need to create a ODSI service using function from oracle database.
    I am not sure how to create a Physical Layer and Logical Layer using the function fron db.
    Kindly provide a sample . I need It ASAP. Thanks in advance.
    Regards,
    Tara

    Here's what you do.
    Create New Physical Data Service -> Relational -> MyDataSource -> Table -> SomeTable ... finish the wizard.
    So now you have a Physical Data Service that represents a database table.
    Create New Physcial Data Service -> Relational -> MyDataSource (the same one as above) -> Database Function -> Enter UPPER for the Function name, enter MyUpper fro the XQuery Function. Finish the Wizard (use something like MyUpperDs for the ds name).
    Open MyUpperDs. Right-click -> Edit Signature on MyUpper. Change the ReturnType to string, change the Occurrence to Zero or One.
    Add a parameter, change the Type to string, change the Occurrence to Zero or One.
    Save.
    Now, open the first ds you made SomeTable.ds (whatever). Run it in the test view.
    Go to the Overview tab. Create New Operation. Give it the name SOMETABLE_UPPER. Save it.
    Go to the Query Map tab, open SOMETABLE_UPPER. Drag and drop SOMETABLE (the system-generated function into the mapper. It will show a dotted line from SOMETABLE to the Return. Now drag-and-drop the SOMETABLE to the top-level element of the return type, it will show solid lines from each element in SOMETABLE to each element in the return type.
    Now, drag-and-drop MyUpperDs.MyUpper into the Query Mapper. Edit the source, find where it added the line "for $x in myd:MyUpper()" and delete that line.
    Change a line that simply returns a value to use your function, for example, change
    <FIRST_NAME>{fn:data($CUSTOMER/FIRST_NAME)}</FIRST_NAME>
    to
    <FIRST_NAME>{myd:MyUpper(fn:data($CUSTOMER/FIRST_NAME))}</FIRST_NAME>
    Click on the Plan tab and Show Query Plan. You will see that in the query plan, it is using the database UPPER function where you specified MyUpper.
    Go to the Test View and run it.
    I used the RTLCUSTOMER table in cgDataSource
    xquery version "1.0" encoding "UTF-8";
    (::pragma xds <x:xds xmlns:x="urn:annotations.ld.bea.com" targetType="t:CUSTOMER" xmlns:t="ld:physical/CUSTOMER">
    <creationDate>2010-10-14T13:09:54</creationDate>
    <relationalDB name="cgDataSource" providerId="Pointbase"/>
    <field xpath="CUSTOMER_ID" type="xs:string">
    <extension nativeXpath="CUSTOMER_ID" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="32" nativeFractionalDigits="0" nativeKey="true"/>
    <properties nullable="false"/>
    </field>
    <field xpath="FIRST_NAME" type="xs:string">
    <extension nativeXpath="FIRST_NAME" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="64" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="LAST_NAME" type="xs:string">
    <extension nativeXpath="LAST_NAME" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="64" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="CUSTOMER_SINCE" type="xs:date">
    <extension nativeXpath="CUSTOMER_SINCE" nativeTypeCode="91" nativeType="DATE" nativeSize="10" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="EMAIL_ADDRESS" type="xs:string">
    <extension nativeXpath="EMAIL_ADDRESS" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="32" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="TELEPHONE_NUMBER" type="xs:string">
    <extension nativeXpath="TELEPHONE_NUMBER" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="32" nativeFractionalDigits="0"/>
    <properties nullable="false"/>
    </field>
    <field xpath="SSN" type="xs:string">
    <extension nativeXpath="SSN" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="16" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="BIRTH_DAY" type="xs:date">
    <extension nativeXpath="BIRTH_DAY" nativeTypeCode="91" nativeType="DATE" nativeSize="10" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="DEFAULT_SHIP_METHOD" type="xs:string">
    <extension nativeXpath="DEFAULT_SHIP_METHOD" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="16" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="EMAIL_NOTIFICATION" type="xs:short">
    <extension nativeXpath="EMAIL_NOTIFICATION" nativeTypeCode="5" nativeType="SMALLINT" nativeSize="5" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="NEWS_LETTTER" type="xs:short">
    <extension nativeXpath="NEWS_LETTTER" nativeTypeCode="5" nativeType="SMALLINT" nativeSize="5" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="ONLINE_STATEMENT" type="xs:short">
    <extension nativeXpath="ONLINE_STATEMENT" nativeTypeCode="5" nativeType="SMALLINT" nativeSize="5" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <field xpath="LOGIN_ID" type="xs:string">
    <extension nativeXpath="LOGIN_ID" nativeTypeCode="12" nativeType="VARCHAR" nativeSize="50" nativeFractionalDigits="0"/>
    <properties nullable="true"/>
    </field>
    <key name="CUSTOMER_0_SYSTEMNAMEDCONSTRAINT__PRIMARYKEY" type="cus:CUSTOMER_KEY" inferredSchema="true" xmlns:cus="ld:physical/CUSTOMER"/>
    </x:xds>::)
    declare namespace myd= "ld:physical/MyDs";
    declare namespace f1 = "ld:physical/CUSTOMER";
    import schema namespace t1 = "ld:physical/CUSTOMER" at "ld:physical/schemas/CUSTOMER.xsd";
    import schema "ld:physical/CUSTOMER" at "ld:physical/schemas/CUSTOMER_KEY.xsd";
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="read" isPrimary="false" nativeName="CUSTOMER" nativeLevel2Container="RTLCUSTOMER" style="table">
    <nonCacheable/> </f:function>::)
    declare function f1:CUSTOMER() as schema-element(t1:CUSTOMER)* external;
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="create" isPrimary="true" nativeName="CUSTOMER" nativeLevel2Container="RTLCUSTOMER" style="table">
    <nonCacheable/> </f:function>::)
    declare procedure f1:createCUSTOMER($p as element(t1:CUSTOMER)*)as schema-element(t1:CUSTOMER_KEY)* external;
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="update" isPrimary="true" nativeName="CUSTOMER" nativeLevel2Container="RTLCUSTOMER" style="table">
    <nonCacheable/> </f:function>::)
    declare procedure f1:updateCUSTOMER($p as changed-element(t1:CUSTOMER)*) as empty() external;
    (::pragma function <f:function xmlns:f="urn:annotations.ld.bea.com" visibility="public" kind="delete" isPrimary="true" nativeName="CUSTOMER" nativeLevel2Container="RTLCUSTOMER" style="table">
    <nonCacheable/> </f:function>::)
    declare procedure f1:deleteCUSTOMER($p as element(t1:CUSTOMER)*) as empty() external;
    (::pragma function <f:function kind="read" visibility="public" isPrimary="false" xmlns:f="urn:annotations.ld.bea.com"/>::)
    declare function f1:CUSTOMER_UPPER() as element(f1:CUSTOMER)*{
    for $CUSTOMER in f1:CUSTOMER()
    return
    <t1:CUSTOMER>
    <CUSTOMER_ID>{fn:data($CUSTOMER/CUSTOMER_ID)}</CUSTOMER_ID>
    <FIRST_NAME>{myd:MyUpper(fn:data($CUSTOMER/FIRST_NAME))}</FIRST_NAME>
    <LAST_NAME>{fn:data($CUSTOMER/LAST_NAME)}</LAST_NAME>
    <CUSTOMER_SINCE>{fn:data($CUSTOMER/CUSTOMER_SINCE)}</CUSTOMER_SINCE>
    <EMAIL_ADDRESS>{fn:data($CUSTOMER/EMAIL_ADDRESS)}</EMAIL_ADDRESS>
    <TELEPHONE_NUMBER>{fn:data($CUSTOMER/TELEPHONE_NUMBER)}</TELEPHONE_NUMBER>
    <SSN?>{fn:data($CUSTOMER/SSN)}</SSN>
    <BIRTH_DAY?>{fn:data($CUSTOMER/BIRTH_DAY)}</BIRTH_DAY>
    <DEFAULT_SHIP_METHOD?>{fn:data($CUSTOMER/DEFAULT_SHIP_METHOD)}</DEFAULT_SHIP_METHOD>
    <EMAIL_NOTIFICATION?>{fn:data($CUSTOMER/EMAIL_NOTIFICATION)}</EMAIL_NOTIFICATION>
    <NEWS_LETTTER?>{fn:data($CUSTOMER/NEWS_LETTTER)}</NEWS_LETTTER>
    <ONLINE_STATEMENT?>{fn:data($CUSTOMER/ONLINE_STATEMENT)}</ONLINE_STATEMENT>
    <LOGIN_ID?>{fn:data($CUSTOMER/LOGIN_ID)}</LOGIN_ID>
    </t1:CUSTOMER>
    xquery version "1.0" encoding "UTF-8";
    (::pragma xfl <x:xfl xmlns:x="urn:annotations.ld.bea.com">
    <creationDate>2010-10-14T13:10:45</creationDate>
    <customNativeFunctions>
    <relational>
    <dataSource>cgDataSource</dataSource>
    </relational>
    </customNativeFunctions>
    </x:xfl>::)
    declare namespace f1 = "ld:physical/MyDs";
    (::pragma function <f:function visibility="protected" kind="library" isPrimary="false" nativeName="UPPER" xmlns:f="urn:annotations.ld.bea.com">
    <nonCacheable/>
    </f:function>::)
    declare function f1:MyUpper($arg0 as xs:string?) as xs:string? external;
    <cus:CUSTOMER xmlns:cus="ld:physical/CUSTOMER">
    <CUSTOMER_ID>CUSTOMER1</CUSTOMER_ID>
    <FIRST_NAME>JACK</FIRST_NAME>
    <LAST_NAME>Black</LAST_NAME>
    <CUSTOMER_SINCE>2001-10-01</CUSTOMER_SINCE>
    <EMAIL_ADDRESS>[email protected]</EMAIL_ADDRESS>
    <TELEPHONE_NUMBER>2145134119</TELEPHONE_NUMBER>
    <SSN>295-13-4119</SSN>
    <BIRTH_DAY>1970-01-01</BIRTH_DAY>
    <DEFAULT_SHIP_METHOD>AIR</DEFAULT_SHIP_METHOD>
    <EMAIL_NOTIFICATION>1</EMAIL_NOTIFICATION>
    <NEWS_LETTTER>0</NEWS_LETTTER>
    <ONLINE_STATEMENT>1</ONLINE_STATEMENT>
    </cus:CUSTOMER>
    .

Maybe you are looking for