CSV Export Quits at 304,235 Characters

In a previous post I asked about a row getting dropped from the report when I "export to csv" but now I'm getting the row but only the first few columns and then one column is cut off and the whole export terminates without even outputting the closing double quote for the cell.
If I open the csv file in a text editor it tells me there are 304,235 characters
The size of the file on disk ends up exactly 320K.
Is this a known limitation or a bug?
Thanks,
Greg
Apex 3.2 on Windows 2000 10g R2
Edited by: Greg Jarmiolowski on Jul 23, 2009 10:44 AM
New info: I copied the data back to the development system on another network and the whole report exports perfectly. The size on disk is the same but the number of characters is up by 215 to 304,450.
Edited by: Greg Jarmiolowski on Jul 23, 2009 11:19 AM
New Info: Same problem occurs with Interactive Report and with the CSV report template
Edited by: Greg Jarmiolowski on Jul 23, 2009 1:03 PM

I am experiencing a similar issue, but my file is only 77140 characters.
I struggle to recreate the issue on my PC but a user experiences the issue on a semi regular basis.
I am not sure whether it is the database, APEX or the network to blame. Hopefully this thread will shed some light on it

Similar Messages

  • Strange characters in report .csv export

    Hello,
    When I enable .csv export in my report, a name like Chiràc Jaqués apears as Chirèc Jaqués in the csv.
    I understand it has to do with charactersets but I don't know how to solve it.
    Cheers
    Jacob

    Jacob,
    go to:
    Shared Components>Edit Globalization Attributes
    and set the
    Automatic CSV Encoding
    to "YES".
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • High performance CSV export

    Hi,
    I have been looking for a way to export huge datasets to CSV format for import with MySql.
    As sqlplus SPOOL turned out to be slow and difficult to use, I ended up coding my own importer using the OCCI library.
    I successfully compiled my code under Red Hat Enterprise Linux 6, 64 bit, and Oracle Instant Client 12.1. But as it only uses C++ STL and OCCI, it should as well build under other environments (e.g. Windows).
    Here's the code:
    * ociexport.cpp - High performance ORACLE to CSV export (using OCCI and STL)
    * This program takes the ORACLE connection information from the following
    * environment variables:
    * ORACLE_USER, ORACLE_PASS, ORACLE_CONN
    * Fields are exported in a CSV with delimiter ';'. Semicola within the fields
    * are escaped with '\;'. Newlines and tabs in the fields are replaced by blanks.
    * Empty fields and NULL values are exported as '\N' for easy MySQL import.
    * CLOBS are exported as well. BLOBS and BFILES are not supported atm.
    * Don't forget to set the LD_LIBRARY_PATH to your Oracle Client libs when
    * building and running this program.
    * @param $1 Select-Statement
    * @param $2 Output file (optional - if empty, output goes to stdout)
    * @author Bert Klauninger
    * @version 0.1.0
    * @changelog
    *    2013-12-13 - Created
    *    2013-12-16 - Added CLOB streaming support
    #include <cstdlib>
    #include <cstring>
    #include <fstream>
    #include <iostream>
    #include <string>
    #include <vector>
    #include "occi.h"
    using namespace oracle::occi;
    using namespace std;
    #define BUFFER_SIZE        1024                        // Maximal characters of a LOB to be exported
    * Escape all occurrences of ';' and convert newlines and tabs to blanks
    string csv_escape(string src) {
        string result;
        const int imax = src.length();
        for (int i = 0; i < imax; ++i) {
            switch (src[i]) {
                case '\n':
                case '\r':
                case '\t':
                    result += ' ';
                    break;
                case ';':
                    result += '\\';
                    result += ';';
                    break;
                default:
                    result += src[i];
        return result;
    * Execute a query and write CSV to the given file.
    *    NB: Empty fields are exported as NULL values!
    void select_into(Connection *con, string sql, string file) {
        if (! con) {
            return;
        bool fo = ! file.empty();
        ofstream o;
        if (fo) o.open(file.c_str(), ofstream::out);
        Statement *s = con->createStatement(sql);
        ResultSet *r = s->executeQuery();
        vector<MetaData> m = r->getColumnListMetaData();
        const int cols = m.size();
        if (fo) cout << "Result has " << cols << " cols" << endl;
        int cnt = 0;
        while (r->next()) {
            string line;
            ++cnt;
            /* Stupid ORACLE starts numbering at 1, not 0 */
            for (int i = 1; i <= cols; ++i) {
                string col;
                /* ...but: Metadata vector starts at 0 */
                int t = m[i - 1].getInt(MetaData::ATTR_DATA_TYPE);
                if (t == OCCI_SQLT_CLOB) {
                    /* Get the CLOB object via stream */
                    Clob clob = r->getClob(i);
                    if (! clob.isNull()) {
                        clob.open(OCCI_LOB_READONLY);
                        int len = clob.length();
                        Stream *instream = clob.getStream();
                        char *buffer = new char[BUFFER_SIZE];
                        memset(buffer, 0, BUFFER_SIZE);
                        int r = 0;
                        do {
                            r = instream->readBuffer(buffer, len);
                            for (int i = 0; i < r; ++i) {
                                col += (char) buffer[i];
                        } while (r != -1);
                        delete[] buffer;
                        clob.closeStream(instream);
                        clob.close();
                } else if (! r->isNull(i)) {
                    /* Try to get field value as string */
                    col = r->getString(i);
                if (col.empty()) {
                    line += "\\N";
                } else {
                    line += csv_escape(col);
                if (i < cols) {
                    line += ';';
            if (fo) {
                o << line << endl;
            } else {
                cout << line << endl;
        s->closeResultSet(r);
        con->terminateStatement(s);
        if (fo) cout << cnt << " rows exported" << endl;
    /*** MAIN ***/
    int main (int argc, char* argv[]) {
        if (! (argc == 2 || argc == 3)) {
            cerr << "Usage: " << argv[0] << " sql-statement [output-file.csv]" << endl << endl;
            cerr << "Output file uses column separator ';'. Semicola are escaped using '\\;'." << endl;
            cerr << "NULL values and empty fields are exported as '\\N'." << endl;
            cerr << "If no output file is specified, quieted output is sent to stdout." << endl;
            cerr << "Login credentials can be set via the following environment variabes:" << endl;
            cerr << "ORACLE_USER, ORACLE_PASS, ORACLE_CONN" << endl << endl;
            return 1;
        const string user = getenv("ORACLE_USER");
        const string pass = getenv("ORACLE_PASS");
        const string osid = getenv("ORACLE_CONN");
        const string sql = argv[1];
        const string outfile = (argc == 3) ? argv[2] : "";
        bool fo = ! outfile.empty();
        Environment* env = Environment::createEnvironment(Environment::DEFAULT);
        int ret = 0;
        try {
            if (fo) cout << "Connecting as " << user << "@" << osid << endl;
            Connection* const con = env->createConnection(user, pass, osid);
            if (fo) {
                cout << "Executing query " << sql << endl;
                cout << "Writing results to " << outfile << endl;
            select_into(con, sql, outfile);
            if (fo) cout << "Closing connection" << endl;
            env->terminateConnection(con);
        } catch (SQLException ea) {
            cerr << "Error: " << ea.what();
            ret = 1;
        Environment::terminateEnvironment(env);
        return ret;
    My Makefile:
    ociexport: ociexport.cpp
            LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib \
                    gcc -Wall -g -I /usr/include/oracle/12.1/client64 \
                    -L /usr/lib/oracle/12.1/client64/lib \
                    -o bin/ociexport ociexport.cpp \
                    -lclntsh -lnnz12 -locci
    Program call:
    $ export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
    $ export ORACLE_USER=your_user
    $ export ORACLE_PASS=your_pass
    $ export ORACLE_CONN=your_connection_string
    $ ./ociexport "SELECT * FROM applications" > export.csv
    Best regards
    Bert

    Hi
    Give a look to the following book. You'll find the answer for some questions...
    http://www.theserverside.com/books/masteringEJB/index.jsp
    Chris

  • ORA-20876 in csv export from interactive report = Possibly a bug?

    Hi Apex team,
    yesterday i tried to download data to csv from an interactive report. The resulting csv file contained a "ORA-20876: Stop APEX Engine" only and no other data. I played around with other reports in my application and had no problems with exports.
    After some investigation i found out that the buggy report contains a column of display type "Display as text (based on a LOV, escape special characters)". When I changed this column type to "Standard Report Column" for example, the error didn't appear anymore and the csv export contained complete data.
    Maybe this is a bug? The environment is Apex 4.1.1.00.23 on 11g (UTF-8). Is there a workaround available?
    Regards,
    Jens
    Edited by: j.gauger on 06.02.2013 14:10
    Additional Information
    The problem seems to occur only if a Shared Components LOV of type "Static" is referenced in the IR column.

    Hi,
    what happens if you take the query from IR report and create a new classic report?
    On this report enable csv export and then try the export.
    Maybe that (format) data are causing export to fail.
    Try to export just one row in your IR report (and classic report), so that you add where rownum < 2.
    Regards,
    Aljaz
    Edited by: Aljaz on 6.3.2012 23:11
    Edited by: Aljaz on 6.3.2012 23:29

  • BUG?? UTF-8 non-Latin database chars in IR csv export file not export right

    Hello,
    i have this issue: my database character set is UTF-8 (AL32UTF8) and contains data in a table used in IR that are Greek (non-Latin). While i can see them displayed correctly in IR and also via select / in Object Browser in SQL Workshop when i try to Download as csv the produced csv does not have the Greek characters exported correctly, while the Latin ones are ok.
    This problem is the same if i try IE or Firefox. Also the export in HTML works successfully and i see the Greek characters there correctly!
    Is there any issue with UTF-8 and non-Latin characters in export to csv from IRs ? Can someone confirm this, or has a similar export problem with UTF-8 DB and non-Latin characters ?
    How could i solve this issue ?
    TIA

    Hello Joel,
    thanks for taking the time to answer to my Issue. Well this does not work for my case as the source of data (Database character set) is UTF-8. The Data inside the database that are shown in the IR on the Screen is UTF-8 and this is done correctly. You can see this in my example. The actual Data in the Database are from multiple languages, English, Greek, German, Bulgarian etc that's why i selected the UTF-8 character set when implementing the Database and this requirement was for all character data. Also the suggested character set from Oracle is Unicode when you create a Database and you have to support data from multiple languages.
    What is the requirement, is that what i see in the IR (i mean in Display) i need to export in CSV file correctly and this is what i expect from the Download as CSV feature to achieve. I understand that you had in mind Excel when implementing this feature but a CSV is just an easy way to export the Data - a Comma Separated Values file, not necessarily to open them directly in Excel. Also i want to add here that in Excel you can import the Data in UTF-8 encoding when importing from CSV, which is fine for my customer. Also Excel 2008 and later understands a UTF-8 CSV file if you have placed the UTF-8 BOM character at the start of the file (well, it drops you to the wizzard, but it's almost the same as importing).
    Since the feature you describe and if i understood correctly is creating always an ANSI encoded file in every case, even when the Database character set is UTF-8, it is impossible to export correctly if i have data that are neither in Latin, not in the other 128 country specific characters i choose in Globalization attributes and these data is that i see in Display and need to export to CSV. I believe that this feature in case the Database character set is UTF-8 should create a CSV file that is UTF-8 encoded and export correctly what i see i the screen and i suspect that others would also expect this behaviour. Or at least you can allow/implement(?) this behaviour when Automatic CSV encoding is set to No. But i stongly believe - and especially from the eyes of a user - to have different things in screen and in the depicted CSV file is a bug, not a feature.
    I would like to have comments on this from other people here too.
    Dionyssis

  • CSV Export Format

    Hi all,
    I wrote a custom toolbar in order to select export formats. The toolbar works fine with PDF and RTF formats, but there is a problem with CSV format when the report contains characters like à, è, é, etc. or symbols like u20AC. In that case the symbols are not displayed correctly and there are problems importing the CSV file in Excel (I have to replace with a text editor the wrong characters in the file exported). The problem is verified also using the standard Crystal Reports toolbar and only for CSV format: PDF and RTF reports are created correctly.
    I had a similar problem with JSP, but the solution was the page charset. In this case, how can I solve the problem?
    Regards,
    pippo.

    <p>Hi Pippo,</p><p>        Thank you for the bug submission. I was able to reproduce the issue on our end and subsequently have tracked the issue using the following bug ID: ADAPT00671293. Hopefully we can get the fix out in the next update to Crystal Reports for Eclipse. </p><p>Regards,<br />Sean Johnson (CR4E Product Manager) <br /><br /> <a href="http://www.eclipseplugincentral.com/Web_Links-index-req-ratelink-lid-639.html">Rate this plugin @ Eclipse Plugin Central</a>          </p>

  • Multiple CSV exports from the one button or pl/sql procedure?

    I need to have multiple csv exports from the one press of a button. The easiest way I found to do this is it to use javascript to popup three windows, each as a CSV link. This is a bit ugly though, and leaves the browser popup windows open when the file has been downloaded.
    I guess I could also make a solution based on branching, but I think that would be difficult to maintain and reeks of bad design (im not a fan of this spagetti GOTO style code!).
    I implemented Scott's custom CSV as found here: http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html
    However I would like to know if its possible to download more than one file using this method. I could not work out how to do this .
    Has anyone got any ideas? Simply repeating the code puts the second table into the original csv file. Is there a way to 'reset' the htp writer or smoething?
    Any help greatly appreciated,
    Alex

    Sorry for the confusion - I guess I mean its easy in .NET because you can simply compress files together and then send 1 zip file down as the response. See http://www.developer.com/net/net/article.php/11087_3510026_2 for details.
    I guess I could ask how to do this in APEX - but it seems to me that my original wording addresses the concept at a much more abstract level. I may not find the best solution for my problem if I just asked 'how can I dynamically zip together three tables as seperate files and send them to the client?'. I also suspect that this method is not possible in APEX without custom packages. Please prove me wrong!
    I guess even if I could find some kind of javascript that didnt open a new window, but was a direct download to the CSV, that would be a good compromise. At the moment when you click on the link, three windows come up and stay blank until the files are ready for downloading. Then after the files have been downloaded the windows must be shut manually. Yes, I could use javascript to make the windows 1x1 pixel perhaps, and then shut them after a predetermined timeframe - but this is hardly an elegant solution!
    Thanks for your responses.

  • Report + Jquery + CSV export = jquery result lost

    We have some IR reports with breaks. We put these next to eachother on specific headers with jquery code in the report. But when we do an export i want the same results as shown in the report. The changes made in Jquery get lost when i do a CSV export. Is there some way to get the same columns next to each other like in the report on the screen? or is there some other way to get the same result using something other than jquery? We are now want to making a function in DB using dynamic sql that returns a query to apex report but there should be some easier way in Apex than this no?
    Thanks in advance

    @ TexasApexDeveloper i asked this question on linkedin Apex group before. But not here. So there no way to show the breaks next to eachother in the CSV file? with or without use of Jquery?
    @ Tyson: no sample app.
    Standard behavier of IR report:
    department :1
    col1 col2 col3 col4
    BREAK
    col1 col2 col3 col4
    BREAK
    col1 col2 col3 col4
    BREAK
    col1 col2 col3 col4
    BREAK
    department :2
    col1 col2 col3 col4
    BREAK
    col1 col2 col3 col4
    BREAK
    With Jquery made it look like this
    department 1
    col1 col2 col3 col4 BREAK col1 col2 col3 col4 BREAK col1 col2 col3 col4 BREAK col1 col2 col3 col4 BREAK
    department 2
    col1 col2 col3 col4 BREAK col1 col2 col3 col4 BREAK col1 col2 col3 col4 BREAK col1 col2 col3 col4 BREAK
    i want the data like this in CSV, so that then user opens this in excel the data is presented horizontaly per department:
    department 1
    col1 col2 col3 col4 BREAK col1 col2 col3 col4 BREAK col1 col2 col3 col4 BREAK col1 col2 col3 col4 BREAK
    department 2
    col1 col2 col3 col4 BREAK col1 col2 col3 col4 BREAK col1 col2 col3 col4 BREAK col1 col2 col3 col4 BREAK

  • Ssrs 2008 r2 csv export

    In an existing ssrs 2008 r2 report, I have a question about the csv export.
    When the report was originally written, I only expected the users to export the data to excel.
    Basically the issue is, based on the states where the customers exist. If the customers exists on the east coast, I version of the report is displayed. If the users exist in the Midwest, another version of the report is displayed. if the users exist on the
    west coast a third version of the report is displayed.
    However now if the users want to export the data to csv (comma delimited), all 3 versions are appearing in the csv file.
    I do know that when I hide a tablix, that does not export the data to a csv file. However when I pick the option to show or hide a tablix based upon the expression, the tablix is exported to a csv file.
    Is there a way to export the columns and data that actually apply to the particular customer. I do not want all the data columns for east coast, Midwest, and west coast to appear on the csv export?
    If there is a way to not display the extra data columns and rows, can you tell me how to accomplish this goal? Showing me code and/or a url would also be helpful.

    Hi Wendy,
    When exporting a report to CSV format in Reporting Services, the visibility of a report item/object is only controlled by the Property DataElementOutput. If the DataElementOutput property of a report item is set to Auto or Output, it will be exported to
    the CSV file, otherwise, the report item won’t be exported to CSV. Currently, the DataElementOutput property is hard-coded which doesn’t allow us to set the property based on an expression. In this way, it is impossible for different users to have different
    exported CSV files in your scenario.
    Here, I would suggest you submitting a wish at
    https://connect.microsoft.com/sql.
    Connect site is a connection point between you and Microsoft, and ultimately the larger community. Your feedback enables Microsoft to make software and services the best that they can be, and you can learn about and contribute to exciting projects.
    Regards,
    Mike Yin
    If you have any feedback on our support, please click
    here
    Mike Yin
    TechNet Community Support

  • How to give dynamic name for csv export files?

    Hi,
    how we can give dynamic file name for each csv export file? ex(&item_name.csv)
    I am using apex 4.1 and IE 6,
    thanks in advance
    regards
    Chandran

    Please help me on this
    I am using report template as a csv export..
    when user click on download link on other page he will redirect to csv export temlate page and he is is directly get the open or save window
    but dynamic title name is not working for only for this.
    regards
    Chandran

  • Calling the CSV Export link in a Report Template

    I'm trying to have our "download" link appear on the bottom left rather then the default which is to the far right in Look 4.
    When I look at the source code, I can see how look 3 and 4 differ - different HTML table set-up and "align=right" for the link.
    Unfortunately, looking at the source gives me the direct source for that specific report file not the command to include the csv export file, so I can't include it in a new report template design.
    Is there code I can use to include a CSV link in my report template?
    If not, how can I place the report download/csv export into my Nav bar region, or some other region?

    Michelle,
    Typically you'll find the substitution strings documented in the popup help when clicking on the item label. But this one doesn't seem to be listed there. It's documented in the online help though. Click in the help icon in the upper right corner of your page and search for CSV.
    Marc

  • German Umlaut in CSV export on mac os

    Hello,
    i have problems with the csv export when i use an apple mac. German Umlaute are not displayed correctly, neither when i open the .csv file with TextApp nor when i open it with Numbers from iWork.
    On a windows machine all is fine. Excel and every text editor i tried opens the file fine with the umlaute displaying correct.
    The application is set to automatically encode the csv and application language is set to german.
    Is there any other setting that i can change to get a correct csv export on an apple mac?
    Apex version is 4.0.2.00.07, Oracle version is 11.2.0.1.0.
    Thanks for help in advance,
    Dirk

    Hi Dirk,
    Most likely, the Automatic CSV encoding attribute is set to 'Yes' for your application. If you're running your application in German, then the CSV file will be encoded in WE8MSWIN1252.
    Can you try setting Automatic CSV Encoding to "No" (in the Globalization attributes of your application)? The CSV file will then be encoded in UTF-8 - which means that your Windows users may not open it directly but, instead, have to do a data import and specify utf-8 character set.
    Joel

  • BUG: SQL Developer 1.5.3 CSV export column order broken

    There's a bug in the 1.5.3 release of SQL Developer regarding data export. This bug re-orders the column order in the data export to be alphabetically sorted. This produces mangled CSV files if used on a table or a view.
    This is a critical bug to me since I need to produce lots of ad-hoc data CSV export files. I'm staying with SQL Developer 1.5.0.53 (53.38) for now as it doesn't have this problem.
    This is the same bug as present in Jdeveloper 11.1 as described in my post here: BUG: Jdev 11.1.1.0.0 -- DB table data export column order is not preserved
    Quoted from that post:
    When I connect to Oracle database, get the table list, right click on the table and select 'Export Data'->csv. The dialog box opens with three tabs: Format, Columns, Where. The column order displayed in both tabs Columns and Where is alphabetic. Because alphabetic ordering re-arranges columns from their initial ordering in the table, this screws up CSV export because columns are not in their intended order. This same problem occurs when I try to export data from views to generate a CSV file with a particular column order.
    Please open/check bug report if it's already open.
    Thanks!

    This happens with all of the export options for tables or views if you right click from the connections tab table list. If I pull it up in the main window and go to the data tab, I can then right click and it will keep the column id order for some of the views and tables. But not all.
    I am running 1.5.3 Build Main 5783 on a Windows XP Professional Service Pack 3 platform

  • CSV Export in HTMLDB -Report

    From Regions > Report Attributes I set the Enable CSV option to yes - Link Label (i.e export), but the link does not appear. Any hints/appreciated.
    thanks for youe help.

    Hi,
    See if this Denes blog post help
    http://deneskubicek.blogspot.com/2007/03/csv-export-problem.html
    Regards,
    Jari

  • Outlook 2007 adobePDF addin export messages without czech special characters.

    I would like to ask how to set codepage settings in Acrobat XI standard outlook 2007 adobePDF addin. When i export message adobePDF convert czech characters like "č, ř, š" to "c, r, s" and also change font.
    Printing message with AdobePDF wokrs fine.
    I can not find a way how to change codepage or font settings in Acrobat PDFmaker.
    Thank You in advance

Maybe you are looking for