Date format is corrupted while exporting GridView data to excel

I have set UK culture on my machine. Date is getting exported correctly. I have written following code:
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=IncidentsSearch.xls");
Response.ContentType = "application/vnd.xls";
//Ccreate string writer object and pass it to HtmlTextWriter object
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gv.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();
But when I change my machine culture to US, date format gets corrupted. It exports date in "DD/MM/YYYY" format. When I apply filter on this column, it tries to convert these values to date format "MM/DD/YYYY". If there are 2 date values
like "05/08/2014" and "13/11/2014". When I try to change format of these 2 values to Long Date, it will try to convert it to MM/DD/YYYY format as US culture is set. So 1st values will be converted to 8 May, 2014 which is actually 5th Aug,2014.
For 2nd date value, it will not be able to convert it to date as 13 is not valid month. I want that when UK culture is set, it should automatically export date values in "DD/MM/YYYY" format and when US culture is set, it should automatically export
date values in "MM/DD/YYYY" format. Please suggest some solution.

Hi
This is the forum to discuss questions about VSTO develop (add-in, custom document). For your question is more about Web Form Data, I suggest you post this thread to asp.net data forum
http://forums.asp.net/24.aspx/1?Web+Forms+Data+Controls
 The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
Thank you for your understanding.
Best Regards
Lan
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Problem while exporting the data from a report to an excel file.

    Hi SAP guru's,
    I have a problem while exporting the data from a report to an excel file.
    The problem is that after exporting, the excel file seems to have some irrelevant characters....I am checking this using SOST transaction..
    Required text (Russian):
    Операции по счету                                    
    № документа     Тип документа     № учетной записи     Дата документа     Валюта     Сумма, вкл. НДС     Срок оплаты     Описание документа
    Current Text :
       ? 5 @ 0 F 8 8  ? >  A G 5 B C                                   
    !   4 > : C       "" 8 ?  4 > : C      !   C G 5 B = > 9  7 0 ? 8 A 8        0 B 0  4 > : C         0 ; N B 0      ! C <       ! @ > :  > ? ; 0 B K        ? 8 A 0 = 8 5  4 > : C
    Can you help me making configuration settings if any?
    Regards,
    Avinash Raju

    Hi Avinash
    To download  such characteres you need to adjust code page to be used during export. You can review SAP note 73606 to identify which code page is required for this language
    Best regards

  • Error "Encountered an error while exporting the data. View the lof file (DPR-10126)

    Hello,
    I would like to have sugestions and help to solve a problem in IS 4.2.
    I've created a view from two tables, joined together with the key from each one.
    Then i've binded the rule with the view (mentioned above) created and calculated score for it.
    The calculation is successful, however when i try to export all failed data i have the following error:
    "Encountered an error while exporting the data. View the lof file (DPR-10126)"
    When exporting failed data from calculations made directly to the datasources i do not encounter any problem, but when i try to export all data to CSV file (not only the 500 results limit) i have this kind of error.
    However, when i visualize the data from the view created, it is also possible to export to csv file.
    Resuming, the error occurs only when exporting all failed data from the view.
    Can anyone help with this issue?
    Thx
    Best Regards,

    Hello,
    Your information is correct.
    I've just confirmed it in the 4.2 SP3 Release Notes and they specifically refer to this issue.
    A user who has 'View objects' rights for the project and a failed rule connection cannot export the failed data. This issue has been fixed in this release.
    Thank you very much for your input.
    Best Regards,

  • The (maximum) expected data length is 6, while the returned data length is

    I would like to connect the view via the OraOLEDB.Oracle' from linked server of the MSSQL and the following column couldn't be selected.
    Msg 7347, Level 16, State 1, Line 2
    OLE DB provider 'OraOLEDB.Oracle' for linked server 'PROD' returned data that does not match expected data length for column salary.LATEST_HIRE_DATE_STATUS'. The (maximum) expected data length is 6, while the returned data length is 4.
    So I would like to change the following code from case method to decode method ? due to the view can be selected by decode method .
    CASE
    WHEN TRUNC (latest_hire_date) >= SYSDATE - 90
    AND type_of_post = 'Temp'
    THEN 'YES'
    ELSE 'NO'
    END
    AS latest_hire_date_status,
    CASE
    WHEN last_day_of_duty IS NOT NULL THEN 'REJECTED'
    ELSE 'PASSED'
    END
    AS last_day_of_duyty_status,
    Edited by: user10605622 on 2012/2/8 上午 8:01

    user10605622 wrote:
    I would like to connect the view via the OraOLEDB.Oracle' from linked server of the MSSQL and the following column couldn't be selected.
    Msg 7347, Level 16, State 1, Line 2
    OLE DB provider 'OraOLEDB.Oracle' for linked server 'PROD' returned data that does not match expected data length for column salary.LATEST_HIRE_DATE_STATUS'. The (maximum) expected data length is 6, while the returned data length is 4.
    So I would like to change the following code from case method to decode method ? due to the view can be selected by decode method .
    CASE
    WHEN TRUNC (latest_hire_date) >= SYSDATE - 90
    AND type_of_post = 'Temp'
    THEN 'YES'
    ELSE 'NO'
    END
    AS latest_hire_date_status,
    CASE
    WHEN last_day_of_duty IS NOT NULL THEN 'REJECTED'
    ELSE 'PASSED'
    END
    AS last_day_of_duyty_status,Not quiet sure what your problem is or what you are asking for?
    There's no need to use a DECODE statement when a CASE will do the same, and more, certainly if you want to check for range values rather than equality values as in your ">= SYSDATE - 90".
    Not quite sure what your error message means either. Seems to be nonesense as it says the maximum is 6 and it's getting 4, but 4 is not greater than 6 so it shouldn't be a problem.

  • Exception while Exporting Datagridview data with Images to Excel...

    Hi Everyone,
    I have datagridview in that 17 columns are text columns and 5 columns are Image columns,when I'm trying to export whole gridview data's along with images to EXCEL,getting "HRESULT:
    0x800A03EC" Error..While debugging the code I'm getting the error on image column not able to export..
    Can anybody help us to resolve this issue..
    Here is my code which i used:
    private void btnexportexcel_Click(object sender, EventArgs e)
    try
    SaveFileDialog savefile = new SaveFileDialog();
    savefile.Filter = "Excel (*.xls)|*.xls";
    if (savefile.ShowDialog() == DialogResult.OK)
    if (!savefile.FileName.Equals(string.Empty))
    FileInfo finfo = new FileInfo(savefile.FileName);
    if (finfo.Extension.Equals(".xls"))
    Excel.Application xlApp;
    Excel.Workbook xlWorkBook;
    Excel.Worksheet xlWorkSheet;
    object misValue = System.Reflection.Missing.Value;
    xlApp = new Excel.Application();
    xlWorkBook = xlApp.Workbooks.Add(misValue);
    xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(2) ;
    int i = 0;
    int j = 0;
    for (i = 0; i <= dataGridView1.RowCount - 1; i++)
    for (j = 0; j <= dataGridView1.ColumnCount - 1; j++)
    DataGridViewCell cell = dataGridView1[j, i];
    xlWorkSheet.Cells.Borders.LineStyle = Excel.XlLineStyle.xlContinuous;
    xlWorkSheet.Columns.AutoFit();
    if (cell.Value.GetType() == typeof(Bitmap))
    string image =Convert.ToString(dataGridView1.CurrentRow.Cells[i].Value); 
    Excel.Range oRange = (Excel.Range)xlWorkSheet.Cells[i + 1, j + 1];
    float Left = (float)((double)oRange.Left);
    float Top = (float)((double)oRange.Top);
    const float ImageSize = 32;
    xlWorkSheet.Shapes.AddPicture(image, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, Left, Top, ImageSize, ImageSize);
    oRange.RowHeight = ImageSize + 2; 
    else
    xlWorkSheet.Cells[i + 1, j + 1] = cell.Value;
    xlWorkBook.SaveAs(savefile.FileName, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue,
    Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
    xlWorkBook.Close(true, misValue, misValue);
    xlApp.Quit();
    releaseObject(xlWorkSheet);
    releaseObject(xlWorkBook);
    releaseObject(xlApp);
    MessageBox.Show("Excel file created , you can find the file " + savefile.FileName);
    else
    MessageBox.Show("Invalid file type");
    else
    MessageBox.Show("You did pick a location " + "to save file to");
    catch (Exception ex)
    MessageBox.Show("Exception Occured", ex.Message);
    Thanks & Regards RAJENDRAN M

    Hi Everyone,
    I have datagridview in that 17 columns are text columns and 5 columns are Image columns,when I'm trying to export whole gridview data's along with images to EXCEL,getting "HRESULT:
    0x800A03EC" Error..While debugging the code I'm getting the error on image column not able to export..
    Can anybody help us to resolve this issue..
    Here is my code which i used:
    private void btnexportexcel_Click(object sender, EventArgs e)
    try
    SaveFileDialog savefile = new SaveFileDialog();
    savefile.Filter = "Excel (*.xls)|*.xls";
    if (savefile.ShowDialog() == DialogResult.OK)
    if (!savefile.FileName.Equals(string.Empty))
    FileInfo finfo = new FileInfo(savefile.FileName);
    if (finfo.Extension.Equals(".xls"))
    Excel.Application xlApp;
    Excel.Workbook xlWorkBook;
    Excel.Worksheet xlWorkSheet;
    object misValue = System.Reflection.Missing.Value;
    xlApp = new Excel.Application();
    xlWorkBook = xlApp.Workbooks.Add(misValue);
    xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(2) ;
    int i = 0;
    int j = 0;
    for (i = 0; i <= dataGridView1.RowCount - 1; i++)
    for (j = 0; j <= dataGridView1.ColumnCount - 1; j++)
    DataGridViewCell cell = dataGridView1[j, i];
    xlWorkSheet.Cells.Borders.LineStyle = Excel.XlLineStyle.xlContinuous;
    xlWorkSheet.Columns.AutoFit();
    if (cell.Value.GetType() == typeof(Bitmap))
    string image =Convert.ToString(dataGridView1.CurrentRow.Cells[i].Value); 
    Excel.Range oRange = (Excel.Range)xlWorkSheet.Cells[i + 1, j + 1];
    float Left = (float)((double)oRange.Left);
    float Top = (float)((double)oRange.Top);
    const float ImageSize = 32;
    xlWorkSheet.Shapes.AddPicture(image, Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue, Left, Top, ImageSize, ImageSize);
    oRange.RowHeight = ImageSize + 2; 
    else
    xlWorkSheet.Cells[i + 1, j + 1] = cell.Value;
    xlWorkBook.SaveAs(savefile.FileName, Excel.XlFileFormat.xlWorkbookNormal, misValue, misValue, misValue, misValue,
    Excel.XlSaveAsAccessMode.xlExclusive, misValue, misValue, misValue, misValue, misValue);
    xlWorkBook.Close(true, misValue, misValue);
    xlApp.Quit();
    releaseObject(xlWorkSheet);
    releaseObject(xlWorkBook);
    releaseObject(xlApp);
    MessageBox.Show("Excel file created , you can find the file " + savefile.FileName);
    else
    MessageBox.Show("Invalid file type");
    else
    MessageBox.Show("You did pick a location " + "to save file to");
    catch (Exception ex)
    MessageBox.Show("Exception Occured", ex.Message);
    Thanks & Regards RAJENDRAN M

  • While Export the data to MS Word - How to avoid the Frames ???

    Hi All,
    I export the data from Crystal Report XI to Word document (doc) file , i used Text objects in the Report , in document file it's converted to  Frames and overlapped with other frames(so some data are hidden). is it possible to avoid the frames while exporting the report to word document.
    Thanks in advance.
    J.Baski

    Hello,
    It would be better if you format your report so your objects do not overlap but I realize sometimes it can't be avoided.
    Other option is to upgrade to CR XI R2 and test again, it is a free upgrade.
    Go to this link: http://www.sdn.sap.com/irj/boc and download the trial version of CR XI R2 and use your XI keycode, then apply the patches which you can get to by clicking on the BusinessObjects tab above, then Downloads.
    Direct link to the Trial version: http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
    Other option is to export to Word Editable may be a solution for you also.
    Thank you
    Don

  • Date formate of Status_Record.QueuedAt and other date fields in SRW package

    Hi,
    Is the date format of the Status_Record fiields in SRW package are controlled by any DB parameter ?
    B'cos it differs between databases for me.

    The SRW package calls the Reports server. This, in turn, gives the result back in XML format. The DB package parses the XML. The date format is taken from this XML result. So, the setting is somewhere on the Reports server, but I don't know where. There are so many property files.
    You see the same date format in the servlet: http://<host>:<port>/reports/rwservlet/getserverinfo? E.g.
    Start Time           Oct 28, 2008 8:40:24 AM
    Check this in your case.

  • How to avoid line break ( br ) while exporting Interactive report in Excel

    Hi,
    I have a Interative report and I am using Apex download format as CSV.
    I have defined some of the column heading in multiple line using break < br >
    when I export this into the excel sheet..the column heading contains break also..
    - Any idea how to avoid line break while exporting in excel.
    - also how to put the columns heading in BOLD when exported in excel.
    Thanks,
    Deepak

    Hi Jari,
    I tried this but still getting the
    <br>Interactive Report
    Column Attributes Heading - Employee<br>Detail AddressWhen I download the Report in CSV Format
    I am getting the heading with <br>.
    I am looking for heading as - Employee Detail Address // with no <br> tagThanks,
    Deepak

  • Repersentation of #error in HFR while exporting the report in Excel

    Hi All,
    We are working on Hyperion Financial Report 9.3.1 with Essbase as a data source.
    We are replacing the #error with 'NA', which is working fine when we are viewing the FR reports in workspace.
    But when we export this report in Excel, word "NA" is changed by 0 (zero), which is misleading the user.
    How can we stop this conversion (NA to 0)?
    Any suggestion and help will be appreciated.
    Thanks & Regards,
    Mohit Jain

    Hi All,
    Thanks for your answers and support.
    I raised this issue to Oracle support also, I got the following response-
    Hi Mohit,
    I tested the case with the way you offered me. I can reproduce the problem. I think it should be a bug of the product.
    I searched that on ML3. I found a bug which said that. This bug has been fixed in EPM 11.1.1.0.00. I tested that on my EPM 11.1.1.0.00 system. It works fine. The NA value can be exported in excel.
    So would you like to upgrade to EPM 11.1.1.0.00 to fix the issue?
    Hope this information will help others in future.
    Thanks & Regards,
    Mohit Jain

  • Image Display Problem while exporting jasper report in EXCEL

    Hi
    I am using Jasper reports for my reporting work using java code.
    when i export my report in PDF then , report is ok and displaying Image properly.
    but when i export my report in EXCEL then , there is no image in my report, rest part is fine.
    Can anyone please help me in getting image in excel format also.
    thanks in advance
    Praveen

    I have not any problem in picture or logo.
    But I have an another problem.
    My Excel format produce multiple column,that is unefficient format.
    If you have not this problem please mail me at --- [email protected]

  • 500 internal server error while Export wedbdynpro content into Excel.

    Hi Experts,
    my requirement is export webdynpro content into excel sheet, so for this what i have did is
    First step:
    ) created an Extneral library DC
    2) imported the JARs to the libraries folder of the External Library DC project
    3) Right-click on each of the JARs imported to the project and added them to the public part.
    Second step:
    1) Createed a new Reuse Web Dynpro DC
    2) Created a new public part, selecting the "Can be packaged into other build results" option
    3) extrcted the full content (folders and class files) to root folder
    4) Imported the folders and files to the src/packages folder
    5)binded the attributes, created 3 methods and writen the code for those methods.
    Third Step:
    1) created one more EXPORT EXCEL DC
    2) ADDED LIB jar dc and Reuse DC IN used dc's
    3) created usedwebdynpo component and binded attributes to Table VIEW and writen the code for exposing table values.
    After this build and deployed i am getting clasnot found error
    so what i have did now is
    Fourth step:
    1)Created "J2EE Library DC"
    2) Refered "External Library DC" into J2EE Library DC.
    3) Deployed "J2EE Library DC"
    4) Refered this one in my Web Dynpro DC by giving Library Reference.
    now when i deploy and run what happend i am getting
    500 Internal Server Error SAP J2EE Engine/7.01 
    Application error occurred during request processing.
    Details:   com.sap.tc.webdynpro.services.sal.core.DispatcherException: Failed to start deployable object sap.com/export_file_excel_7.
    Exception id: [00215E78C4C0006D00000AD9000E00F00004887F642A32FE]
    Any one can tell what could be the problem.

    Thanks for sharing the solution.

  • Error while Exporting large data from Reportviewer on azure hosted website.

    Hi,
    I have website hosted on azure. I used SSRS reportviewer control to showcase my reports. while doing so i faced an issue.
    Whenever i export large amount of data as Excel/PDF/word/tiff it abruptly throw following error:
    Error: Microsoft.Reporting.WebForms.ReportServerException: The remote server returned an error: (401) Unauthorized. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
    at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
    at Microsoft.Reporting.WebForms.SoapReportExecutionService.ServerUrlRequest(AbortState abortState, String url, Stream outputStream, String& mimeType, String& fileNameExtension)
    --- End of inner exception stack trace ---
    at Microsoft.Reporting.WebForms.SoapReportExecutionService.ServerUrlRequest(AbortState abortState, String url, Stream outputStream, String& mimeType, String& fileNameExtension)
    at Microsoft.Reporting.WebForms.SoapReportExecutionService.Render(AbortState abortState, String reportPath, String executionId, String historyId, String format, XmlNodeList deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension)
    at Microsoft.Reporting.WebForms.ServerReport.InternalRender(Boolean isAbortable, String format, String deviceInfo, NameValueCollection urlAccessParameters, Stream reportStream, String& mimeType, String& fileNameExtension)
    at Microsoft.Reporting.WebForms.ServerReport.Render(String format, String deviceInfo, NameValueCollection urlAccessParameters, String& mimeType, String& fileNameExtension)
    at Microsoft.Reporting.WebForms.ServerModeSession.RenderReport(String format, Boolean allowInternalRenderers, String deviceInfo, NameValueCollection additionalParams, Boolean cacheSecondaryStreamsForHtml, String& mimeType, String& fileExtension)
    at Microsoft.Reporting.WebForms.ExportOperation.PerformOperation(NameValueCollection urlQuery, HttpResponse response)
    at Microsoft.Reporting.WebForms.HttpHandler.ProcessRequest(HttpContext context)
    at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
    at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
    It works locally (developer machine) or having less data. But it didn't work with large data when publish on azure.
    Any help will be appreciated.
    Thanks.

    Sorry, let me clarify my questions as they were ambiguous:
    For a given set if input, does the request always take the same amount of time to fail? How long does it take?
    When it works (e.g. on local machine using same input), how big is the output file that gets downloaded?
    Also, if you can share your site name (directly or
    indirectly), and the UTC time where you made an attempt, we may be able to get more info on our side.

  • Problem while Exporting Table Data to Excel Sheet

    Hi All,
    Im getting problem while downloading the table data to Excel.
    Steps i was fallowed:
    1)created Context node with four attributs.
    2)created one attribut(resource) type:  com.sap.ide.webdynpro.uielementdefinitions.Resource
    3)Taken one Filedownload UI and Property resource bounded to (resource)
    4)Added required jar file in the library and copied the same jar file in the navigator lib file
    written the necessary coding but showing the below  problem in the Browser
    You must Flush before accessing the resource content
    Please give me any suggestion  on this
    Regards
    Polaka

    Hi
    Check this might help with Brian Fernandes comments.
    Flush?
    Regards
    Arun Jaiswal

  • Error MUT-02041 : While exporting the data from Java system.

    Dear Friends,
    When exporting data from Java system (source system) using SAPINST. We are getting
    the below error in 4 of 5 (Archiving SDM Repository) stage.
    Error :
    MUT-02041 SDM call of createsdmkitjar ends with returncode 2
    With this, I am unable to proceed further. Please help me on this to proceed further.
    Thanks in advance,
    regards,
    Srinivas

    Hi All,
    I could find the below error log from sapinst.log file.
    =============
    Info: Exclude components as specified
    in /usr/sap/IPD/DVD_JAVA/51033746_1/Installation_Master_6.20_6.40_05_08/IM_AIX_PPC64/SAPINST/COMMON/INSTALL/JMIG/EXCLUDE.XML
    Info: Resulting JAR
    file: /oracle/IPD/sapdata1/data_export/SDM/SDMKIT.JAR
    Info: No temporal directory for packing is provided. SDM home directory
    will be used.
    Info: Pack directory exists already. Remove it first.
    Info: Start packing the components of com.gsk in
    packedOrigin_com.gsk.jar
    Info: Create /usr/sap/IPD/JC02/SDM/program/pack/packedOrigin_com.gsk.jarInfo: The components of com.gsk were successfully packed in
    packedOrigin_com.gsk.jar
    Info: Start packing the components of local in packedOrigin_local.jar
    Info: Create /usr/sap/IPD/JC02/SDM/program/pack/packedOrigin_local.jar
    Info: Create /oracle/IPD/sapdata1/data_export/SDM/SDMKIT.JAR
    Warning: Warning during command execution: No metadata files exist for
    development
    component 'revtrac_agu11'/'local'/'LOKAL'/'0.2009.08.11.10.56.14'/'0'.
    Cannot pack this archive.
    No metadata files exist for development
    component 'revtrac_aug13eartest'/'local'/'LOKAL'/'0.2009.08.13.14.44.25'/'0'. Cannot pack this archive.
    No metadata files exist for development
    component 'Aug10_09'/'local'/'LOKAL'/'0.2009.08.10.14.39.29'/'0'.
    Cannot pack this archive.
    No metadata files exist for development
    component 'Aug14'/'local'/'LOKAL'/'0.2009.08.14.10.46.38'/'0'. Cannot
    pack this archive.
    No metadata files exist for development
    component 'Aug14two'/'local'/'LOKAL'/'0.2009.08.14.10.55.21'/'0'.
    Cannot pack this archive.
    No metadata files exist for development
    component 'revtrac_aug11b'/'local'/'LOKAL'/'0.2009.08.13.14.36.43'/'0'.
    Cannot pack this archive.
    Missing archives may lead to errors after the packed SDM installation
    has been extracted later.
    Info: This SDM installation has been packed
    to /oracle/IPD/sapdata1/data_export/SDM/SDMKIT.JAR
    To unpack this installation again,
    extract /oracle/IPD/sapdata1/data_export/SDM/SDMKIT.JAR and invoke the
    SDM command install with parameter extractpackedinst=true
    Executed, but finished with warning(s). Return code: 2
    Error: Executed, but finished with warning(s). Return code: 2
    ERROR 2010-10-21 15:54:48
    MUT-02041 SDM call of createsdmkitjar ends with returncode 2
    =============
    Can you please check this and help me on this to proceed further.
    thanks..
    Srinivas

  • How to give path in plsql while exporting table data into .csv file

    hi,
    i have a code like this
    PROCEDURE dump_table_to_csv (
    p_tname IN VARCHAR2,
    p_dir IN VARCHAR2,
    p_filename IN VARCHAR2
    IS
    l_output UTL_FILE.file_type;
    l_thecursor INTEGER DEFAULT DBMS_SQL.open_cursor;
    l_columnvalue VARCHAR2 (4000);
    l_status INTEGER;
    l_query VARCHAR2 (1000) DEFAULT 'select * from ' || p_tname;
    l_colcnt NUMBER := 0;
    l_separator VARCHAR2 (1);
    l_desctbl DBMS_SQL.desc_tab;
    BEGIN
    l_output := UTL_FILE.fopen (p_dir, p_filename, 'w');
    EXECUTE IMMEDIATE 'alter session set nls_date_format=''dd-mon-yyyy hh24:mi:ss''';
    DBMS_SQL.parse (l_thecursor, l_query, DBMS_SQL.native);
    DBMS_SQL.describe_columns (l_thecursor, l_colcnt, l_desctbl);
    FOR i IN 1 .. l_colcnt
    LOOP
    UTL_FILE.put (l_output,
    l_separator || '"' || l_desctbl (i).col_name || '"'
    DBMS_SQL.define_column (l_thecursor, i, l_columnvalue, 4000);
    l_separator := ',';
    END LOOP;
    UTL_FILE.new_line (l_output);
    l_status := DBMS_SQL.EXECUTE (l_thecursor);
    WHILE (DBMS_SQL.fetch_rows (l_thecursor) > 0)
    LOOP
    l_separator := '';
    FOR i IN 1 .. l_colcnt
    LOOP
    DBMS_SQL.column_value (l_thecursor, i, l_columnvalue);
    UTL_FILE.put (l_output, l_separator || l_columnvalue);
    l_separator := ',';
    END LOOP;
    UTL_FILE.new_line (l_output);
    END LOOP;
    DBMS_SQL.close_cursor (l_thecursor);
    UTL_FILE.fclose (l_output);
    EXECUTE IMMEDIATE 'alter session set nls_date_format=''dd-MON-yy'' ';
    EXCEPTION
    WHEN OTHERS
    THEN
    EXECUTE IMMEDIATE 'alter session set nls_date_format=''dd-MON-yy'' ';
    RAISE;
    END;
    I am getting error like :-------
    SQL> exec dump_table_to_csv('deptair','c:/csv','aa.deptair');
    BEGIN dump_table_to_csv('deptair','c:/csv','aa.deptair'); END;
    ERROR at line 1:
    ORA-00604: error occurred at recursive SQL level 1
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 8
    ORA-29280: invalid directory path
    ORA-06512: at "SCOTT.DUMP_TABLE_TO_CSV", line 58
    ORA-06512: at line 1
    pplease help me out
    thanks
    vicky

    look at your other thread, answer is already there.

Maybe you are looking for

  • Web DynPro Behaviour when the Reload button is pressed

    Hi, I'd like to know what is the behaviour of the Web DynPro when an user presses the Reload button on the browser. I'm asking this because I designed a WDP that has a view with some input fields, two button and a table to show the result of a search

  • OWB propagation from development to production environment

    Our department is in need to implement overall security around our production data warehouse. One issue that seems to bother our management is having only one OWB Designer where developers would have to be responsible enough to use snapshots and expo

  • Two Matrixs in one screen

    hello sir I am working on UDO Concepts,I created one screen same as PurchaseOrder Screen Item type and service type document in this i am taking one matrix for item document and one matrix for service document every thing is fine but while adding doc

  • SRM SC Workflow is not working as per BRF expressions

    We are having SRM 7.0 SP5 Based on SC item values, We are determining whether the process level is required or not using BRF expressions. For a particular data, only 2 process levels are selected. But I go into debugger mode and skip one process leve

  • When adding a mp4 videos as a slide, what should quality be changed to?

    When adding a mp4 videos as a slide, what should quality be changed to? (Optimized, J-Peg or High 24-bit) What will this do? Thanks, Mike