Creating Excel Workbook from PL/SQL Procedure

I am trying to create Excel Workbook with two worksheets from PL/SQL procedure. I created one worksheet. Can I create a separate sheet from same procedure. I used OWA_UTIL.MIME_HEADER ('application/vnd.ms-excel', FALSE)
command to create the spreadsheet.
Any help would be helpful.
Thanks
Yagna Shah

Further to my previous post here is how I will develop a typical master details excel report.
by using the package,
It will also show sum of salary at each department.
Note : When I paste the code here I loose the indentation. So the code below is not indented properly.
DECLARE
r NUMBER := 0 ; --- r IS the ROW NUMBER IN this excel file
l_sum NUMBER ;
BEGIN
--- Generate the styles that we need
gen_xl_xml.create_excel( 'UTL_DIR','master_Detail.xls') ;
gen_xl_xml.create_style( 'dept_title' , 'Arial', 'Red',14, p_backcolor => 'LightGray' );
gen_xl_xml.create_style( 'sgs2' , 'Arial', NULL ,10, p_bold => TRUE );
gen_xl_xml.create_style( 'sgs3' , 'Arial', 'blue',14 );
gen_xl_xml.create_style( 'sgs4' , 'Arial', 'green',14 );
gen_xl_xml.create_style( 'emp_title' , 'Arial', 'Black',9, p_backcolor => 'LightBlue' );
gen_xl_xml.create_style( 'sal_tot' , 'Arial', 'Brown',13, p_backcolor => 'Yellow' );
-- SET ANY COLUMN AND ROW changes
gen_xl_xml.set_column_width( 3, 145 );
gen_xl_xml.set_column_width( 4, 145 );
l_sum := 0 ;
FOR recd IN ( SELECT department_id, department_name FROM departments ) LOOP
IF l_sum <> 0 THEN
r := r +1 ;
gen_xl_xml.write_cell_char( r, 4, 'Department Total ->' , 'sal_tot' );
gen_xl_xml.write_cell_num( r, 5, l_sum , 'sal_tot' );
l_sum := 0;
END if ;
r := r+1 ;
gen_xl_xml.write_cell_CHAR( r,1, 'Department : '|| recd.department_name , 'dept_title' );
-- As we need same style applied till the above data flows use write_cell_null
gen_xl_xml.write_cell_NULL( r,2 , null );
gen_xl_xml.write_cell_NULL( r,3, 'dept_title' );
gen_xl_xml.write_cell_NULL( r,4, 'dept_title' );
gen_xl_xml.write_cell_NULL( r,5, 'dept_title' );
--- Add employee heading
r := r+1 ;
gen_xl_xml.write_cell_CHAR( r,2, 'EmployeeID' , 'emp_title' );
gen_xl_xml.write_cell_CHAR( r,3, 'First Name' , 'emp_title' );
gen_xl_xml.write_cell_CHAR( r,4, 'Last Name' , 'emp_title' );
gen_xl_xml.write_cell_CHAR( r,5, 'Salary' , 'emp_title' );
FOR rec IN (SELECT employee_id , first_name , last_name, salary FROM employees WHERE department_id = recd.department_id ) LOOP
r := r+1 ;
gen_xl_xml.write_cell_num( r,2, rec.employee_id, 'sgs2' );
gen_xl_xml.write_cell_char( r,3, rec.first_name, 'sgs3' );
gen_xl_xml.write_cell_char( r,4, rec.last_name , 'sgs4' );
gen_xl_xml.write_cell_num( r,5, rec.salary );
l_sum := l_sum + rec.salary ;
END LOOP ;
END LOOP ;
gen_xl_xml.close_file ;
END ;
-----------------------------------------------------------------------------------------------------------------

