poor performance by writing data via ODBC into a csv file 
Author Message
 poor performance by writing data via ODBC into a csv file

Hi all,

i had to export data via ODBC as csv file, but the performance is very bad !?!?

I created a little sample to test this performance problem in a
easy to use environment. Every call to ExecuteSQL() takes some
time to return. So inserting 10 rows takes about 10 seconds.
(Microsoft Text Driver 4.00.5303.01)

When i use the excel driver, it takes nor more than a second
to export all 10 rows into an xls file.

What is wrong using the csv driver this way ?

Thanks Thomas

code:
-----------------------------
#include "stdafx.h"
#include <afxdb.h>

CWinApp theApp;
CDatabase db;
using namespace std;

void exec(LPCTSTR  strSQL)
{
    try
    {
        db.ExecuteSQL(strSQL);
    }
    catch(CDBException *e)
    {
        cerr << _T("ExecuteSQL Error: ") << e->m_nRetCode << _T("  ") <<
e->m_strError.GetBuffer(0) << endl;
    }

Quote:
}

int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
    int nRetCode = 0;

    // !!! 'export-csv' must exist as 'Microsoft Text Driver (*.txt; *.csv)'
data source
    if (db.OpenEx("ODBC;DBQ=;DSN=export-csv"))
    // if (db.OpenEx("ODBC;DBQ=test.xls;DSN=export-xls"))
    {
        int nRows = 10;

        exec("DROP TABLE [test.csv]");
        exec("CREATE TABLE [test.csv] ([Name] CHAR (40))");

        while (nRows--)
        {
            exec("INSERT INTO [test.csv] VALUES ('Name 1')");
        }
        db.Close();
    }
    return nRetCode;

Quote:
}

-----------------------------


Tue, 04 May 2004 19:12:19 GMT
 
 [ 1 post ] 

 Relevant Pages 

1. Extracting large volumes of data from oracle to flat files - Poor Performance

2. poor write performance MS SQL 2000

3. poor write performance with disk Array Adaptec Durastor 7200S

4. Access-Database via UNC path => poor performance

5. poor Oracle performance via dynamic SQL...

6. Access-Database via UNC path => poor performance

7. SQL7 and indexing. Poor selection Poor performance

8. Poor execution plan running query via ODBC

9. performance of writing data writing into database tables

10. write results of query to mutiple excel or csv file

11. trigger to write record to csv file

12. [ODBC] Writing BLOBS to pgsql via ODBC using VB - Mini


 
Powered by phpBB® Forum Software