Pl/sql procedure in XML Data Template.

Hi
I have a procedure , which is returning a ref cursor , i need to use this ref cursor in xml data templete . how we will write this data templete.
Also how to call the procedure in data templete.
Please guide me.
SS

If it's function you can call it direct, Procedure all you need to do is to wrap the procedure around a function and call that function which return the ref cursor
For example :
I have getdept procedure which has OUT ref cursor, I will wrap this with
get_dept function which return the ref Cursor then
<sqlStatement name="Q1">
<![CDATA[SELECT get_dept(:p1,:p2,....) dept from dual]]>
</sqlStatement>

Similar Messages

  • How to call a PL/SQL procedure from a xml Data Template

    We have a requirement in which we need to call a pl/sql package.(dot)procedure from a Data Template of XML Publisher.
    we have registered a Data Template & a RTF Template in the XML Publisher Responsibility in the Oracle 11.5.10 instance(Front End).
    In the Data Query part of the Data Template , we have to get the data from a Custom View.
    This view needs to be populated by a PL/SQL procedure.And this procedure needs to be called from this Data Template only.
    Can anybody suggest the solution.
    Thanks,
    Sachin

    Call the procecure in the After Parameter Form trigger, which can be scripted in the Data Template.
    BTW, there is a specialized XML Publisher forum:
    BI Publisher

  • XML Publisher Datasource XML Data Template

    Hello,
    I am trying to create function (Program Units) in my XML Data template, I get the following ERROR.
    XX Custom Application: Version : UNKNOWN
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    XXTESTNEW module: XX TEST Report-New
    Current system time is 13-JUL-2012 15:34:09
    0.197: [GC 0.197: [DefNew: 1777K->191K(1984K), 0.0042507 secs] 1777K->242K(6080K), 0.0043329 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    0.330: [GC 0.330: [DefNew: 1983K->44K(1984K), 0.0054729 secs] 2034K->282K(6080K), 0.0055303 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
    0.536: [GC 0.536: [DefNew: 1836K->192K(1984K), 0.0053814 secs] 2074K->591K(6080K), 0.0054403 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
    0.695: [GC 0.695: [DefNew: 1984K->138K(1984K), 0.0036150 secs] 2383K->711K(6080K), 0.0036667 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
    0.969: [GC 0.969: [DefNew: 1930K->92K(1984K), 0.0050182 secs] 2503K->802K(6080K), 0.0050735 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
    1.453: [GC 1.453: [DefNew: 1884K->192K(1984K), 0.0049133 secs] 2594K->1247K(6080K), 0.0049730 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
    1.493: [GC 1.493: [DefNew: 1962K->58K(1984K), 0.0025240 secs] 3018K->1301K(6080K), 0.0025808 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
    1.501: [GC 1.501: [DefNew: 1847K->93K(1984K), 0.0014896 secs] 3090K->1337K(6080K), 0.0015390 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.507: [GC 1.507: [DefNew: 1860K->70K(1984K), 0.0006978 secs] 3103K->1313K(6080K), 0.0007453 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.514: [GC 1.514: [DefNew: 1849K->103K(1984K), 0.0004474 secs] 3093K->1346K(6080K), 0.0004883 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.595: [GC 1.596: [DefNew: 1895K->138K(1984K), 0.0020285 secs] 3138K->1437K(6080K), 0.0020863 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
    1.673: [GC 1.673: [DefNew: 1930K->64K(1984K), 0.0014510 secs] 3229K->1496K(6080K), 0.0015049 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.759: [GC 1.759: [DefNew: 1856K->98K(1984K), 0.0014301 secs] 3288K->1530K(6080K), 0.0014835 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.827: [GC 1.827: [DefNew: 1890K->89K(1984K), 0.0010782 secs] 3322K->1572K(6080K), 0.0011340 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.880: [GC 1.880: [DefNew: 1881K->133K(1984K), 0.0011918 secs] 3364K->1616K(6080K), 0.0012450 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.936: [GC 1.936: [DefNew: 1925K->113K(1984K), 0.0012641 secs] 3408K->1670K(6080K), 0.0013197 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    1.990: [GC 1.990: [DefNew: 1905K->191K(1984K), 0.0022812 secs] 3462K->1976K(6080K), 0.0023401 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
    XDO Data Engine Version No: 5.6.3
    Resp: 23202
    Org ID : 43
    Request ID: 22637028
    All Parameters:
    Data Template Code: XXTESTNEW
    Data Template Application Short Name: XX
    Debug Flag: N
    2.161: [GC 2.161: [DefNew: 1983K->192K(1984K), 0.0036382 secs] 3768K->2170K(6080K), 0.0036949 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
    Calling XDO Data Engine...
    2.289: [GC 2.289: [DefNew: 1984K->192K(1984K), 0.0036540 secs] 3962K->2475K(6080K), 0.0037115 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
    [071312_033411511][][EXCEPTION] java.lang.NullPointerException
         at oracle.apps.xdo.dataengine.DataTemplateParser.GetNodeNumChildren(DataTemplateParser.java:334)
         at oracle.apps.xdo.dataengine.DataTemplateParser.templateParser(DataTemplateParser.java:266)
         at oracle.apps.xdo.dataengine.XMLPGEN.setDataTemplate(XMLPGEN.java:140)
         at oracle.apps.xdo.dataengine.DataProcessor.setDataTemplate(DataProcessor.java:193)
         at oracle.apps.xdo.oa.util.DataTemplate.<init>(DataTemplate.java:245)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:282)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
    2.394: [GC 2.394: [DefNew: 1365K->143K(1984K), 0.0025966 secs]2.397: [Tenured: 2451K->2381K(4096K), 0.0798821 secs] 3648K->2381K(6080K), 0.0825759 secs] [Times: user=0.08 sys=0.01, real=0.08 secs]
    java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
         at com.sun.java.util.collections.ArrayList.RangeCheck(ArrayList.java:492)
         at com.sun.java.util.collections.ArrayList.get(ArrayList.java:306)
         at oracle.apps.xdo.dataengine.DataTemplateParser.getParentDataSource(DataTemplateParser.java:1796)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeDefaultGroup(XMLPGEN.java:331)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeGroupStructure(XMLPGEN.java:286)
         at oracle.apps.xdo.dataengine.XMLPGEN.processData(XMLPGEN.java:273)
         at oracle.apps.xdo.dataengine.XMLPGEN.processXML(XMLPGEN.java:215)
         at oracle.apps.xdo.dataengine.XMLPGEN.writeXML(XMLPGEN.java:254)
         at oracle.apps.xdo.dataengine.DataProcessor.processDataStructre(DataProcessor.java:390)
         at oracle.apps.xdo.dataengine.DataProcessor.processData(DataProcessor.java:355)
         at oracle.apps.xdo.oa.util.DataTemplate.processData(DataTemplate.java:348)
         at oracle.apps.xdo.oa.cp.JCP4XDODataEngine.runProgram(JCP4XDODataEngine.java:293)
         at oracle.apps.fnd.cp.request.Run.main(Run.java:161)
    Heap
    def new generation total 1984K, used 250K [0xcc400000, 0xcc620000, 0xccb10000)
    eden space 1792K, 13% used [0xcc400000, 0xcc43ea98, 0xcc5c0000)
    from space 192K, 0% used [0xcc5c0000, 0xcc5c0000, 0xcc5f0000)
    to space 192K, 0% used [0xcc5f0000, 0xcc5f0000, 0xcc620000)
    tenured generation total 6104K, used 4381K [0xccb10000, 0xcd106000, 0xd0400000)
    the space 6104K, 71% used [0xccb10000, 0xccf57598, 0xccf57600, 0xcd106000)
    compacting perm gen total 12288K, used 7039K [0xd0400000, 0xd1000000, 0xd8400000)
    the space 12288K, 57% used [0xd0400000, 0xd0adfc88, 0xd0adfe00, 0xd1000000)
    ro space 8192K, 80% used [0xd8400000, 0xd8a73430, 0xd8a73600, 0xd8c00000)
    rw space 12288K, 59% used [0xd8c00000, 0xd9330510, 0xd9330600, 0xd9800000)
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Executing request completion options...
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 13-JUL-2012 15:34:11
    Please see the following Data Template, I have copied the folloing
    <report name="anyname" DTDVersion="9.0.2.0.0">
    <data>
    <dataSource name="Q_1">
    <select>
    select 1 EMPLOYEE_ID, 'FIRST_NAME' FIRST_NAME,'LAST_NAME' LAST_NAME, 1 DEPARTMENT_ID ,2 SALARY, 2 COMMISSION_PCT from dual
    </select>
    <group name="G_EMPLOYEES">
    <dataItem name="EMPLOYEE_ID"/>
    <dataItem name="FIRST_NAME"/>
    <dataItem name="LAST_NAME"/>
    <dataItem name="HIRE_DATE"/>
    <dataItem name="SALARY"/>
    <dataItem name="COMMISSION_PCT"/>
    <dataItem name="DEPARTMENT_ID"/>
    <formula name="CF_REMUNERATION" source="cf_1formula"
    datatype="number" width="20" precision="10"/>
    </group>
    </dataSource>
    <summary name="CS_REPORT_LEVEL_SUMMARY" function="sum" width="20"
    precision="10" reset="report" compute="report"/>
    </data>
    <programUnits>
    <function name="cf_1formula" returnType="number">
    <textSource>
    <![CDATA[
    function CF_1Formula return Number is
    begin
    return (:salary + nvl(:commission_pct,0));
    end;
    ]]>
    </textSource>
    </function>
    </programUnits>
    </report>
    Note:
    I have taken this from the following documentation.
    http://docs.oracle.com/cd/E12839_01/bi.1111/b32121/pbr_xml003.htm
    Regards
    Ed

    Hi,
    To me it seems that format is used in BI Publisher usined iN OBI and not Oracle XML Publisher.
    Why dont you try to get the value in sql itself like (:salary + :pct_cimssion) as abcd

  • Creating Web service for PL/SQL Procedure with Complex Data Types

    I need to created web service for PL/SQL Procedure with Complex Data types like table of records as parameters, how do we map the pl/sql table type parameters with web service, how to go about these?

    Hello,
    When you are creating a service from a Stored Procedure, the OracleAS WS tools will create necessary Java and PL wrapper code to handle the complex types (table of record) properly and make them compatible with XML format for SOAP messages.
    So what you should do is to use JDeveloper or WSA command line, to create a service from your store procedure and you will see that most of the work will be done for you.
    You can find more information in the:
    - Developing Web Services that Expose Database Resources
    chapter of the Web Service Developer's guide.
    Regards
    Tugdual Grall

  • Parameter Passing from Concurrent Program to XML Data Template

    Hi All,
    I have a xml data template which is attached to a data definition. The data template contains a SQL query and some parameter definitions. One of the parameters is p_emp_id. The data type of the parameter is "number" and the where clause that uses the parameter is as follows:
    AND employee_id in (:p_emp_id,DECODE(:p_emp_id,126,130,-99).
    The data definition is attached to a concurrent program which has a parameter based on a valueset. Format type of valueset is char. Validation type is table. Inside the table definition, the table is employees. value column is emp_name type is char. meaning column is emp_name type is char. ID column is emp_id type is number.
    The above where clause condition fails when the conc program is run. In the log file I can see that the value passed is 126 from the valueset. If the query is run independently in TOAD and value passed is 126, the where clause returns rows.
    Kindly let me know what could be the possible issue. Let me know if the question is not clear enough.
    Thanks,
    Amit

    Hi Ashish,
    Thanks for replying.
    I mentioned that the Id column of the VSet is emp_id right ? Isn't the Id column value passed ?
    Moreover I also mentioned that I could see in the log file that the emp_id value is being passed and not the name. I could see in the log file p_emp_id=126. There seems to be some problem with the data types and all.
    Thanks,
    Amit

  • Report Based on XML Data Template is timing out

    Hi there,
    i have an XML publisher report based on an XML data template that i've written. The report is working fine except when there is huge data that is supposed to come out, its timing out. Ive set the db_fetch_size parameter to 20 and scalable_mode to on but its still timing out.
    If anyone has a solutiom or a thought it would be much appreciated.
    Thanks.

    Thanks for the reply.
    Well when i'm opening the report , i wait for about 15 seconds then 'Page Cannot be Displayed' appears on my browser. I'm having this case only when i'm expecting huge data. By huge data i mean that the report gets informations about a deal, when the deal has 10 categories the report runs fine, but when i add all catgories, about 1000, it gives me the 'Page cannot be displayed' error. I'm guessing its a time out issue since i've set the scalable_mode parameter to on. Any thoughts ???

  • Is it possible to use an XML Data Template to create a report in APEX?

    Hi,
    I have created an XML Data Template in BI Publisher passing one parameter and running two queries, then created an RTF Document Template to present the data.
    I can create a nice report in BI Publisher using the two elements. I have used RTF Document Templates to publish reports in APEX but the data comes from a Report region running a single query.
    I would like to run a report based in this kind of XML Data Template, in order to use several children queries related to a parent query. Is it possible to do it in APEX, or you have to use BI Publisher?
    Francisco
    ===========================
    Below is a simple data template definition:
    <dataTemplate name="cotizacion_template" description="Prueba de data template para cotizaciones" dataSourceRef="dbxprts">
         <parameters>
              <parameter name="p_id_cotizacion" dataType="character" defaultValue="1009" include_in_output="true"/>
         </parameters>
         <dataQuery>
              <sqlStatement name="header_query">
                   <![CDATA[select id_cotizacion, fecha_cotizacion, id_clipro from f_cotizaciones where id_cotizacion = :p_id_cotizacion]]>
              </sqlStatement>
              <sqlStatement name="detail_query">
                   <![CDATA[select id_cotizacion as id_cot_child, id_detalle_cotizacion, partida, cantidad, id_producto from f_detalle_cotizaciones where id_cotizacion = :id_cotizacion]]>
              </sqlStatement>
         </dataQuery>
         <dataStructure>
              <group name="F_COTIZACIONES" source="header_query">
                   <element name="ID_COTIZACION" value="ID_COTIZACION"/>
                   <element name="ID_CLIPRO" value="ID_CLIPRO"/>
                   <element name="SUMA_CANTIDAD" value="F_DETALLE_COTIZACIONES.CANTIDAD" function="SUM()"/>
                   <group name="F_DETALLE_COTIZACIONES" source="detail_query">
                        <element name="PARTIDA" value="PARTIDA"/>
                        <element name="CANTIDAD" value="CANTIDAD"/>
                        <element name="ID_PRODUCTO" value="ID_PRODUCTO"/>
                   </group>
              </group>
         </dataStructure>
    </dataTemplate>

    Hi,
    I have the similar question. I used data templates in BI Publisher but now I want to use the same data template in Apex to print some reports.
    I tried to some examples but these were only using report queries. I also tried with the Web Service but this didn't work for me either maybe because I didn't
    used it in the right way. When I used the WS I received the binary of the report so the WS worked it was just the how and where to use it that didn't work for me.
    Now this older entry is BUMPED maybe we find a solution for our problem this way.
    regards,
    Steven

  • The file should be in XML-DATA-TEMPLATE format

    Hi,
    When I am trying to upload the Data Definition file in XML publisher with EBS 11.5.10.2, I got "The uploaded file GLPAYBDXDO.xml is invalid. The file should be in XML-DATA-TEMPLATE format". I have tried changing the file name to different names including XML-DATA-TEMPLATE but I could not succeed. I appreciate for any help.
    Thanks,
    Ram.

    What is the content of your xml file. Is this sample xml file or Data Template.

  • Data template is invalid. Should be in XML-DATA-TEMPLATE format.

    Hi,
    I am trying to create & upload a Data Template for a Data Definition in XML Publisher. When I try to upload my data template, it shows me the error :-
    " The uploaded file PAFPURUP_TEMPLATE.xml is invalid. The file should be in XML-DATA-TEMPLATE format. "
    Can any please suggest me a possible resolution to this error? Below is my data template content :-
    <?xml version="1.0" encoding="WINDOWS-1252" ?>
    <dataTemplate name="PAFPURUP_TEMPLATE" description="Data template for PAFPURUP" defaultPackage="PA_PAFPURUP_PKG" version="1.0">
    <parameters>
    <parameter name ="count" dataType="character" defaultValue="10"/>
    </parameters>
    <dataQuery>
    <sqlStatement name="Q1">
    <![CDATA[SELECT BUDGET_VERSION_ID, VERSION_NAME FROM PA_BUDGET_VERSIONS WHERE ROWNUM <= :count]]>
    </sqlStatement>
    </dataQuery>
    <dataTrigger name="beforeReport" source="PA_PAFPURUP_PKG.beforeReportTrigger"/>
    <dataStructure>
    <group name ="G_BUDGET_VERSIONS" source="Q1">
    <element name="Budget_Version_Id" value="budget_version_id"/>
    <element name="Version_Name" value="version_name"/>
    </group>
    </dataStructure>
    </dataTemplate>
    Many Thanks,
    Niranjan

    Hi Fred,
    Thanks for your response. The issue was actually with the xml format. I had missed '?' at the end of 1st line of the xml.
    Regards,
    Niranjan

  • Need XML data template info

    We are using a xml data template that generates an output file which is also a .xml... how can I archive this output file by making changes in the data template xml.

    Edit the query in data template

  • Formulas in XML data template

    Hi All,
    I am unable to keep some formulas in xml data template.
    My exact requirement:
    I want to keep some formula columns in xml data template so that i can show them in rtf.
    I have 6 columns
    1. ename
    2. dept
    3. job
    4. salary
    5. salary deposited till current year ( this is a formula column)
    6. total salary ( this is a formula column ==> salary * comm)
    I am able to keep all the 4 columns and data is being displayed correctly. But i am not knowing where and how to keep the below columns *(i.e., 5 & 6)
    Glad if anyone can provide me with some examples how to keep formula columns in xml data template
    Thanks

    user9092293,
    when you mean "unable to keep column formulas" in data template!!! are you not able to refer to them within the data structure element?? or are you trying to calculate them in the group elements and not able to???
    If you could explain further it might helps us visualize your issue....
    thanks
    -bifacts

  • I cant call a procedure within a data template

    Hi,
    I m working in a data template because i want to call a prcedure befor running the report.
    My procedure is under the folder of procedure. it is not under a package.
    So i left the defaultpackage empty in the data model.
    *<dataTemplate name="Extraction_Template" dataSourceRef="mydatasource" defaultPackage="">*
    But it didsn't work.
    Help.
    SAAD

    The default package attribute is required if your data template contains any other calls to PL/SQL. For the source attribute for the data trigger definition, you need to have the source in the form of <package name>.<function name>
    Check out the report designer's guide for details.
    Thanks,
    BIPuser

  • PL/SQL procedure to insert data doesn't work and unable to find reason.

    Sorry that I couldn't find the best place to post this question. It seems that the forum does not deal with this kind of question. I post here for help.
    I have a stored procedure to insert data into one table. SP was compiled without error and executed without error (from log table to get information). But the data was not inserted into
    the target table. I have tried different way to figure out the reason. But I failed to get any idea. Please help me to find possible reasons. The smple SP looks like this:
    CREATE OR REPLACE PROCEDURE my.sp_insert( P_DATE IN VARCHAR2)
    IS
    declare section
    begin
    insert into target_table (column1, column2, column3, column4)
    select record1, record2, record3, record4 from table1, table2, table3, table4
    where clause;
    commit;
    exception section
    UPDATE PROCESS_LOG_TABLE CLAUSE;
    html_email section;
    rollback;
    end my.sp_insert
    I have tested that "select record1, record2, record3, record4 from table1, table2, table3, table4" really fetch the 7,000 records. and if I only run part of SQL from SQLPLUS as
    insert into target_table (column1, column2, column3, column4)
    select record1, record2, record3, record4 from table1, table2, table3, table4
    where clause;
    It will work and insert 7,000 records into target table. Why did it not insert into target_table when execiting as stored procedure? Please help with your input. Thanks.
    Edited by: citicbj on Feb 12, 2013 4:15 PM

    Dear Friend,
    Is the user from which you created database procedure and sqlplus that you tested the code successfully is same?
    Regards
    Ahamed Rafeeque Cherkala

  • Setting pl/sql procedure as the data source in a Report Query

    Is there a way to set PL/SQL as the data source in a Report Query? we want to
    able to use the ReportQuery function and query results returned by a PL/SQL procedure.
    thanks

    Not exactly sure what you want to do, but on a ReportQuery you can set either a StoredProcedureCall, or an SQLCall.
    query.setCall(new StoredProcedureCall(...));
    query.setCall(new SQLCall("begin; my_proc(); end"));
    Now, a stored procedure in Oracle cannot return a result, so using a ReportQuery which requires a result may not make sense.
    You could instead use a DataModifyQuery.
    If you return results through output parameters (you must use a StoredProcedureCall for this) you could use a DataReadQuery or a ReadAllQuery/ReportQuery if you wish to build objects from the data.
    James : http://www.eclipselink.org

  • Dynamic SQL in non oracle Data Template

    Hi All
    I am currently working on a project with BI Publisher and we are developing on an OBIEE data source using data templates.
    Does anyone know how to handle dynamic sql &Lexicals when your only data source is OBIEE.
    I have found some code in the help which doesn't seem to work.
    {$ if ${P_COUNTRY} = '*,*' $}
    WHERE "Customers"."Country" in (&P_COUNTRY)
    {$ elsif ${P_COUNTRY} = '*' $}
    WHERE "Customers"."Country" = :P_COUNTRY
    {$ else $}
    {$ endif $}
    Thanks
    Andy

    Hi Andy,
    If you are using Answers as data source, Dynamic query is not possible.

Maybe you are looking for

  • HP LaserJet 4350dtnsl, on Windows 7 x64 RDP to 2003 server

    Hi,  I have a client with  HP LaserJet 4350dtnsl network attached and accessed from a Windows 7 x64. They RDP to a server 2003 server via VPN and the printer will not push to the remote session. They also have a network Colour 3600 which works fine. 

  • Safari and Windows Media Player & pdf

    Since the Beta version, whenever I launch a file that requires Windows Media Player, Safari quits. This also happens when I try and download a pdf file. Any help out there? Thanks in advance.

  • Project specific keyword creation problem

    Hi All I am facing a strange problem, here I am trying to explain, When we create a project with solar_project_admin If we add an new “keyword” in Complete directory of keywords in Change project template, and select the new keyword, transfer it into

  • DOCTYPE and window scrolling break mouse capture positioning in IE6/IE8

    If I specify the DOCTYPE header in my html page the following bug is observed: If you scroll the browser window down using the scroll wheel or the scroll bar and click on the map, the position is recorded with a vertical offset of the amount in which

  • AVG and flashplayer

    My AVG will not allow me to download flashplayer - it reports that it is a corrupted executable file.  The details given are "..........Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5\OWMATMO\install-flashplayer15x32ax-mssd-awe-aih[2