How to export data in fixed lengh format

I want to take data in 4 tables, and export the data to a fixed lenght flat file format. Then have that file sent to an email address. How can I do this?

Suzie,
I never used Toad ;-) But I always use the Oracle SQL Developer instead (which is for free by the way).
SQL Developer gets installed with every 11g database installation but you could install it also to your 9.2 or 10.x environment - just grab it from otn.oracle:
http://www.oracle.com/technology/software/products/sql/index.html
(will take two minutes to install). Then you'd just define your connection to your target database, go into REPORTS (left side) and define a USER DEFINED REPORT. That's pretty easy because for instance you'd just say 'select * from scott.emp;' - once the report gets executed just move your mouse over one of the rows, hit the right mouse buttom and choose the last entry: EXPORT DATA - you'll have the options of TEXT, CSV, SQL LOADER FORMAT, INSERT, XML, HTML and XLS ;-)
Another possibility within SQL*Plus would be using the column format options (the font of this webpage scrambles the output columns but in SQL*Plus you'll get everything formated in a fixed length format:
column "info" format A11
column "P1" format 99999
column "P2" format 99999
column "P3" format 99999
SELECT Info " ", P1, P2, P3
FROM tr_PortfolioSummary
ORDER BY SortOrder
P1 P2 P3
Nb Bonds 10 40 40
Nb Warrants 20 50 50
Nb Shares 30 60 60
Kind regards
Mike
Edited by: Mike Dietrich on Sep 12, 2008 9:41 AM

Similar Messages

  • How to export data from a spread sheet which has multiple work sheets?

    How to export data from a spread sheet which has multiple work sheets to a single text file with fixed length fields?

    Hello s1,
    saving them as CSV will not give a fixed legth output but, as the naming says, a Character Separated Value file.
    Regards
    Marcus

  • How to Export data from webdynpro using Jecxcel

    Hi ,
    Can anyone help me how to export data from web dynpro using Jexcel. kindly send me the related links.
    Thanks

    Hi Sandeep,
    Have you refered in the blogs?
    U can find may more document related to this.the below blog helps u in
    Exporting Data from Web Dynpro in Different Formats Using Open Source (POI, JExcel, iText) APIu2019s.
    https://www.sdn.sap.com/irj/sdn/index?rid=/library/uuid/b030e7fb-2662-2b10-0dab-c4aa52c3550b
    Regards
    Supraja

  • How to export data with column headers in sql server 2008 with bcp command?

    Hi all,
    I want know "how to export data with column headers in sql server 2008 with bcp command", I know how to import data with import and export wizard. when i
    am trying to import data with bcp command data has been copied but column names are not came.
    I am using the below query:-
    EXEC master..xp_cmdshell
    'BCP "SELECT  * FROM   [tempdb].[dbo].[VBAS_ErrorLog] " QUERYOUT "D:\Temp\SQLServer.log" -c -t , -T -S SERVER-A'
    Thanks,
    SAAD.

    Hi All,
    I have done as per your suggestion but here i have face the below problem, in print statment it give correct query, in EXEC ( EXEC master..xp_cmdshell @BCPCMD) it was displayed error message like below
    DECLARE @BCPCMD
    nvarchar(4000)
    DECLARE @BCPCMD1
    nvarchar(4000)
    DECLARE @BCPCMD2
    nvarchar(4000)
    DECLARE @SQLEXPRESS
    varchar(50)
    DECLARE @filepath
    nvarchar(150),@SQLServer
    varchar(50)
    SET @filepath
    = N'"D:\Temp\LDH_SQLErrorlog_'+CAST(YEAR(GETDATE())
    as varchar(4))
    +RIGHT('00'+CAST(MONTH(GETDATE())
    as varchar(2)),2)
    +RIGHT('00'+CAST(DAY(GETDATE())
    as varchar(2)),2)+'.log" '
    Set @SQLServer
    =(SELECT
    @@SERVERNAME)
    SELECT @BCPCMD1
    = '''BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT '
    SELECT @BCPCMD2
    = '-c -t , -T -S '
    + @SQLServer + 
    SET @BCPCMD
    = @BCPCMD1+ @filepath 
    + @BCPCMD2
    Print @BCPCMD
    -- Print out below
    'BCP "SELECT 
    * FROM   [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername'
    EXEC
    master..xp_cmdshell
    @BCPCMD
      ''BCP' is not recognized as an internal or external command,
    operable program or batch file.
    NULL
    if i copy the print ourt put like below and excecute the CMD it was working fine, could you please suggest me what is the problem in above query.
    EXEC
    master..xp_cmdshell
    'BCP "SELECT  * FROM  
    [tempdb].[dbo].[wErrorLog] " QUERYOUT "D:\Temp\LDH_SQLErrorlog_20130313.log" -c -t , -T -S servername '
    Thanks, SAAD.

  • How to export data from a Oracle table to a delimited file?

    I know how to load delimited file into a table, but how to export
    data from a Oracle table to a delimited file?
    Thanks in advance.

    Try looking at this link, it's long but there's three different solutions discussed in it. If you look at Barbara Boehmer's
    solution in her posts in the link below you'll see that she's addressed your concerns with spool files.
    Re: utl_smtp and triggers

  • How to export data in JSP to MS excel

    hi frens..
    anyone out there knows how to export data in JSP to Ms excel .. i already add this code inside my jsp..
    <%@ page contentType="application/vnd.ms-excel" %>i need to retrieve the data from the database to excel.. it's something like a report display in the excel.

    set the response type as....
    response.setContentType("application/vnd.ms-excel");
    U must be geting the data from the database...
    get the data ...
    rs=st.executeQuery(sql);
    where sql is ur query and use it as usual....

  • How to export data from MS Project 2010 to MS Excel 2010 with formatting

    I have created a Project 2010 export map to Excel 2010.  It works fine.  I have two questions that I cannot determine an answer.  I'm not sure if its a project or excel setting.  I have spend hours trying to make it
    work with little success.
    1.  When the task name field is exported to excel it losses summary/task indent.  Is there a way to set it up so it works via the export map?
    2.  The Start & Finish fields in project is setup as 5/26/11 when they exports to excel it shows up as 5/26/11 8:00 AM.  Is there a way to set it up either in project export map or excel so its formated as a date field. 
    Excel's Format Cell function does not seem to work converting them back to just 5/26/11.
    How can I keep the outlines and formatting in my data while exporting it to Excel.
    I would appreciate any guidance.
    Yogesh

    Rameshchandra --
    Two things I would recommend:
    Do not add your question at the end of a post that is marked as Answered.  In the future, please post your question as a new question so that everyone will notice it and be able to answer it.
    Because this is a programming question, please repost your question as a new post in the Project Customization and Programming user forum at:
    http://social.technet.microsoft.com/Forums/projectserver/en-US/home?forum=project2010custprog&filter=alltypes&sort=lastpostdesc
    Hope this helps.
    Dale A. Howard [MVP]

  • How to export data to specified format as EXCEL(XXL)

    Dear Experts,
    Good day!
    Who can help me that to export data in SAP by KE30 Transaction Code? We planed to do some things on browser using SAP GUI for HTML and ITS 6.20 in SAP R/3 640. Now, our end-user occur one problem that they need outgoing the data wanted through browser from SAP(Triggered by KE30). In the SAP GUI for Windows, they can do it to export data into specified format (as XXL), but that for HTML can't done. The problem had a message shown below: The presentation server does not function in Windows. Which other way to resolve this? Please tell us, thank you!

    The XXL export is not supported by Sapgui for HTML(Webgui) via Office Integration. See note: 512068    Office integration and SAP GUI for HTML
    However there is a workaround available, this is described in note:                                 
    #435769 ALV WebGUI: Excel download by saving into local file    
    can help you.         
    (the note is old - but the information in it still holds true)                                         
    Please note that the download and upload functionality of the SAPGui for HTML (WEBGUI)  requires a Java Virtual Machine.          
    Please see note 980772 for a list of the supported JVMs.
    One can also using the following link to check your current JVM version in your Browser:         
    http://www.java.com/en/download/help/testvm.xml

  • How to export data from webdynpro to Excel and start a Excel macro

    Hello All
    I want to export data displayed in the Web dynpro ALV into Excel. I have tried the ALV export function but my problem with it is when it does export to excel the data loses formatting and I have long text in columns which display with wrapping in ALV but when exported to excel it loses formatting.
    So I want to define a custom button and when user presses on this button the excel export is called with a macro. Can you kindly share ideas how I can do this from a webdynpro.
    Thanks
    Karen

    Hi friends!
    I have followed the following:
    http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=(J2EE3417300)ID1487994050DB10407586481486749551End?blog=/pub/wlg/5522
    ...in order to create standard ALV with Export to Excel.
    However what is exported into excel is awful. It does not contain my data in nice columns... Instead it shows a lot of meta-data.
    Please let me know what to do to kick the standard Export button in the correct direction.. that is...to have my nice table in same way in Excel, because that is my intention with "Export to excel"
    Best reg
    Henrik

  • Export Data To Fixed Length File

    Hello,
    I have a requirement to export a couple of files that need to be in a fixed length format. 
    I've tried opening the dataset and writing the records passing the column that the records should appear:
        WRITE /, field1, 10 field2, etc...
    I've also tried to do it through SAP_CONVERT_TO_CSV_FORMAT and the text version as well.
    Is there a predefined function that will allow me to export as fixed length? 
    Thank you in advance

    Hi Jeff,
    Following is the code to do the same:
    DATA: file TYPE string VALUE `flights.dat`,
          wa   TYPE spfli.
    FIELD-SYMBOLS TYPE x.
    OPEN DATASET file FOR OUTPUT IN BINARY MODE.
    SELECT *
           FROM spfli
           INTO wa.
      ASSIGN wa TO CASTING.
      TRANSFER TO file.
    * TRANSFER LENGTH 200 to file.
    ENDSELECT.
    CLOSE DATASET file.
    Best regards,
    Prashant

  • How to export data with months on columns?

    Folks,
    I need to export data from BPC NW in this format:
    ENTITY,ACCOUNT,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC
    Does anybody has a sample transformation file or guidelines on how to achieve it?
    I tried *MVAL without luck.
    Thanks
    Paulo

    Hi Paulo,
    *MVAL could have been helpful while importing and if you would have been converting key figure model to account based model. However, you are trying to do complete opposite. You are exporting data and converting account based model to key figure model. I would suggest you to make use of BADI start an end routines for this.
    Hope this helps.

  • Export data as fixed length ASCII text file

    Hi,
    Can someone tell me how to export query data or the data in a table as a fixed length text file. I use PL/SQL developer to query the data.
    Many thanks,

    If you use SQL*Plus, you could try the following.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a90842/ch7.htm#1007441

  • How to export the report in HTML format for desktop application

    Hi,
    i have wrote the JRC desktop application to export the report and i am able to export it in PDF and other formats as mentioned in "ReportExportFormat" API.
    i would like to know is there any API there which can export the report in HTML format.
    i know it would be possible with web based application of JRC, but how can i do it in desktop application?

    There's no mechanism for static HTML pages that displays the report.
    You can use the CrystalReportViewer DHTML viewer, but that's 'interactive'.
    Sincerely,
    Ted Ueda

  • How to Export Data from a table in database directly to Excel.

    Hi,
    I have some sqls that i need to run on a daily basis.My client wants them to be scheduled through a job and the result output of the query should be in the form of Excel.
    Now i am no sure how to do this.Is there any in-built function in the DBMS package that can export data drectly from table to Excel. ?
    Please Help me !!

    SQL> spool exlfile.cvs
    SQL> set colsep ','
    SQL> set lines 300
    SQL> set pages  9999
    SQL> set trimspool on
    SQL>
    SQL> select * from DEPARTMENTS
      2  /
    DEPARTMENT_ID,DEPARTMENT_NAME               ,MANAGER_ID,LOCATION_ID
               10,Administration                ,       200,       1700
               20,Marketing                     ,       201,       1800
               30,Purchasing                    ,       114,       1700
               40,Human Resources               ,       203,       2400
               50,Shipping                      ,       121,       1500
               60,IT                            ,       103,       1400
               70,Public Relations              ,       204,       2700
               80,Sales                         ,       145,       2500
               90,Executive                     ,       100,       1700
              100,Finance                       ,       108,       1700
              110,Accounting                    ,       205,       1700
              120,Treasury                      ,          ,       1700
              130,Corporate Tax                 ,          ,       1700
              140,Control And Credit            ,          ,       1700
              150,Shareholder Services          ,          ,       1700
              160,Benefits                      ,          ,       1700
              170,Manufacturing                 ,          ,       1700
              180,Construction                  ,          ,       1700
              190,Contracting                   ,          ,       1700
              200,Operations                    ,          ,       1700
              210,IT Support                    ,          ,       1700
              220,NOC                           ,          ,       1700
              230,IT Helpdesk                   ,          ,       1700
              240,Government Sales              ,          ,       1700
              250,Retail Sales                  ,          ,       1700
              260,Recruiting                    ,          ,       1700
              270,Payroll                       ,          ,       1700

  • How to export data from a Dynpro table to Excel file?

    Hi
    Here I go again. I read the post <b>Looking for example to export data from a DynPro table to Excel file</b> and put the code lines into a Web Dynpro Project where we need to export a dynpro table to Excel file but exactly at line 23 it doesn't recognize <b>workBook = new HSSFWorkbook();</b>
    1     //Declare this in the end between the Begin others block.
    2     
    3     private FileOutputStream out = null;
    4     private HSSFWorkbook workBook = null;
    5     private HSSFSheet hsSheet = null;
    6     private HSSFRow row = null;
    7     private HSSFCell cell = null;
    8     private HSSFCellStyle cs = null;
    9     private HSSFCellStyle cs1 = null;
    10     private HSSFCellStyle cs2 = null;
    11     private HSSFDataFormat dataFormat = null;
    12     private HSSFFont f = null;
    13     private HSSFFont f1 = null;
    14     
    15     //Code to create the Excel.
    16     
    17     public void onActionExportToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
    18     {
    19     //@@begin onActionExportToExcel(ServerEvent)
    20     try
    21     {
    22     out = new FileOutputStream("C:/mydirectory/myfiles/testexcel.xls");
    23     workBook = new HSSFWorkbook();
    24     hsSheet = workBook.createSheet("My Sheet");
    25     cs = workBook.createCellStyle();
    26     cs1 = workBook.createCellStyle();
    27     cs2 = workBook.createCellStyle();
    28     dataFormat = workBook.createDataFormat();
    29     f = workBook.createFont();
    30     f1 = workBook.createFont();
    31     f.setFontHeightInPoints((short) 12);
    32     // make it blue
    33     f.setColor( (short)HSSFFont.COLOR_NORMAL );
    34     // make it bold
    35     // arial is the default font
    36     f.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    37     
    38     // set font 2 to 10 point type
    39     f1.setFontHeightInPoints((short) 10);
    40     // make it red
    41     f1.setColor( (short)HSSFFont.COLOR_RED );
    42     // make it bold
    43     f1.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
    44     f1.setStrikeout(true);
    45     cs.setFont(f);
    46     cs.setDataFormat(dataFormat.getFormat("#,##0.0"));
    47     
    48     // set a thick border
    49     cs2.setBorderBottom(cs2.BORDER_THICK);
    50     
    51     // fill w fg fill color
    52     cs2.setFillPattern((short) HSSFCellStyle.SOLID_FOREGROUND);
    53     cs2.setFillBackgroundColor((short)HSSFCellStyle.SOLID_FOREGROUND);
    54     // set the cell format to text see HSSFDataFormat for a full list
    55     cs2.setDataFormat(HSSFDataFormat.getBuiltinFormat("text"));
    56     cs2.setFont(f1);
    57     cs2.setLocked(true);
    58     cs2.setWrapText(true);
    59     row = hsSheet.createRow(0);
    60     hsSheet.createFreezePane(0,1,1,1);
    61     for(int i=1; i<10;i++)
    62     {
    63     cell = row.createCell((short)i);
    64     cell.setCellValue("Excel Column "+i);
    65     cell.setCellStyle(cs2);
    66     }
    67     workBook.write(out);
    68     out.close();
    69     
    70     //Read the file that was created.
    71     
    72     FileInputStream fin = new FileInputStream("C:/mydirectory/myfiles/testexcel.xls");
    73     byte b[] = new byte[fin.available()];
    74     fin.read(b,0,b.length);
    75     fin.close();
    76     
    77     wdContext.currentContextElement().setDataContent(b);
    78     }
    79     catch(Exception e)
    80     {
    81     wdComponentAPI.getComponent().getMessageManager().reportException("Exception while reading file "+e,true);
    82     }
    83     //@@end
    84     }
    I don't know why this happen? Any information I will appreciate it.
    Thanks in advance!!!
    Tokio Franco Chang

    After test the code lines appears this error stacktrace:
    [code]
    java.lang.NoClassDefFoundError: org/apache/poi/hssf/usermodel/HSSFWorkbook
         at com.sap.tc.webdynpro.progmodel.api.iwdcustomevent.ExportToExcel.onActionAct1(ExportToExcel.java:232)
         at com.sap.tc.webdynpro.progmodel.api.iwdcustomevent.wdp.InternalExportToExcel.wdInvokeEventHandler(InternalExportToExcel.java:147)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
         at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:252)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:392)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:345)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:323)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:865)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:240)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
         at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:95)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:159)
    Thanks in advance!!!
    Tokio Franco Chang
    [/code]

Maybe you are looking for

  • Cannot see folder- in non english characters.

    I have set up PySDM to mount one of my harddrives on boot. The problem is that I cannot see a folder (ls and nautilus ) there , which is non -english characters (russian). Ubuntu was able to see it properly. I verified it was there by booting back to

  • Premiere CC 2014 'Media Pending' & constant hanging/crashing

    I have a Macbook Pro retina, using Canon 5D mk3 footage. I am working on a few projects and keep experiencing a problem where the program monitor will just 'hang' on a certain frame during playback, other times (less often) will display 'media pendin

  • Marking 'clips' when sound editing?

    I'm editing a lot of 'narration'. And having to build a single sentence from a dozen different takes. Is there any way I can mark a clip (that is being constantly moved around) ... adding a different color? or some indicator? (Not a marker on the tim

  • Problem with levels/meters in logic pro 7.2.2

    Hopefully someone knows the answer to my problem. I've loaded a wavefile that is peaking at 0, very compressed, limited, mastered etc.. For some reason, the audio track level meter shows that it's peaking at -3, and -3 on the master as well. If i run

  • Calendar times differ when viewing and printing

    Using mac calendar on OS X Yosemite, when I view the times in the calendar app, everything looks correct. If I select "Print" and try to print the upcoming week, some events are off by one hour. I have been printing the calendars weekly for several m