How to export the result to excel or txt as the SQL result format.

Hello,
I want to know how to export the result of the Oracle select result to a txt or a excel file.What is the command.
I knew the command of spool,but the format of it export is not the same to the result of Oracle result area.
Thank you very much.

Hello Yucky,
what do you mean by
the format of it export is not the same to the result of Oracle result areaDo you mean the output of a tool other than SQL*PLUS?
To enhance the formatting of a spool file you can set
SET MARKUP HTML ON
SPOOL ONthis will add html markup to format the output as a html table which you can open in a browser or in excel.
Regards
Marcus

Similar Messages

  • How to Export SSRS report into Excel format using query string

    Hello all,
    I am new to SSRS world.
    Last night i was trying to add a hyperlink  on the SSRS report (.rdl) file, by clicking which we can export the report into "Excel" format, but with no luck.
    Can anybody tell me how to form the hyperlink, so that we can export the report with its current content ( I mean the report content generated by selecting some parameter values)

    Hi Suman85,
    Based on your scenario, you want to add a link on the SSRS report file, and then click it you can export the report into “Excel” format.
    Just as kishan1901 said , you can add a textbox to your report and type in the words “Click here and export the report
    to excel” .Then right-click the textbox and select Properties. Switch to Navigation tab, click the radiobutton of ‘Jump to URL’ and type in the expression ,here is just a example:
     ="http://vyof1884200/ReportServer$youhoo?/My+Adventure+Works/Product+Sales+and+Profitability+by+Month&rs:Command=Render&rs:Format=excel"
    Then preview the report ,you will see
    Click here and export the report to excel 
    when you move the mouse to it ,the mouse will become a hand ,then left-click, it will jump out a dialog box to indicate user whether the excel file should be saved , opened or canceled. 
    I think this is what you want, if you have any further requirement, could you please describe it in more detail? We would give you some resolution or workaround.
    Regards,
    Challen Foo

  • How to export crystal report to excel through progeam

    Hi,
    Can any help me how to export crystal report to excel through program(C#). I'm using VS2005.
    Also, the report should be in a pivot table format after exporting to the excel..please help me how to do this
    Thanks,
    Venky

    Hi Venkat,
    The link below provides the code C# in an ASP.NET codebehind file
    http://www.codeproject.com/KB/cs/Crystal_Report_Export.aspx
    http://aspalliance.com/478_Exporting_to_Excel_in_Crystal_Reports_NET__Perfect_Excel_Exports.2
    Regards,
    Abhijeet  T.

  • OBIEE Report Export from Dashboard to Excel doesn't suppress the columns as

    OBIEE Report Export from Dashboard to Excel doesn't suppress the columns as expected even after the properties are set to Suppress in the report. In Dashboard it is suppressed Properly but in the excel export it is not suppressed and values for the columns are repeated.
    Added the following to the instanceconfig :
    <Download>
    <Export xsi:type="excel">
    <DataValue>UseFormattedValue</DataValue>
    <RepeatRows>false</RepeatRows>
    </Export>
    </Download>
    But then could not restart services.The following error occured :
    Util Logger] Exception occurred:
         Severity:1
         Type:PKN3saw9ExceptionE
         File:saxreader.cpp
         Line:681
         Message:Sax parser returned an exception.
    Message: The prefix 'xsi' has not been mapped to any URI, Entity publicId: /oracle/ofm/instances/instance1/config/OracleBIPresentationServicesComponent/coreapplication_obips1/instanceconfig.xml, Entity systemId: , Line number: 43, Column number: 26
    Edited by: 887111 on Mar 27, 2013 11:23 PM

    Problem solved!!
    <br><br>
    See this part of the query:
    <br><br>
    if :P15_GESTOR_PROPIETARI='-3' then<br>
    w:= w||' AND (("STASVWREPORT_TASQUES"."GES_GES_ID"=:GESTOR ';<br>
    w:= w||'OR "STASVWREPORT_TASQUES"."GES_GES_ID_ESTA_ASSIGNADA"=:GESTOR)';<br>
    w:= w||'OR ("STASVWREPORT_TASQUES"."AGR_***_***_ID"=<FONT color=red>:P15_CANVI_DE_CLUB</FONT> ';
    w:= w||' AND "STASVWREPORT_TASQUES"."PUBLICA"=''S''))';<br>
    end if;<br>
    <br>
    when instead of :P15_CANVI_DE_CLUB I put a value (say ''EE'') it works correctly, finally I created an application item (ASSOCIAT) and when when I change :P15_CANVI_DE_CLUB I set :ASSOCIAT to the same value and the query is based on this application item:
    <br><br>
    if :P15_GESTOR_PROPIETARI='-3' then<br>
    w:= w||' AND (("STASVWREPORT_TASQUES"."GES_GES_ID"=:GESTOR ';<br>
    w:= w||'OR "STASVWREPORT_TASQUES"."GES_GES_ID_ESTA_ASSIGNADA"=:GESTOR)';<br>
    w:= w||'OR ("STASVWREPORT_TASQUES"."AGR_***_***_ID"=<FONT color=red>:ASSOCIAT </FONT>';<br>
    w:= w||' AND "STASVWREPORT_TASQUES"."PUBLICA"=''S''))';<br>
    end if;<br>
    <br>

  • How to export 2 different report with a link at the same time

    Hi,
    Do anybody know how to export 2 different report with a link at the same time. I currently create a report which link to another report. But when I want to export the 1st report I also want the 2nd report also be exported.
    Thank you very much.
    Best Rgds,
    SL Voon

    Export all the three components individually.
    It will generate 3 script files. Now run them from SQL>
    null

  • How to export report output into excel.

    Hi all
    how to export report output into excel sheet can any on give me answer step by step please as soon as possible
    kk

    Hi Prashanth,
    If you are executing Query from WAD  ---> Right click on Table (only on Characteristics Data)  --> Enhanced Menu ---> Export as --> CSV file or MS Excel
    assign points if this helps,
    Thanks,
    Sudhakar

  • How we export report data into excel in report 10g

    hi can any one tell me
    how we export report data into excel in report 10g (except spreadsheet)

    We can use TEXT_IO Package

  • Get the data  from excel and insert into the database

    I want to read the data from excel file, get the data from excel and insert into the database.

    You can use the Apache POI HSSF API to read data from Excel files and you can use the Sun JDBC API to insert data in database.
    This has nothing to do with JSP/JSTL.

  • How to export data to an excel by preserving styles

    Hi All,
    I am trying to export data to an excel using ColdFusion. Below is my code.
    <cfheader name="content-disposition" value="attachment; filename=dashboard.xls">
    <cfcontent type="application/msexcel">
    <table width="200" border="1">
      <tr>
        <td width="40"> </td>
        <td width="160">
          <table width="160" border="1">
          <tr>
            <td width="20" bgcolor="red"> </td><td width="20" bgcolor="black"> </td><td width="20" bgcolor="red"> </td><td width="20" bgcolor="black"> </td>
            <td width="20" bgcolor="red"> </td><td width="20" bgcolor="black"> </td><td width="20" bgcolor="red"> </td><td width="20" bgcolor="black"> </td>
          </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td width="40"> </td>
       <td width="160">
          <table width="160" border="1">
          <tr>
            <td width="20" bgcolor="red"> </td><td width="20" bgcolor="black"> </td><td width="20" bgcolor="red"> </td><td width="20" bgcolor="black"> </td>
            <td width="20" bgcolor="red"> </td><td width="20" bgcolor="black"> </td><td width="20" bgcolor="red"> </td><td width="20" bgcolor="black"> </td>
          </tr>
          </table>
        </td>
      </tr>
    </table>
    When I try to execute above code by commenting <cfheader><cfcontent> then the output is perfect. styles are preserved. And when I uncomment <cfheader><cfcontent> and execute code, then an excel file will get open. But all the styles are lost. So how to preserve all styles(table width etc.) in excel.
    Can anybody please assist me on this. Thanks in advance.
    Regards,
    Manoz.

    I copied your code and did the test. Result: no problem.
    However, I used the following table data in my test. Did you use any data in yours? To fully test an HTML table, you have to put in some data.
    <!--- <cfheader name="content-disposition" value="attachment; filename=dashboard.xls">
    <cfcontent type="application/vnd.ms-excel"> --->
    <table width="200" border="1">
      <tr>
        <td width="40">xxx</td>
        <td width="160">
          <table width="160" border="1">
          <tr>
            <td width="20" bgcolor="red">AAA</td><td width="20" bgcolor="black">ccc</td><td width="20" bgcolor="red">eee</td><td width="20" bgcolor="black">ggg</td>
            <td width="20" bgcolor="red">&n b s p;</td><td width="20" bgcolor="black">ddd</td><td width="20" bgcolor="red">fff</td><td width="20" bgcolor="black">hhh</td>
          </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td width="40">yyy</td>
       <td width="160">
          <table width="160" border="1">
          <tr>
            <td width="20" bgcolor="red">111</td><td width="20" bgcolor="black">333</td><td width="20" bgcolor="red">555</td><td width="20" bgcolor="black">&n b s p;</td>
            <td width="20" bgcolor="red">222</td><td width="20" bgcolor="black">444</td><td width="20" bgcolor="red">666</td><td width="20" bgcolor="black">888</td>
          </tr>
          </table>
        </td>
      </tr>
    </table>
    Two other things to note. First, I have used &n b s p; for empty table-data. Secondly, though the MIME type you have used for excel might work, the correct  value is application/vnd.ms-excel.

  • How to export report output into excel file

    hi friends,
    i would like to get the solution from you for how to export the report output into a .xls file. i know how to convert it into .rtf and .txt files but i think it's difficult to do this .xls way, could you help me to comeover this problem?
    thankyou very much.

    The official answer is "delimited", which
    generates adequate comma or other delimited
    text. No formatting, and without extra
    effort no support for non-ASCII characters.
    Might be sufficient for you.
    Note that Excel can read html files - we
    built programs to generate html files with
    name of "blah.xls" and some Excel-ish
    extensions, so Excel is automatically opened
    and the document is all nice and pretty.
    (Oracle html output has some odd logic about
    choosing number of columns, we didn't use
    it.)
    -- Allan Plum

  • Exported the JTable to excel  but to customize the excel file

    Hi,
    I have exported the JTable to excel through CSV file. But I want to customize the excel file, by setting border, color and cell styles. How to implement this? Can you please help me out?
    Thanks,
    public class CalculateUsers extends JPanel implements     ActionListener,     TableModelListener {
         JFrame frame;
         JTable table;
         public CalculateUsers(JPanel mainPanel) {
                    rows = new Vector();
              columns = new Vector();
              String[] columnNames = {"BP","users","Avg","time"};
              addColumns(columnNames);
              tabModel = new DefaultTableModel();
              tabModel.setDataVector(rows, columns);
              table = new JTable(tabModel);
              table.getModel().addTableModelListener(this);
              lblMessage = new JLabel("");
                 label1 = new JLabel("Textbox 1");
                    label2 = new JLabel("Textbox 2");
                    text1 = new JTextField(5);
              text2 = new JTextField(5);
              buttonPanel = new JPanel();
                        cmdAdd = new JButton("add");
                        cmdCalculate = new JButton("Calculate");
              cmdExportToExcel = new JButton("ExportToExcel");
                    buttonPanel.add(label1);
              buttonPanel.add(text1);
              buttonPanel.add(label2);
              buttonPanel.add(text2);
              buttonPanel.add(cmdCalculate);
              buttonPanel.add(cmdExportToExcel);
              buttonPanel.add(cmdAdd);
         public void addRow() { // Add Row
              Vector r = new Vector();
              r = createBlankElement();
              rows.addElement(r);
                    table.addNotify();
         public Vector createBlankElement() {
              Vector t = new Vector();
              t.addElement((String) " ");
              t.addElement((String) " ");
              t.addElement((String) " ");
              t.addElement((String) " ");
              t.addElement((String) " ");
              t.addElement((String) " ");
              t.addElement((String) " ");
                 return t;
         public void calculate() throws Exception {
                int i = table.getRowCount();
                int firstCellVal, secondCellVal, thirdCellVal, fourthCellVal, fifthCell, sixthCell, sevenCell, eightCell,jtext1,jtext2;
               try{ 
                     tabModel.addColumn("Time taken");
                 tabModel.addColumn("Pse");
                 tabModel.addColumn("Users %");
                 tabModel.setColumnCount(7);
                    jtext1 = Integer.parseInt(text1.getText().toString().trim());
                    jtext2 = Integer.parseInt(text2.getText().toString().trim());
                  for (i = 0; i < table.getRowCount(); i++) {
                        String cell1 = table.getValueAt(i, 0).toString();
                        String cell2 = table.getValueAt(i, 1).toString();
                        String cell3 = table.getValueAt(i, 2).toString();
                        String cell4 = table.getValueAt(i, 3).toString();
                        sixthCell = secondCellVal * thirdCellVal * fourthCellVal;
                        sevenCell = ((jtext1 - (fourthCellVal * thirdCellVal))/(fourthCellVal - 1));
                        eightCell = (secondCellVal * 100)/jtext2;
                        table.setValueAt(result2, i, 4);
                        table.setValueAt(result3, i, 5);
                        table.setValueAt(result4, i, 6);
                } catch(Exception ae) {
                        ae.printStackTrace();
         public void actionPerformed(ActionEvent source) throws ArithmeticException { // ActionList
              if (source.getSource() == (JButton) cmdAdd) {
                        addRow();
              if (source.getSource() == (JButton) cmdCalculate) {
                          calculate();
              if (source.getSource() == (JButton) cmdExportToExcel) {
                         exportToExcel();
          private void exportToExcel() throws Exception{
                   exportTable();
         *public void exportTable() { // export Table*
    *          try {*
    *               System.out.println("Exporting Table ");*
    *               String filename = "ScenarioAutomation" + System.currentTimeMillis()+ ".CSV";*
    *               File file = new File(filename);*
    *               String data;*
    *               String columnNames[] = null;*
    *               columnNames = new String[table.getColumnCount()];*
    *               if (file != null) {*
                                *try {*
    *                    BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file, true));*
    *                    PrintWriter fileWriter = new PrintWriter(bufferedWriter);*
    *                    System.out.println("Column Headers ");*
    *                    firstRowInExcel(fileWriter);*
    *                    for (int j = 0; j < columnNames.length; j = j + 1) {*
    *                        columnNames[j] = table.getColumnModel().getColumn(j).getHeaderValue().toString();*
    *                        data = columnNames[j];*
    *                        System.out.println("data " + data);*
    *                        fileWriter.print(data + ",");*
                                   *     System.out.println("Done.... ");*
                                   *     fileWriter.println("");*
                                   *     System.out.println("Exporting Data ");*
    *                    for (int k = 0; k < table.getRowCount(); ++k) {*
                                        *for (int l = 0; l < table.getColumnCount(); ++l) {*
    *                         data = table.getValueAt(k, l).toString();*
    *                         fileWriter.print(data + ",");*
                                        *fileWriter.println("");*
    *                    fileWriter.close();*
    *                    System.out.println("Done.... ");*
    *                    System.out.println("File Name " + filename);*
    *                    open(file);*
    *                    } catch (Exception e) {*
                                        *JOptionPane.showMessageDialog(null, "Error " + e);*
    *          } catch (Exception E) {*
    *               System.out.println("Error While Exporting Table " + E);*
    *     private void firstRowInExcel(PrintWriter fileWriter) {*
                    *fileWriter.println("");*
    *          String jtext1label = ("Textbox 1");*
    *          fileWriter.print(jtext1label);*
    *          fileWriter.print(",");*
    *          String jtext1Value = text1.getText();*
    *          fileWriter.print(jtext1Value);*
    *          fileWriter.print(",");*
    *          fileWriter.print(" ");*
          *private void open(File f) {*
           *     String[] commands = {*
    *          "rundll32",*
    *          "url.dll,FileProtocolHandler",*
    *          f.getAbsolutePath()*
    *          try {*
                        *System.out.println("****OPEN file ****");*
                        *Runtime.getRuntime().exec(commands);*
    *          } catch (IOException e) {*
                        *e.printStackTrace();*
    *}*

    for this purpose you need to took help of the third party APIs.
    try POI from Apache
    http://poi.apache.org/hssf/index.html
    this is easy and efficent. and Free also.
    one more i found is
    http://es.actuate.com/xlsjbook/apibasics.html (Not sure about this one.)
    good luck go ahead

  • How to export data to an excel file using VBScript

    I'm trying to create a VBScript in DIAdem (V9.1) which automatically saves all the current channels in the data portal to an excel file. I've tried using 'Call ExcelExport' and specify a full file path but the file is never created. What am I doing wrong?
    Thanks,
    Steve

    Hi Steve,
    There are a couple of other things you can try. If you don't like Ingo's suggestion about multiple Excel STP files, your only real option is to create an ASCII file. Note that you can give the ASCII file an extension of *.CSV or even *.XLS, and Excel will read it right in.
    So the question boils down to how to format the ASCII export correctly and quickly.
    You can use the DAT file approach Ingo mentioned and even re-write the file with VBS to include a few header lines of your own choosing. Note that this approach does NOT support text channels. There is an example of this in the zip file attached below.
    You can alternatively use the CSV export function in DIAdem 9.1 to output an ASCII file with the name of each channel as the single header row above all the values. There is an example of this in the zip file attached below.
    You can also just read the values from the DIAdem channels and write them out to an ASCII file cell by cell, managing everything with VBScript calls. There is an example of this in the zip file attached below.
    I hope that helps,
    Brad Turpin
    DIAdem Product Support Engineer
    National Indstruments
    Attachments:
    DIAdem ASCII Export.zip ‏5 KB

  • How to export a table in excel (in JSP)???

    hi all,
    I am using AJAX functionality in jsp to export a table into Excel.But i don't want to use it as it gives a hyperlink whereas i want a button which should work similar to hypelink.
    I mean to say i want a saperate export button which should work similar to the hyperlink.
    if anybody has any idea abt it....plz reply it soon.......

    So what you want to do is redirect to a page when the user clicks the button?
    So just put the button in a form with the action attribute set to wherever the hyperlink points now.
    And in case the button is already a part of a form, then on the onClick() event of the button, change the action attribute of the form to this particular hyperlink target and then cause it to submit.
    That ok?
    Or do you want the Excel file you're generating to be sent to the browser causing it to popup a dialog asking the user to save or open? If so take a look here http://forum.java.sun.com/thread.jspa?threadID=5170452&messageID=9655276

  • How to create an excel and how to export data to that excel ALBPM

    Hi,
    anyone can u please give me some idea to create and export the data to excel.i have creatde COM Bridge as external resource.

    I would suggest something like:
    DBAdapter --> Bpel Process --> File Adapter --> write file to location (you can write in csv which can be imported into xls)
    Read Location --> FileAdapter --> Bpel Process --> Email Activity
    Regards,
    Anshul

  • How to export table data to excel in albpm

    Hi,
    we have an requirement to export table data to excel .
    we have to create an jsp in that jsp we have to have text fileds,we have to enter data to field after that we have to click on save once u click on save that data has to enter in below table and we should provide link to export that table data to excel.
    this is our totatl requirement.can u please suggest me how to do,i dont have any idea..
    Regards,
    Sharmila
    Edited by: user12171025 on Nov 5, 2009 8:44 PM

    Hi Daniel 
    Please have a look at below docs :-
    /people/subramanian.venkateswaran2/blog/2006/08/16/exporting-table-data-to-ms-excel-sheetenhanced-web-dynpro-binary-cache
    http://wiki.sdn.sap.com/wiki/display/WDJava/ExporttoExcel(WithoutthirdpartyAPIs)
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d01854fd-1579-2c10-63ad-dd62edca2381?quicklink=index&overridelayout=true
    Regards
    Arun Jaiswal

Maybe you are looking for

  • EQUIPMENT_UPDATE

    Hi Can anybody tell me how to use this function module EQUIPMENT_UPDATE? Even though i provide all the data required the function module is going for dump saying <b>PARAMETER *HEQKT IS MISSING</b> even the parameter is being provided. The actual rqui

  • Query required to compress multiple records

    I have a table containing customer name and module as follows Customer        Module_id         Company_Name AAA                   9                       ABC AAA                  13                      ABC AAA                  21                   

  • Easy Cost Planning (SAP) in Tender Process

    Hi All, I am using SAP ECC 6.0 EHP 4. I wanted to know if Easy Cost Planning in SAP PS can be used to cost a project initially while Tendering process.Or is there any other tcodes in SAP for tender process? I created Costing Models for most of the po

  • Premiere Pro CS 6.exe stays active after closing the program

    I am experiencing a problem with Premiere Pro CS 6.03. When I close the program, the second monitor would not return to desktop (it stays a black screen). The premiere pro cs.exe is active in taskmanager. Only after I end the exe process would the se

  • My ipod nano will not sync with anything

    about 2 months ago i bought an ipod nano 4gb. It has worked great until i updated my itunes the other day. I sync'ed it fine and added some songs, but now it will not sync with anything. not my computer, my buddies computer, or my xbox 360. it will c