Interactive report from PL/SQL function

Hello All,
i have a pl/sql function that dynamically builds up a sql query and returns it as a varchar2.
when i create a new report then i can use this function in the report like
return f_function(param1,param2,v('APP_ID'), v('APP_SESSION'));
and this works fine.
Except i cannot create an interactive report for this function, because it is not allowed !!!!
So how can i use the function in an interactive report ?
Thanks in advance,
Marco

Marco,
Another rather extreme approach would be to go all the way and make your function pipelined (that is not only build but also execute the query) and then select from it in your interactive report.
The disadvantage here would be that any supplementary filtering would act on the result set of the function (not as an addition to the where clause of the original query). But if you can live with that...
The advantage would be that there's less fiddling with column headers.
Regards,
Iulian

Similar Messages

  • Interactive Report with PL/SQL Function Source

    Is it possible to create interactive report with PL/SQL function source returing a query? If not, has anyone done any work to simulate the interactive reporting feature for a normal report using API?

    I haven't tried that before but you could:
    1. create a collection from your result set returned by a dynamic query,
    2. create a view on that collection,
    3. use the view in your interactive report.
    The usability of this proposal depends from a question how "dynamic" your query is - does it always have the same number of columns or not.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • Interactive Reports and PL/SQL Functions

    Hi,
    Am new to the interactive reports, and it appears to be I can only use a single SELECT statement to populate the report.
    I need to convert some older reports to the new interactive reports, but these are populated using PL/SQL functions, as the WHERE clause is built up depending on the selection of items on the web page.
    How can I replicate this with the new interactive reports? Have used CASE statements within a SELECT statement before, can I also use these in a WHERE clause as well?
    Regards
    Simon

    To my knowledge, currently the only way to use Interactive Reports is on a static query. And unfortunately you can't use CASE statements in the WHERE clause of a query, only in the select list.
    The way I would (and have) attacked this is to:
    1. Write the base static query as the basis of the interactive report
    2. Access the interactive report in while logged in as a developer
    3. Build a filter (or set of filters) and save the report. You have the choice of saving it as a named report or as the default report.
    This gives the user one to many filter sets they can use as a starting point and tweak, and gives them examples as to how they can and should use the interactive filtering.
    Doug

  • Generating reports from PL/SQL

    I'm new to the world of BI Publisher - so far I'm impressed with what I've seen. I've managed to create a report and an RTF template and generate some nice looking PDF's :)
    What I need to do now is to have a nightly job that produces PDF shipment reports using my template for all new shipments generated during the day and I'm having a little difficulty putting it all together.
    I've looked at the BI Publisher API's that allow me to generate an XSL from my RTF template and the using the FO engine merge the XSL and XML data to produce the PDF. Then using the delivery manager API's I can send these reports out via email.
    I'm a little unsure of how to get the XML source - I've played around with the DataEngine API to generate XML from a SQL query so I think that's where I should be heading.
    Does this all sounds right ? Ideally, I want to be able to do all of this from within a scheduled PL/SQL job every night but all the interaction with the BI server seems to be via Java.
    Is there an easy(ish) way to run all of this from within PL/SQL ?
    And should I be going about this by:
    1/ generate XML data using dataengine API
    2/ create an RTF template using word and the xml data generated above
    3/ use the RTF processor to generate an XSL-FO from my RTF template
    (1-3 will only need to be done once)
    4/ Then my nightly job will use the dataengine to generate new shipment XML data
    5/ use FO processor to generate PDF's from each
    6/ use delivery manager API's to email out
    All sounds very cumbersome and intense -is there no easier way ?! :) Also, I'm thinking i should be using the bursting engine to split one query containing all the new shipment data and generate/mail a PDF for each shipment ? Is that necessary if all going to the same email address ?
    Help/guidance/suggestions greatly appreciated !
    Many thanks,
    Brent

    repost .... Has anyone successfully called BIP web services from within the database using Java stored procedures ?
    Still struggling to work out how to generate my reports from PL/SQL ! :((

  • Can I call a report from pl/sql?

    How can I call a report from pl/sql? I would like the output to be pdf and have it outputted to the screen?
    We are running Oracle 10g database and 10.1.2.3 application server on LInux Redhat 4.
    Thanks.
    Shirley
    Edited by: jonesfnalgov on Jul 12, 2011 2:17 PM
    Edited by: jonesfnalgov on Jul 12, 2011 2:18 PM

    Hello,
    a package is provided : srwAPIins.sql installs the Event-Driven Publishing API.
    http://download.oracle.com/docs/cd/B14099_17/bi.1012/b14048/pbr_evnt.htm
    The Event-Driven Publishing API is a PL/SQL package that provides the basic functions required for the development of procedures that respond to events in the database. Event-driven jobs are submitted using the HTTP protocol. The server assigns a unique job_ident record to every call, useful for tracking the status of the job.
    Regards

  • Invoking XML Publisher Report from PL/SQL

    Hi,
    I have a PL/SQL procecedure which invokes the Concurrent Request for the XML Publisher Report. This one finishes with a warning and I get 'Unable to publish output' when I try to view the output. Exact Error: "Unable to find the published output for this request "
    But if I run the same report using Concurrent program, the Report executes with no error. Also the desired output is coming. I am not sure where I am doing wrong in code.
    My code which invokes the XML Publisher Report (from PL/SQL package)is something like this:
    declare
    x boolean;
    l_no_of_copies varchar2(45);
    l_printername varchar2(45);
    l_print_style varchar2(45);
    l_result boolean;
    y number;
    begin
    x := fnd_request.add_layout (template_appl_name => 'XXTMG', template_code => 'XXT_5001_BOL_T', template_language => 'EN', template_territory => 'US', output_format => 'XML');
    l_no_of_copies := fnd_profile.VALUE ('XXTMG_SH_BOL_REPORT_NO_OF_COPIES');
    l_printername := fnd_profile.VALUE ('XXTMG_SH_BOL_REPORT_PRINTER');
    l_print_style := NULL; --For setting the Printer Options
    l_result := fnd_request.set_print_options (l_printername, l_print_style, l_no_of_copies, TRUE, 'N');
    l_result := fnd_request.add_printer (l_printername, 0);
    y := fnd_request.submit_request ('XXTMG', 'XXT_5001_BOL', '', TO_CHAR (SYSDATE, 'YYYY/MM/DD HH24:MI:SS'), FALSE, 'CH-120079') ;
    end;
    Please let me know where I might be going wrong
    Thanks

    Hi Sumit,
    You can try with this code:
    exec dbms_application_info.set_client_info(org_id)
    exec fnd_global.APPS_INITIALIZE(user_id,resp_id,appl_id);
    declare
    x boolean;
    l_no_of_copies varchar2(45);
    l_printername varchar2(45);
    l_print_style varchar2(45);
    l_result boolean;
    y number;
    begin
    x := fnd_request.add_layout ('XXTMG' --template_appl_name 
              ,'XXT_5001_BOL_T' --template_code
              ,'en' --template_language 
         ,'US' --template_territory
         ,'XML' --output_format
    if (x=TRUE) then
    y := fnd_request.submit_request (
                        'XXTMG'           --application 
                        ,'XXT_5001_BOL'      --program
                        ,SYSDATE          --start_time
                        ,FALSE               --sub_request
                        ,'CH-120079'          --argument1 (Program's Parameter)
    if y>0 then
              dbms_output.put_line('Request ID '||y);
    end if;
    end if; --if (x=TRUE) then
    end;
    Make sure that program has only one input parameter. If program has other parameters then you can pass those parameters like argument1, argument2... etc.
    Now you can see this submited request in your application using your user id. If you able to see your request in concurrent request then you can add printer parameters in this programs.
    You don't need to pass all 100 parameters.
    I am executing many programs/reports using this code.
    Thanks
    Ravi
    [email protected]
    Message was edited by:
    Ravi Tripathi

  • Execute report from pl/sql procedure

    hi all
    please, can i know whether there's any way to execute a report from pl/sql stored procedure??
    thank you.

    Hallo,
    usually you would use 21.1 The Event-Driven Publishing API
    You can search the forum for examples Google: site:forums.oracle.com call report from pl/sql
    Regards
    Marcus

  • Run report from PL/sql procedure

    Please any one tell how to I run a report from pl/sql procedure.

    I am not sure, but depending on your environment you can create a script to run your PL/SQL code and then generate the report. As is customary in an UNIX environment utilizing shell scripts.

  • Calling a report from pl/sql

    Is it possible to call a report from pl/sql. I want to create a package which when invoked by dbms_jobs will create parameters and then call a report.
    Thanks in advance,
    Mark.

    Mark,
    cf: http://download-uk.oracle.com/docs/cd/B10464_05/bi.904/b13673/pbr_evnt.htm#sthref1477
    Patrick.

  • Run multiple reports from PL/SQL

    I am planning to run reports from a PL/SQL batch program. My requirement is i need to generate multiple(around 50) reports with only a difference in one numeric parameter which will go from 1 to 50. I am planning to invoke the report inside a loop which goes from 1..50. I heard that i need to use a utl_http package which i havent used till now. Does somone has a sample code for running a report from pl/sql. i need it ASAP. Thanks in advance

    hi rejesh,
    we have an pl/sql API in reports to do exactly what you want to do.
    The Reports Event Driven Publishing API
    find the documentation including examples in the reports getting
    started on technet.
    http://otn.oracle.com/products/reports/htdocs/getstart/docs/a92102_01.pdf
    Chapter 11
    regards,
    christian

  • ERROR:SRW Packages to call report from PL/SQL.

    Hi,
    I am facing the following problem while calling a report from PL/SQL Block.
    This is my code
    SRW.Start_Debugging;
         MYPLIST :=SRW_PARAMLIST(SRW_PARAMETER('',''));
         SRW.ADD_PARAMETER(myPlist,'GATEWAY'     ,'http:..............');
         SRW.ADD_PARAMETER(myPlist,'USERID'      ,'CGIA_AUTO/AUTO_DEV@ipaddress/ORCL');
         SRW.ADD_PARAMETER(myPlist,'SERVER'      ,'rep_cgian');
         SRW.ADD_PARAMETER(myPlist,'REPORT'     ,'PGIRCGIC047.rdf');
         SRW.ADD_PARAMETER(myPlist,'DESTYPE'     ,'file');
         SRW.ADD_PARAMETER(myPlist,'DESFORMAT'     ,'pdf');
         SRW.ADD_PARAMETER(myPlist,'DESNAME'     ,'\\ipaddress\CGIA_FormPrint\WatchFolder\OTHERS\'||Z.CS_REMARKS_BL||'_'||Z.CS_CHQ_NO||'_'||M_SEQ_NO||'-'||Z.CS_FLEX_07||'-'||Z.CS_FLEX_08||'.pdf');
         SRW.ADD_PARAMETER(myPlist,'PARAMFORM'     ,'NO');
         SRW.ADD_PARAMETER(myPlist,'P_1'     ,Z.CS_BANK_CODE);
         SRW.ADD_PARAMETER(myPlist,'P_2'     ,Z.CS_BAD_ACNT_NO);
         SRW.ADD_PARAMETER(myPlist,'P_3'     ,Z.CS_CHQ_BOOK_ID);
         SRW.ADD_PARAMETER(myPlist,'P_4'     ,Z.CS_CHQ_NO);
         SRW.ADD_PARAMETER(myPlist,'P_5'     ,Z.CS_CHQ_NO);
         MYIDENT:=SRW.RUN_REPORT(MYPLIST);
    MYSTATUS := SRW.REPORT_STATUS(MYIDENT);
         SRW.STOP_DEBUGGING;
    *** Length of Paramlist : 1
    OK : Parameter added : GATEWAY=http://...
    *** Length of Paramlist : 2
    OK : Parameter added : USERID=CGIA_AUTO/AUTO_DEV@ipaddress/ORCL
    *** Length of Paramlist : 3
    OK : Parameter added : SERVER=rep_cgian
    *** Length of Paramlist : 4
    OK : Parameter added : REPORT=PGIRCGIC047.rdf
    *** Length of Paramlist : 5
    OK : Parameter added : DESTYPE=file
    *** Length of Paramlist : 6
    OK : Parameter added : DESFORMAT=pdf
    *** Length of Paramlist : 7
    OK : Parameter added :
    DESNAME=\\ipaddress\CGIA_FormPrint\WatchFolder\OTHERS\CUST000115_102024_16--.pd
    f
    *** Length of Paramlist : 8
    OK : Parameter added : PARAMFORM=NO
    *** Length of Paramlist : 9
    OK : Parameter added : P_1=SDNB
    *** Length of Paramlist : 10
    OK : Parameter added : P_2=7000674257
    *** Length of Paramlist : 11
    OK : Parameter added : P_3=7000
    *** Length of Paramlist : 12
    OK : Parameter added : P_4=102024
    *** Length of Paramlist : 13
    OK : Parameter added : P_5=102024
    Starting run_report: building url
    *** Building URL (RUN_REPORT)
    OK : URL built :
    http://ipaddress/reports/rwservlet?&USERID=CGIA_AUTO%2FAUTO_DEV%40ipaddress%2FORCL&SERVER=rep_cgian&REPORT=PGIRCGIC047.rdf&DESTYPE=file&DESFORMAT=
    pdf&DESNAME=%5C%5Cipaddress%5CCGIA_FormPrint%5CWatchFolder%5COTHERS%5CCUST00
    *** Submitting HTTP Request
    *** using URL
    :http://ipaddress/reports/rwservlet?&USERID=CGIA_AUTO%2FAUTO_DEV%ORCL&SERVER=rep_cgian&REPORT=PGIRCGIC047.rdf&DESTYPE=file&DESFORMAT
    =pdf&DESNAME=%5C%5Cipaddress%5CCGIA_FormPrint%5CWatchFolder%5COTHERS%5CCUST0001
    OK : Request submitted - Return stream : <?xml version = '1.0' encoding =
    'ISO-8859-1' standalone = 'yes'?>
    <serverQueues>
    <error code="503"
    component="REP" message="You did not specify the name of a
    report."/>
    </serverQueues>
    Here in this case even though i specify the report id in the parameter,debugger message says that 'You did not specify the name'.
    The same code is working in some other server and giving the pdf output.
    Thanks in advance for any clarification.

    Hello Chirag,
    If you want to invoke and run a report from your PL/SQL code in the database, you can do so by installing and using the SRW package supplied with Reports. This package allows you to run parametrized report jobs on a specified Reports Server from your PL/SQL program and track the job status. Please take a look at the documentation for this package in the Publishing Reports manual on OTN at: http://download-west.oracle.com/docs/html/A92102_01/toc.htm.
    On the other hand, if you just need to invoke the Reports Builder program from your PL/SQL routine, you would need to use the default builtin for calling external applications from PL/SQL.
    Thanks,
    The Oracle Reports Team.

  • How to Start report from pl sql procedure

    I need to create a procedure which runs report and email report output to specified email adress.
    I don't know how to start report from pl/sql. Any help will be appreciated.

    I want to start oracle report from plsql procedure. Is there any OS system command I can use or any other method? My database is installed on windows 2000 machine.

  • Run reports from pl/sql

    Hello, i want to run reports from pl/sql, how can i do it, i suppose i can use
    RWRUN60 with the appropiate parameters, but i don4t know how to execute RWRUN60 from pl/sql.
    Thanks in advance.

    Hi,
    I believe by mistake you posted the same question twice. See my response in the other one.
    Thanks,
    Rohit

  • Make Interactive report from Oracle Store Procedure returning SQL

    I have the following type of Report Region:
    Report Region Type:
    SQL Query (PL/SQL function body returning SQL query)
    Region Source:
    DECLARE
    q varchar2(4000);
    BEGIN
    GetMySQLString(:P22715_SID, q);
    return q;
    END;
    function GetMySQLString() return varchar2 is
    begin
    return 'select * from myTable';
    end GetMySQLString;
    For some reason though I can't figure out how to get it to work with an Interactive Report.... Basically I want the report to use the SQL returned by the Oracle Stored Function....
    Any thoughts?

    Should have searched better!
    Guess this should help: Calling Procedure or Function from Interative Report
    Edited by: tward on Sep 3, 2010 8:55 AM

  • Interactive Report based on a function returning SQL query?

    Hi guys!
    I'm wondering if the IR based on a function returning SQL query will be available on the final release of APEX 4.0..I can't see this functionality in EA1 and EA2 and I think it should be there..dont you think?
    With regards,
    PsmakR

    Hi!
    You're absolutely sure you're talking about the Interactive Report region and not about the default SQL Report region ?
    With regards,
    PsmakR

Maybe you are looking for