Similar Messages

  • Creating web service from pl/sql procedure

    Hello.
    I need to create a web service from pl/sql procedure and i chose JDeveloper for this implementation. I have wsdl, but I never created web services. So, I created web service with document/literal message format.
    But I have several troubles:
    1. All element names have lower case letters.
    2. The SOAP envelope must begin from words soapenv:Envelope but i have soap:Envelope.
    3. And operation name has tail like "Element".
    I know bad way for implement 1 and 3 points. It's a modification of java_wsdl_mapping.xml and wsdl files. But if I want to add new method to my service all changes will be cleaned. It's not critical but inconvenient to support.
    But for point 3 i have no ideas.
    This task is very important for me. Can somebody help me?
    JDeveloper 10.1.3.3
    Regards,
    Aleksey

    http://www.oracle.com/technology/obe/obe1013jdev/10131/wsfromplsqlpackage/devwsfrom%20plsql.htm
    Frank

  • Creating page items from pl/sql procedure and using them on a page

    I have a page containing 2 select lists (P21_DEPARTMENTS and P21_DATE). Originally I added them as items that were "select list with submits". The problem is that based on the clearance level of the currently logged on user I only wanted the P21_DEPARTMENTS to be a select list if the user was an administrator. If however the user is not an admin then I want the page to have a hidden form field called P21_DEPARTMENTS that stores the user's department and has a label item that has the department name.
    There is also a report region that generates a table based on the department selected from the select list (if the user is an admin) or the value stored in the hidden form field if the user is not.
    My problem is that I cannot have both those items on the same page and use the HTML built-in authentication to determine which item should be rendered because I need to use the same ID for both items so that the stored procedure in my report region doesn't break. HTML does not permit items to share the same ID.
    I tried to circumvent the problem by creating a stored procedure that performs all of the item rendering in the procedure and uses "htp.p()" to output all of my HTML code. This solution would allow me to pass a parameter into the procedure informing me as to whether or not the user is an administrator. If the user is an administrator the procedure would use a conditional statement and render a select list. If not, the hidden form field and label option would be used instead.
    I finally got the stored procedure working perfectly. Now I am encountering the most bizarre thing. Since the "select list with submit" was not working (I used the same code that gets generated when I created other items using htmlDB's GUI) I decided to use a JavaScript function instead that gets triggered by the onChange event. I send along the value that is currently selected in the select list and in the function I set:
    location.href='http://www.myoraclesite.com/pls/htmldb/f?p=111:21:729740000000000000::NO::P21_DEPARTMENTS:1';
    In theory this should work. The problem is that it doesn't. The page reloads and the P21_DEPARTMENTS select list is not pre-selected.
    The only thing I can think of is that when htmlDB generates page items that you've created with it's own admin tool it assigns some internal guid or something as opposed to when someone tries to generate dynamic page items of their own from a pl/sql procedure it's like the application doesn't even know they exist.
    Any help would be GREATLY appreciated.
    My only other solution would be to create a totally separate page (one for admin and another for non-admin). I would really like to avoid this.
    Thanks in advance.

    I would love to be able to generate my menus and
    various other items in my htmlDB applications in much
    the same way I can using ASP, PHP and Cold Fusion.
    Users should have the ability to write server-side
    code wherever they feel like it. The way htmlDB works
    right now I spend more time trying to figure out how
    to create simple effects and generate simple
    interfaces when I need to be building a portal. Ami - it's important to understand that HTML DB is not like other languages. Thus, trying to force concepts which are common in other languages into HTML DB will often result in more work.
    It's definitely worth the time to go over the HTML DB 2-day Developer, which can be found here: http://www.oracle.com/technology/products/database/htmldb/pdf/B14377_01.pdf
    I can build a portal using Classic ASP, C#, PHP or Cold
    Fusion in like 1/10 of the time that it takes me to
    build one using htmlDB. I understand that this is not
    meant for the hard-core programmer but no web
    programming application in today's day and age should
    prevent experts from getting under the hood.And I can build a Portal in HTML DB in 1/10 the time it will take me to do it in any other language. It's like anything else - proficiency comes with practice and work.
    As for getting under the hood, there is plenty of places you can do that with HTML DB. Keep in mind that HTML DB itself is an HTML DB application, so the limits on what you can build with HTML DB are virtually limitless.
    Sorry for the vent there. After spending the last 2
    days trying to figure out how to implement such a
    straightforward thing and now being informed that it
    can't be done kind of bugged me.I understand your frustration, as I've been there before. My rule for beginners is that if you are writing more than a line or two of code in the first week, you're doing something wrong. Stop, take a break, and then use the ample resources (including searching this forum) to help solve your problem. There are plenty of resources available for you to learn about HTML DB on the HTML DB home page: http://otn.oracle.com/htmldb
    Good luck,
    - Scott -

  • Creating excel sheet from pl/sql

    Hi,
    I need to generate an excel sheet and write the result of a query into it from pl/sql .
    Is it possible?
    any idea pls.
    cheers
    RRK

    You can use the following method --
    Write the following code in the emp.sql
    set serveroutput on
    set verify off
    set feedback off
    set long 400000
    set pagesize 0
    set lin 1000
    set markup html on spool on
    spool c:\Emp.xls
    select     *
    from emp;
    spool off
    set markup html off spool off
    set verify on
    set feedback onAnd, then run it with the following command and see-
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
    PL/SQL Release 9.2.0.6.0 - Production
    CORE    9.2.0.6.0       Production
    TNS for IBM/AIX RISC System/6000: Version 9.2.0.6.0 - Production
    NLSRTL Version 9.2.0.6.0 - Production
    satyaki>
    satyaki>
    satyaki>@C:\emp.sql;
    <p>
    <table border='1' width='90%' align='center' summary='Script output'>
    <tr>
    <th scope="col">
    EMPNO
    </th>
    <th scope="col">
    ENAME
    </th>
    <th scope="col">
    JOB
    </th>
    <th scope="col">
    MGR
    </th>
    <th scope="col">
    HIREDATE
    </th>
    <th scope="col">
    SAL
    </th>
    <th scope="col">
    COMM
    </th>
    <th scope="col">
    DEPTNO
    </th>
    </tr>
    <tr>
    <td align="right">
          7369
    </td>
    <td>
    SMITH
    </td>
    <td>
    CLERK
    </td>
    <td align="right">
          7902
    </td>
    <td>
    17-DEC-80
    </td>
    <td align="right">
           800
    </td>
    <td align="right">
    </td>
    <td align="right">
            20
    </td>
    </tr>
    <tr>
    <td align="right">
          7499
    </td>
    <td>
    ALLEN
    </td>
    <td>
    SALESMAN
    </td>
    <td align="right">
          7698
    </td>
    <td>
    20-FEB-81
    </td>
    <td align="right">
          1600
    </td>
    <td align="right">
           300
    </td>
    <td align="right">
            30
    </td>
    </tr>
    <tr>
    <td align="right">
          7521
    </td>
    <td>
    WARD
    </td>
    <td>
    SALESMAN
    </td>
    <td align="right">
          7698
    </td>
    <td>
    22-FEB-81
    </td>
    <td align="right">
          1250
    </td>
    <td align="right">
           500
    </td>
    <td align="right">
            30
    </td>
    </tr>
    <tr>
    <td align="right">
          7566
    </td>
    <td>
    JONES
    </td>
    <td>
    MANAGER
    </td>
    <td align="right">
          7839
    </td>
    <td>
    02-APR-81
    </td>
    <td align="right">
          2975
    </td>
    <td align="right">
    </td>
    <td align="right">
            20
    </td>
    </tr>
    <tr>
    <td align="right">
          7654
    </td>
    <td>
    MARTIN
    </td>
    <td>
    SALESMAN
    </td>
    <td align="right">
          7698
    </td>
    <td>
    28-SEP-81
    </td>
    <td align="right">
          1250
    </td>
    <td align="right">
          1400
    </td>
    <td align="right">
            30
    </td>
    </tr>
    <tr>
    <td align="right">
          7698
    </td>
    <td>
    BLAKE
    </td>
    <td>
    MANAGER
    </td>
    <td align="right">
          7839
    </td>
    <td>
    01-MAY-81
    </td>
    <td align="right">
          2850
    </td>
    <td align="right">
    </td>
    <td align="right">
            30
    </td>
    </tr>
    <tr>
    <td align="right">
          7782
    </td>
    <td>
    CLARK
    </td>
    <td>
    MANAGER
    </td>
    <td align="right">
          7839
    </td>
    <td>
    09-JUN-81
    </td>
    <td align="right">
          2450
    </td>
    <td align="right">
    </td>
    <td align="right">
            10
    </td>
    </tr>
    <tr>
    <td align="right">
          7788
    </td>
    <td>
    SCOTT
    </td>
    <td>
    ANALYST
    </td>
    <td align="right">
          7566
    </td>
    <td>
    19-APR-87
    </td>
    <td align="right">
          3000
    </td>
    <td align="right">
    </td>
    <td align="right">
            20
    </td>
    </tr>
    <tr>
    <td align="right">
          7839
    </td>
    <td>
    KING
    </td>
    <td>
    PRESIDENT
    </td>
    <td align="right">
    </td>
    <td>
    17-NOV-81
    </td>
    <td align="right">
          5000
    </td>
    <td align="right">
    </td>
    <td align="right">
            10
    </td>
    </tr>
    <tr>
    <td align="right">
          7844
    </td>
    <td>
    TURNER
    </td>
    <td>
    SALESMAN
    </td>
    <td align="right">
          7698
    </td>
    <td>
    08-SEP-81
    </td>
    <td align="right">
          1500
    </td>
    <td align="right">
             0
    </td>
    <td align="right">
            30
    </td>
    </tr>
    <tr>
    <td align="right">
          7876
    </td>
    <td>
    ADAMS
    </td>
    <td>
    CLERK
    </td>
    <td align="right">
          7788
    </td>
    <td>
    23-MAY-87
    </td>
    <td align="right">
          1100
    </td>
    <td align="right">
    </td>
    <td align="right">
            20
    </td>
    </tr>
    <tr>
    <td align="right">
          7900
    </td>
    <td>
    JAMES
    </td>
    <td>
    CLERK
    </td>
    <td align="right">
          7698
    </td>
    <td>
    03-DEC-81
    </td>
    <td align="right">
           950
    </td>
    <td align="right">
    </td>
    <td align="right">
            30
    </td>
    </tr>
    <tr>
    <td align="right">
          7902
    </td>
    <td>
    FORD
    </td>
    <td>
    ANALYST
    </td>
    <td align="right">
          7566
    </td>
    <td>
    03-DEC-81
    </td>
    <td align="right">
          3000
    </td>
    <td align="right">
    </td>
    <td align="right">
            20
    </td>
    </tr>
    <tr>
    <td align="right">
          7934
    </td>
    <td>
    MILLER
    </td>
    <td>
    CLERK
    </td>
    <td align="right">
          7782
    </td>
    <td>
    23-JAN-82
    </td>
    <td align="right">
          1300
    </td>
    <td align="right">
    </td>
    <td align="right">
            10
    </td>
    </tr>
    <tr>
    <td align="right">
          9898
    </td>
    <td>
    Erwin
    </td>
    <td>
    Adventur
    </td>
    <td align="right">
          7369
    </td>
    <td>
    17-AUG-07
    </td>
    <td align="right">
          5000
    </td>
    <td align="right">
           230
    </td>
    <td align="right">
            20
    </td>
    </tr>
    <tr>
    <td align="right">
          7006
    </td>
    <td>
    Gopal
    </td>
    <td>
    Player
    </td>
    <td align="right">
          7369
    </td>
    <td>
    17-AUG-07
    </td>
    <td align="right">
          5000
    </td>
    <td align="right">
           230
    </td>
    <td align="right">
            20
    </td>
    </tr>
    </table>
    <p>
    satyaki>Regards.
    Satyaki De.

  • Writing to Excel Sheet from pl*sql

    hi,
    i want to create file .xls from pl*sql but i don't want it to be in slk or csv format as i want to 've rows with background color & these fromats doesn't support this
    thanks in advance

    i'm trying to call java function from pl*sql
    THIS IS MY CLASS WHICH CALL jexcel API jar :
    package ExcelGenPackage;
    import java.io.File;
    import java.io.IOException;
    import java.lang.Number;
    import java.util.Date;
    import jxl.*;
    import jxl.write.*;
    public class ExcelGenClass
    public ExcelGenClass()
    * @param args
    public static void main(String[] args)
    ExcelGenClass excelGenClass = new ExcelGenClass();
    Write_XLS();
    public static void Write_XLS()
    try
    WritableWorkbook workbook = Workbook.createWorkbook(new File("C:\\output.xls"));
    WritableSheet sheet = workbook.createSheet("First Sheet", 0);
    Label label = new Label(0, 2, "A label record");
    sheet.addCell(label);
    Label label1 = new Label(0, 4, "A Second label record ");
    sheet.addCell(label1);
    // All sheets and cells added. Now write out the workbook
    workbook.write();
    workbook.close();
    catch (JXLException e)
    System.out.println("JXLException ");
    catch (IOException e)
    System.out.println("IOException ");
    I Load the jar & the class into pl*sql
    then i add wrapped procedure
    PROCEDURE Test_Proc AS LANGUAGE JAVA
    NAME 'ExcelGenPackage.ExcelGenClass.Write_XLS()';
    when i call Test_Proc
    i got this exception
    Io exception: End of TNS data channel

  • 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.

  • 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

  • Creating PDF documents from PL/SQL

    I would like to know if there is a way to create dynamic PDF documents from PL/SQL procedures using OWA replacement cartridge?
    null

    I would like to know if there is a way to create dynamic PDF documents from PL/SQL procedures using OWA replacement cartridge?
    null

  • Sending message from PL/SQL procedure to form

    Hello Friends,
    How can I send messages from PL/SQL procedure to Form ?
    Ultimate target is catching progress of PL/SQL procedure from
    form. I heard about DBMS_PIPe but not sure,.
    Adi

    Hello,
    Yeah , I got the solution using DBMS_PIPE function,I
    followed following steps.
    1. Pipe is created. see below procedure.
    create or replace procedure proc_testpipe as
         v_pipe_integer          integer;
         v_pipe_message          integer;
    begin
         v_pipe_integer := DBMS_PIPE.Create_Pipe('adipipe');
         dbms_pipe.pack_message('Hello Adinath Kamode,Message
         from Pipe');
         v_pipe_message := dbms_Pipe.Send_message('adipipe');
         end;
    end;
    2. then I created one Function which will obtain message from
    Pipe and
    will return value to form.
    create or replace function proc_callpipe return varchar2 as
    v_msg          integer;
    v_rem          integer;
    v_message          varchar2(500);
    begin
    v_msg:=dbms_pipe.receive_message('adipipe');
    dbms_pipe.unpack_message(v_message);
    dbms_pipe.purge('adipipe');
    v_rem := dbms_pipe.remove_pipe('adipipe');
    return(v_message);
    end;
    3. Last I called this function from form.
    Cheers .. !
    Adi

  • How to call javascript function from PL/SQL procedure

    Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?

    Hi,
    I have a requirement to call Javascript function inside a After Submit Process.
    clear requirement below:
    1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
    2. user clicks on "save files" button
    3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
    Hope this clarify U.
    Krishna.

  • Unix shell script run from pl/sql procedure

    Hi Guru
    I want to run unix shell script from pl/sql procedure. Actual I want to run it from developer 10g form.
    Please guide me in this regards
    Regards
    Jewel

    Look at the host or client_host builtins in the help

  • Returing array from PL/SQL procedure

    Hi,
    I am trying to return array from PL/SQL procedure. Heres is the code. I am getting an error "OracleParameter.ArrayBindSize is invalid ".
    Will anybody let me know what is wrong in following code. or does anybody have code to return PL/SQL array using VB.NET.
    oCommand.CommandText = "MyPack.TestVarchar2"
    oCommand.CommandType = CommandType.StoredProcedure
    Dim id As Integer = 10
    Dim deptname As String()
    Dim oParam1 As Oracle.DataAccess.Client.OracleParameter = New Oracle.DataAccess.Client.OracleParameter("id", Oracle.DataAccess.Client.OracleDbType.Int32)
    Dim oParam2 As Oracle.DataAccess.Client.OracleParameter = New Oracle.DataAccess.Client.OracleParameter("deptname", Oracle.DataAccess.Client.OracleDbType.Varchar2)
    oParam1.Direction = ParameterDirection.Input
    oParam2.Direction = ParameterDirection.Output
    oParam1.CollectionType = Oracle.DataAccess.Client.OracleCollectionType.None
    oParam2.CollectionType = Oracle.DataAccess.Client.OracleCollectionType.PLSQLAssociativeArray
    oParam1.Value = id
    oParam2.Value = ""
    oParam1.Size = 10
    oParam2.Size = 20
    oCommand.Parameters.Add(oParam1)
    oCommand.Parameters.Add(oParam2)
    oCommand.ExecuteNonQuery()
    Thanks
    Sameer

    Thanks Arnold for the reply..
    Yes, I am trying to get result set in array which is unknow to me (No of rows return by the query). For the test I will pre-define the result set so that I will able to set ArrayBindSize.
    I have read C# example but when I try to write it in VB.NET it gives me syntax error when I try to set the ArrayBindSize.
    oParam.ArrayBindSize = new int[3]{15,23,13} // individual max size of 3 outputsWill you please let me know how to set ArrayBindSize (VB.NET) because I am new to this..
    There is an example at otn "How to: Bind an Array to an ODP.NET Database Command" which does multiple INSERTs in one trip to database. This works fine. I need to do same for the SELECT statement which will return me multiple rows. I do not mean refCursor. If I use refCursor, it will make soft parse which I am trying to avoid using this Array techniq.
    Thanks
    Sameer

  • Sending OS command from PL/SQL procedure

    "How can I send a operating system comand from PL/SQL procedure?
    I want to move , to copy , delete a file from a PL/sql procedure. i.e under unix send mv, cp or
    rm command";
    my e-mail is [email protected]

    take a look at
    http://asktom.oracle.com/pls/ask/f?p=4950:8:881946
    regards
    Freek D'Hooge
    "How can I send a operating system comand from PL/SQL procedure?
    I want to move , to copy , delete a file from a PL/sql procedure. i.e under unix send mv, cp or
    rm command";
    my e-mail is [email protected]

  • Export to Excel from PL/SQL Procedure

    Hello,
    I am creating a report using PL/SQL and html code. Once the report is display, I click on "Export to Excel" button. it should open the new window with Excel. The window opens in Excel, but no data. I have following code
    as the first statement in the procedure.
    OWA_UTIL.MIME_HEADER ('application/vnd.ms-excel', FALSE);
    and this is the script
    <script language="JavaScript">
    var param_list
    l_param_list := l_param_list || '&p_app_main_id=' || p_app_main_id;
         l_param_list := l_param_list || '&p_from_date=' || p_from_date ;
         l_param_list := l_param_list || '&p_to_date=' || p_to_date ;
    htp.prn('
    param_list = ''');
    htp.prn( l_param_list);
    htp.prn('''
    function NewWindow(mypage,myname,w,h,scroll){
    var win = null;
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    settings = ''height=''+h+'',width=''+w+'',top=''+TopPosition+'',left=''+LeftPosition+'',scrollbars=''+scroll+'',resizable''
    win = window.open(mypage,myname,settings)
    win.focus();
    function ExportToExcel() {
    var wndname = ''ExpCodeMoveRep'';
    var wndw = screen.width-10;
    var wndh = screen.height-10;
    var wattr = ''scrollbars=yes,toolbar=yes,resizable=yes,menubar=yes'';
    var wndurl = ''pm_codemove_report?p_output=E'';
    wndurl = wndurl + param_list;
         NewWindow(wndurl,wndname,wndw,wndh,wattr);
    </script>
    My submit is
    htp.prn('
    <p align="center">
    <input type="button" class="printbutton" value="Close" class="button" OnClick="window.close();"> 
    <input type="button" class="printbutton" value="Export To Excel" class="button" OnClick="ExportToExcel();">');
    Can anyone tell me what is wrong.
    I have the same code in another schema and it is working fine. Both schema are on the same server. Do they have any set up on appserver in DAD file to be able to see the data in Excel?
    Thanks
    Yagna

    Thank you for your answer dccase!
    I decided to go with on demand process. I have trouble with calling procedure from (button URL - javascript:popupURL('#OWNER#.exportXML')) pop window which cause "Forbidden, The requested operation is not allowed" error. I read that this is because I'm using XE edition and there is no HTMLDB_PUBLIC_USER role in XE.
    Now, I use on demand process and button URL link:
    javascript:popupURL('f?p=&APP_ID.:0:&APP_SESSION.:APPLICATION_PROCESS=PLSQL_Export_XML:NO::')
    It is working. Now I have to find solution to automatically close popup window :-)
    Thanks!
    Marko

  • Create an ASCII file from pl/sql procedure

    hello
    I need to create a file starting from a pl/sql procedure launched by command line
    I'll have my .sql file containing my procedure; I'll launch it via command line and it will create the ASCII file
    In the procedure I'd like to use some stored procedures or functions
    is all of this possible?

    itmick wrote:
    I need to create a file starting from a pl/sql procedure launched by command line
    I'll have my .sql file containing my procedure; I'll launch it via command line and it will create the ASCII file
    In the procedure I'd like to use some stored procedures or functions
    is all of this possible?You could have the procedure code as well as invocation in your .sql file. In that case, launching the .sql file will
    (a) compile your procedure and
    (b) invoke it as well
    Yes, the compiled procedure can invoke other stored procedures or functions.
    To create the ASCII file, you could:
    (a) use UTL_FILE supplied package in your procedure; this will create the ASCII file on the Oracle server, or
    (b) have DBMS_OUTPUT.PUT_LINE calls in your procedure. When invoked from SQL*Plus, this will print out the lines on the SQL*Plus interface and you could spool it to a file on your client filesystem.
    HTH,
    isotope

Maybe you are looking for