Report Builder: can i define a function in  the rdf file ?

Hi All,
About the report builder, can i define a function in the rdf file ? and then i want invoke it in the report SQL, just like :
function Get_Ap_Prepay_Balance(p_Invoice_Id IN NUMBER, p_End_Date IN DATE) RETURN NUMBER IS
l_Amount number;
begin
RETURN l_Amount;
end;
thanks.

You can create functions in reports, but slightly different from doing it in PL/SQL
function Get_Ap_Prepay_Balance return number is
l_Amount number;
begin
assuming that you have invoice_id in your select statement and p_End_Date is a report parameter, you can refer to them in your function as :p_End_Date and :invoice_id
for example select prepay_amount_remaining into l_Amount from ap_invoice_distributions where invoice_id = :invoice_id and accounting_date = :p_End_Date
return(l_Amount);
hope this helps

Similar Messages

  • Can I define a Function as part of the Report?

    In an Oracle Report, I want to define a Function, to use in the report query. I defined a Function CALC_DIFFERENCE under Program Units. It compiled OK.
    But when I tried to use this function in the query it get them message ORA-00904 “CALC_DIFFERENCE” invalid identifier.
    Can I define a Function as part of the Report? Or does it need to be on the database?
    Report Builder 9.0.4.0.33
    Thanks

    You have to put it in the database if you want to use it in your query. The reason is simple: the query runs in the database, so it won't see the function in the Report.
    If you really need the function in the report (because it uses other values only known in the report), you have to create a formula column.

  • Is it possible to define a function in the MathScript Node

    Is it possible to define a function in the MathScript Node

    You can not define a function inside of a MathScript Node, but only because it isn't necessary. The way custom functions work in MathScript is that they are saved in .m files located in paths in the MathScript path list. When the MathScript compiler receives a function that it doesn't recognize, then it searches for it in the path list, and upon finding it, compiles and loads the function. You can specify these search paths manually by going to File>>MathScript Preferences from the MathScript Window or dynamically by using the path() command within a script.
    To answer your original question, if you would like to create custom functions dynamically within a VI, then you can simply build your custom functions using strings and then save them to an ASCII file with the extension .m. You could either save the file to a path already in the MathScript path list or you could dynamically specify the path by passing the path into a MathScript Node as a string and by using the path() command at the beginning of your script to set it.
    Kind Regards,
    E. Sulzer
    Applications Engineer
    National Instruments

  • How to check the report builder version from the rdf file

    Hi,
    I have a rdf file but I don't the developer using which version of report builder to develop the rdf file. So, does anyone knows how to check the rdf file is developed by which version of report builder?
    When I try to use the notepad to open the rdf file, it shows the string "ROS.60050". So, does it means that the rdf file is developed by Oracle report 6i?
    Besides, do anyone knows if Oracle report 6i are still offer from Oralce (as I know, the latest verison of oracle report is 11g). So, in case Oralce not offer oracle 6i and I need to buy oracle report 11g, do u know it is compatiable or I need to do the migration from 6i to 11g?
    Thanks!

    Hi,
    The ROS version you are seeing in the RDF file does not mean the version where that RDF was developed. I am not aware of a way to check this but something that may help is that when you try to open a RDF developed in a higher version
    of Reports with a lower version of Reports builder the following warning will be displayed
    Warning. Opening a report saved with a newer version of Reports Builder.
    Functionality may be lost. Continue?
    "You tried to open a report with a version of Reports Builder older than the version used to
    create the report. If the report uses functionality unavailable in the older version, that
    functionality will be eliminated from the report.
    Regarding Oracle Developer 6i. This version is not supported any more. Regarding how to upgrade Reports 6i to 11g and what to have in mind during the upgrade please review the following documentation.
    References
    http://docs.oracle.com/cd/E24269_01/doc.11120/e24478/toc.htm
    How To Migrate Forms and Reports From 6i and/or 9i To 11g? (Doc ID 1275515.1)
    Hope it helps.
    Regards, RZ

  • How can i define a type in a .odl file?

    I'm trying to pass a c struct from a dll to Teststand and i dont know how to define a type into the .odl file. Somebody can send me a working code?

    Bruno,
    Detailed information on the items of your interest can be found at the following link:
    http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DE0956A4E034080020E74861&p_node=DZ52195&p_submitted=N&p_rank=&p_answer=&p_source=External
    Hope this helps,
    Silvius
    Silvius Iancu

  • How can I write new objects to the existing file with already written objec

    Hi,
    I've got a problem in my app.
    Namely, my app stores data as objects written to the files. Everything is OK, when I write some data (objects of a class defined by me) to the file (by using writeObject method from ObjectOutputStream) and then I'm reading it sequencially by the corresponding readObject method (from ObjectInputStream).
    Problems start when I add new objects to the already existing file (to the end of this file). Then, when I'm trying to read newly written data, I get an exception:
    java.io.StreamCorruptedException
    at java.io.ObjectInputStream.readObject0(Unknown Source)
    at java.io.ObjectInputStream.readObject(Unknown Source)
    Is there any method to avoid corrupting the stream? Maybe it is a silly problem, but I really can't cope with it! How can I write new objects to the existing file with already written objects?
    If anyone of you know something about this issue, please help!
    Jai

    Here is a piece of sample codes. You can save the bytes read from the object by invoking save(byte[] b), and load the last inserted object by invoking load.
    * Created on 2004-12-23
    package com.cpic.msgbus.monitor.util.cachequeue;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.RandomAccessFile;
    * @author elgs This is a very high performance implemention of Cache.
    public class StackCache implements Cache
        protected long             seed    = 0;
        protected RandomAccessFile raf;
        protected int              count;
        protected String           cacheDeviceName;
        protected Adapter          adapter;
        protected long             pointer = 0;
        protected File             f;
        public StackCache(String name) throws IOException
            cacheDeviceName = name;
            f = new File(Const.cacheHome + name);
            raf = new RandomAccessFile(f, "rw");
            if (raf.length() == 0)
                raf.writeLong(0L);
         * Whne the cache file is getting large in size and may there be fragments,
         * we should do a shrink.
        public synchronized void shrink() throws IOException
            int BUF = 8192;
            long pointer = getPointer();
            long size = pointer + 4;
            File temp = new File(Const.cacheHome + getCacheDeviceName() + ".shrink");
            FileInputStream in = new FileInputStream(f);
            FileOutputStream out = new FileOutputStream(temp);
            byte[] buf = new byte[BUF];
            long runs = size / BUF;
            int mode = (int) size % BUF;
            for (long l = 0; l < runs; ++l)
                in.read(buf);
                out.write(buf);
            in.read(buf, 0, mode);
            out.write(buf, 0, mode);
            out.flush();
            out.close();
            in.close();
            raf.close();
            f.delete();
            temp.renameTo(f);
            raf = new RandomAccessFile(f, "rw");
        private synchronized long getPointer() throws IOException
            long l = raf.getFilePointer();
            raf.seek(0);
            long pointer = raf.readLong();
            raf.seek(l);
            return pointer < 8 ? 4 : pointer;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#load()
        public synchronized byte[] load() throws IOException
            pointer = getPointer();
            if (pointer < 8)
                return null;
            raf.seek(pointer);
            int length = raf.readInt();
            pointer = pointer - length - 4;
            raf.seek(0);
            raf.writeLong(pointer);
            byte[] b = new byte[length];
            raf.seek(pointer + 4);
            raf.read(b);
            --count;
            return b;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#save(byte[])
        public synchronized void save(byte[] b) throws IOException
            pointer = getPointer();
            int length = b.length;
            pointer += 4;
            raf.seek(pointer);
            raf.write(b);
            raf.writeInt(length);
            pointer = raf.getFilePointer() - 4;
            raf.seek(0);
            raf.writeLong(pointer);
            ++count;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#getCachedObjectsCount()
        public synchronized int getCachedObjectsCount()
            return count;
         * (non-Javadoc)
         * @see com.cpic.msgbus.monitor.util.cachequeue.Cache#getCacheDeviceName()
        public String getCacheDeviceName()
            return cacheDeviceName;
    }

  • When I try to same an image under the command 'save as' it will only let me save as file types 'firefox document' or 'all files' and when I try to look at them later they dont work. How can I save an image as the same file type it is on the web site?!

    When I try to save an image under the command 'save as' it will only let me save as file types 'firefox document' or 'all files' and when I try to look at them later they dont work. How can I save an image as the same file type it is on the web site?!
    == This happened ==
    Every time Firefox opened
    == I updated to one of the firefox versions (Not sure which one it was)

    Thanks Alex, but sadly I already tried that. Neither .docx or .xlsx files show up in the content list. They both show as a Chrome HTML document so changing how Firefox addresses those doesn't help since it thinks its the same type of file. I don't think I can manually add files into the "Content Type" left side nav.

  • How can I find a photo from the backup file in my pc?

    How can I find a photo from the backup file in my pc?
    I have accidentally erased a photo. It happened after the backup.

    I am not aware you can extract a single photo or a single app's content from the backup, you can either restore the whole backup to your phone or not restore. If you restore your last backup to your phone then any content that is currently on your phone will be replaced with what was on it at the time that the backup was made - so if you do decide to restore, first copy off any purchases to your computer's iTunes via File > Transfer Purchases, and copy any documents/files that you've udpated on the phone since the backup.

  • In Windows 8, how can I see an image of the psd file instead of the Photoshop icon?

    In Windows 8, how can I see an image of the psd file instead of the Photoshop icon?

    There are a number of third party solutions for this.  I just use Bridge, so can't recommend one in particular.

  • How can I check the version of the rdf file?

    Dear all:
    How can I check the version of the rdf file? such like CEXRECRE.rdf .
    my environment is : oracle 11.5.9
    platform : Linux red hat 4.0
    Regards
    Terry

    Terry,
    Use "adident" or "strings -a" commands -- See (Note: 125922.1 - How To Find Oracle Application File Versions) for details.
    Thanks,
    Hussein

  • I download autocad 2010 with crack, how can i install it with crack coz i can't find where to paste the crack file? not like windows just go to drive c, progarms and click the installed folder and you can copy and paste the crack file.

    i download autocad 2010 with crack, how can i install it with crack coz i can't find where to paste the crack file? not like windows just go to drive c, progarms and click the installed folder and you can copy and paste the crack file.
    please help me..
    thanks

    No one here will help you.
    You should definitely ask your question in this forum:
    http://forums.autodesk.com/t5/AutoCAD-2010/bd-p/360

  • Report Builder 6i not recognizing analytic functions

    Hi all, in an attempt to speed up a very slow query, I applied analytic function to it. I can save the query in report builder with no problems, however, I cannot create data links between this query and others. After I comment out the analytic function, data links can be made. My colleague said Report Builder 6i is too old so it can only recognize ANSI SQL syntax. Since our DB server is using Oracle 10gR2, is there a way for Report Builder to recognize and compile Oracle 10g syntax?
    Many thanks.

    Hello,
    Your colleague is right. Even if the SQL query is executed by the DB server , Reports needs to parse the SQL query.
    The SQL parser included in Reports 6i is based on 8.0.6
    You can see this version in the Reports Builder help :
    Menu : Help -> About Reports Builder ...
    ORACLE Server Release 8.0.6.0.0
    Regards

  • Can we define a function in a sub process?

    Hi ,
    I want to know whether we can define a function in a sub-process ? coz I see only notifications defined in the sub_process in seeded oracle workflows .
    also highlight if we are the running the workflow from developer studio do we need call the main process first or the sub-process first ?
    Regards,
    Shashk

    Hello Shashk,
    Yes functions can be used in sub-processes. If you are creating a custom function, it must be defined in a specific fashion to work with WF. See the Workflow Developer Guide for your version. 2.6.2 available here:
    [http://download.oracle.com/docs/cd/B10501_01/workflow.920/a95265/toc.htm|http://download.oracle.com/docs/cd/B10501_01/workflow.920/a95265/toc.htm]
    Not sure about Developer Studio per se but typically you can run any process in a workflow that is marked 'runnable'.
    - James

  • Report Builder: Can I use a prompt filter in multiple ways?

    Hi,
    I'm new to Report Builder 3, which we use at my office for a number of custom made reports to access our project management server. On one of these we basically want to allow the user to pick a date, and then see all historic data before that date,
    and all forecast data after that date.
    Thus far the only way we can achieve this is by adding a prompt filter on a date at the field filter level; but as one of these is a
    before X and another is on or after X this creates two input filter prompts, and in some cases we end up needing the user to put the same date in 4 separate input fields!
    Does anyone know a way around this - I basically want to allow them to input a single variable date, and then be allowed to filter that in different ways.
    Thanks,
    James

    "adding a prompt filter on a date at the field filter level"
    Not sure what you mean by that. All you should need to do is create the parameter in the report as a Date/time type parameter; I will call it @FocusDate. If you have 2 datasets, HistoricalData and ForecastData, you would set the parameter in the filter criteria.
    If both are SQL queries then:
    HistoricalData:
    SELECT [field list] FROM history WHERE history.Date < @FocusDate
    ForecastData:
    SELECT [field list] FROM forecast WHERE forecast.Date > @FocusDate
    I am guessing this is not your scenario so I will need more information. Are you using the parameter to filter the data in a tablix (table, list, matrix) instead of the dataset query? Are you trying to display both historical and forecast data in the same
    tablix? If so is the data in  single dataset?
    "You will find a fortune, though it will not be the one you seek." -
    Blind Seer, O Brother Where Art Thou
    Please Mark posts as answers or helpful so that others may find the fortune they seek.

  • Report Builder can't setup RDS

    When trying to setup RDS in the report builder for CF8 I get
    an http 1.1 404 Object not found error.
    Windows authentication is off and I can use RDS with
    Dreamweaver.
    Any thoughts?

    Try and temporarily turn off Windows Integrated
    Authentication.
    If it works, double-check to be sure you turned it off for
    the CFIDE directory permanently.

Maybe you are looking for

  • Mid-2012 MacBook Air WiFi Reconnect-Partial Solution

    The MacBook Air seems to have some significant WiFi issues for a lot of users. My issue is as follows: the MacBook will connect to any compatible WiFi hot-spot with no problems, and it will maintain the connection almost always. The problems come whe

  • How to clear all overrides in a story

    Hi Everyone! I've been putting together a short script to clear all overrides in a story in which I have a cursor inserted. This is what I have so far: //Clear all overrides in the story of the text selection: app.selection[0].paragraphs.everyItem().

  • Sending HTML Mails using SO_DOCUMENT_SEND_API1

    Dear all, we were using SO_DOCUMENT_SEND_API1 to send plain text e-mail replies to participants of an incentive program. Now the customer wants to send HTML mails. Customer has provided HTML templates for the mails, and the text always is the same, o

  • How can I do to display the imported pictures' effects on my PC ?

    I took some pictures with my iPhone with an effect (black and white for example). Then I imported them to my computer and the pictures in black and white were on my computer without effect (in colour) ! As if I didn't take them in black and white but

  • While loading data Runtime error MOVE_TO_LIT_NOTALLOWED_NODATA

    Dear Masters   While loading data from r/3 to PSA only, I am getting below error Error message from the source system Diagnosis An error occurred in the source system. System Response Caller 09 contains an error message. Further analysis: The error o