4.0.3 export the result of grid in xlsx for different data type

Hello

Using SQL Dev 4.0.3.16 build 16.84 principal.

Windows 7

Java 1.7u80

Run the query, click with the right button on the result of the grid:

When you export data in xlsx format, why the numbers data type has different type of font.

-Number / digital-> dialogue

n.jpg

-date and varchar2-> Calibri

v.jpgd.jpg

Step to reproduce:

1 run this query

Select 100 n, '100', to_date (1 January 2015 ',' DD-MM-YYYY "") as d

Double;

2. right click on the grid - export

3. choose the Format: excel 2003 + (xlsx)

Thank you.

Buntoro

This is a known behavior. And I think that there is a feature request to the SQL Developer Exchange, like the export of dates date request and not as text.

Concerning

Marcus

Tags: Database

Similar Questions

  • Procedure to export the result of the query to an excel or csv

    Hi all

    I have two identical paintings

    EMP_TEST OF THE EMP

    ID ID NAME

    1     SAM                      1        SAM

    2 JOHN 2 ROCK

    3 3 STEVE BRAND

    I need to combine the result under the query and intent to export data to excel using a procedure

    my query is

    Select 'EMP_ID', E1. EMP_ID, AND. EMP_ID from emp E1,

    emp_test AND WHERE E1. EMP_ID = AND. EMP_ID

    UNION

    Select "EMP_NAME", E1. EMP_NAME, AND. Emp E1 EMP_NAME,

    emp_test AND WHERE E1. EMP_ID = AND. EMP_ID

    but I get this error message

    ORA-01790: expression must have same type of corresponding data

    EMP_ID is a number and EMP_NAME is of type varchar.

    I need any idea or suggestion on sub queries.

    (1) I have to combine the result set in a single query.

    (2) I need to write the procedure that will export the result of the query to an excel or csv.

    Thank you.

    As PR has said, there are ways that have already been explained in this forum to write in external files. For your query condition, try this.

    SELECT CASE WHEN (REGEXP_LIKE (T1.ID,'[^ [: alpha:]] "")) THEN 'EMP_ID '.

    ELSE "EMP_NAME' END AS COL_NAME.

    T1.ID,

    T2.ID

    DE)

    SELECT CASE WHEN ID IS NULL THEN NAME ANOTHER TO_CHAR (ID) END AS ID,

    ROW_NUMBER () OVER(ORDER BY RN NULLS FIRST,ID) RN

    DE)

    SELECT ID, NULL,

    NAME,

    RN ID

    FROM EMP

    UNION ALL

    SELECT ID,

    NAME,

    RN NULL

    FROM EMP)) T1.

    (SELECT CASE WHEN ID IS NULL THEN NAME ANOTHER TO_CHAR (ID) END AS ID,)

    ROW_NUMBER () OVER(ORDER BY RN NULLS FIRST,ID) RN

    DE)

    SELECT ID, NULL,

    NAME,

    RN ID

    OF EMP_TEST

    UNION ALL

    SELECT ID,

    NAME,

    RN NULL

    OF EMP_TEST)) T2

    WHERE T1. RN = T2. RN;

    OUTPUT:

    COLUMN-NAME ID ID
    --------  ---------------
    1 1 EMP_ID
    2 2 EMP_ID
    3 3 EMP_ID
    SAM EMP_NAME MARK
    EMP_NAME JOHN JOHN
    EMP_NAME STEVE DARREN

    6 selected lines.

  • Export the results of a query to a CSV file

    Hello

    My requirement is that I need to export the results of a query to a CSV file. Can someone please suggest a way to also include the names of columns in the CSV file?

    Thanks in advance.

    Annie

    Following code comes from asktom. I changed to include the column header. This will get your CSV file desired for a given query.

    create or replace function  dump_csv( p_query     in varchar2,
                                          p_separator in varchar2
                                                        default ',',
                                          p_dir       in varchar2 ,
                                          p_filename  in varchar2 )
    return number
    AUTHID CURRENT_USER
    is
        l_output        utl_file.file_type;
        l_theCursor     integer default dbms_sql.open_cursor;
        l_columnValue   varchar2(2000);
        l_status        integer;
        l_colCnt        number default 0;
        l_separator     varchar2(10) default '';
        l_cnt           number default 0;
    
         l_colDesc          dbms_sql.DESC_TAB;
    begin
        l_output := utl_file.fopen( p_dir, p_filename, 'w' );
    
        dbms_sql.parse(  l_theCursor,  p_query, dbms_sql.native );
    
        for i in 1 .. 255 loop
            begin
                dbms_sql.define_column( l_theCursor, i,
                                        l_columnValue, 2000 );
                l_colCnt := i;
            exception
                when others then
                    if ( sqlcode = -1007 ) then exit;
                    else
                        raise;
                    end if;
            end;
        end loop;
    
        dbms_sql.define_column( l_theCursor, 1, l_columnValue, 2000 );
    
        l_status := dbms_sql.execute(l_theCursor);
    
         dbms_sql.describe_columns(l_theCursor,l_colCnt, l_colDesc);
    
         l_separator := '';
    
         for lColCnt in 1..l_colCnt
         loop
                utl_file.put( l_output, l_separator ||  '"' || Upper(l_colDesc(lColCnt).col_name) || '"');
                   l_separator := p_separator;
         end loop;
    
         utl_file.new_line( l_output );
    
        loop
            exit when ( dbms_sql.fetch_rows(l_theCursor) <= 0 );
            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 := p_separator;
            end loop;
            utl_file.new_line( l_output );
            l_cnt := l_cnt+1;
        end loop;
        dbms_sql.close_cursor(l_theCursor);
    
        utl_file.fclose( l_output );
        return l_cnt;
    end dump_csv;
    

    The original link is below.

    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:95212348059

    Thank you
    Knani.

  • How to create a Subscriber variable to the network &amp; OnDataUpdate for Variant data type?

    Looking at the example C:\Documents and Settings\All Users\Documents\National Instruments\MStudioVS2008\DotNET\Examples\NetworkVariable\Basic\cs\Subcriber.2008, how can I create a subscriber to the network variable and OnDataUpdate for Variant data types?

    All tracks will be useful. Thank you.

    I solved it by using the correct data type in .NET, for example an sbyte to CVIInt8.

  • A question about the conservation of fields (hour, min, sec) time DATE type in the table on the changes of NLS_DATE_FORMAT

    Hello

    Oracle version: 12.1.0.1.0 - 64 bit

                      OS:   Fedora Core 17 X86_64

    My question is about the conservation of fields (hour, minute, second) time DATE type in the array on NLS_DATE_FORMAT changes.

    Take the following test case:

    SQL> create table tmptab(dateval date);
    
    Table created.
    
    SQL> alter session set nls_date_format = 'yyyy-mm-dd hh24:mi:ss';
    
    Session altered.
    
    SQL> insert into tmptab(dateval) values('2014-01-01 00:00:00');
    
    1 row created.
    
    SQL> insert into tmptab(dateval) values('2014-01-01 10:00:00');
    
    1 row created.
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select * from tmptab;
    
    DATEVAL
    -------------------
    2014-01-01 00:00:00
    2014-01-01 10:00:00
    
    SQL> alter session set nls_date_format = 'yyyy';
    
    Session altered.
    
    SQL> select * from tmptab where dateval > '2014';
    
    no rows selected
    
    SQL>
    

    I don't understand why it returns nothing. The second test case above insert statement inserted a line with 10 as the value for the time of the DATE field column dateval.

    Accordingly, while comparing this with the literal '2014' (which based on the new value of NLS_DATE_FORMAT = "yyyy" is implicitly converted to DATE), shouldn't the above query returns the line 2014-01-01 10:00 ?

    I mean, I changed the NLS_DATE_FORMAT but data from time in the table fields are preserved and that's why they should normally be taken into account in the comparison of date.

    What I'm trying to say is that for me (Please correct me if I'm wrong), no matter what NLS_DATE_FORMAT configuration is the following test

    SQL> select * from tmptab where dateval > '2014';
    

    is the same thing that

    SQL> select * from tmptab where dateval > to_date('2014-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss');
    

    And because the line 2014-01-01 10: 00:00 in the tmptab table. The following test

    2014-01-01 10:00:00 > to_date('2014-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss')
    

    evolves normally true (beucase of TIME = 10 on the left side of the test) and therefore this line must be returned which is not the case in the test above.

    You kindly could you tell me what I misunderstood?

    Thanks in advance,

    This is the price for the use of implicit conversions. Implicit DATE conversion rules are not as direct as it can be assumed. In your case, all you provide is year as date format. In this case date implicit conversion rules assumes that month in the current month, day 1 and time as 00:00:00.

    SQL > alter session set nls_date_format = "yyyy";

    Modified session.

    SQL > select to_char (to_date ('2014 "), ' mm/dd/yyyy hh24:mi:ss') twice;

    TO_CHAR (TO_DATE('20)
    -------------------
    01/08/2014-00:00:00

    SQL >

    So, when you start:

    Select * from tmptab where dateval > '2014 '.

    Oracle implicitly converts date using "YYYY", which translates as August 1, 2014 '2014'. That's why your quesry returns no rows.

    SY.

  • How to run SQL and export the results to Excel

    My task is to run a custom SQL script and create an Excel file through SQL Developer running from the command line (called by a scheduled script). Is this possible using SQL Developer?

    First, the thing I will try is to run a report user-defined in SQL Developer and save the results in an Excel file. Only 16000 result lines, but took 10 minutes to do the export and still cannot complete. Is there another way to do it?

    Thank you very much.

    Can't be done, but this is requested already exchanging SQL Developer, you can vote here and add weight to the possible future implementation.

    Kind regards
    K.

  • Export the result to an Excel file

    I use the attached script to export the inventory then as excel file. I used LucDtechnical of this post to store information in a CSV temp and later, save them to a XLS file. I need to perform a certain formatting in the report, as to change the size of the font of the header, adding some background colors.

    Do not the formatting as I am exporting to a CSV file. Is there another way to achieve the formatting?

    You can take a look at my post Export-Xlsx, the suite and ordered data .

  • get the value of the maximum value of a column for a particular type

    Hello.
    I have a query which returns the output something like

    Type of VersionNo ID ProductID VersionID category unusual
    1130 16650 16650 1193 5 Category1
    1130 16650 16650 1205 5 Category2
    1130 16650 16650 1242 5 category3
    1130 16650 1130 1001 1 Category1
    1130 16650 1130 1081 1 category3
    1131 16656 16656 1193 4 Category1
    1131 16656 16656 1205 4 Category2
    1131 16656 16656 1240 4 category3
    1131 16656 1131 1001 1 Category1
    1131 16656 1131 1081 1 category3

    I want to see the result that all the VersionId for the same ID values should have the same value for the category and it should be the value that is there for the maximum versionNo for a particular Type of «» Something like


    Type of VersionNo ID ProductID VersionID category unusual
    1130 16650 16650 1193 5 Category1
    1130 16650 16650 1205 5 Category2
    1130 16650 16650 1242 5 category3
    1130 16650 1130 1193 1 Category1
    1130 16650 16650 1205 1 Category2
    1130 16650 1130 1242 1 category3
    1131 16656 16656 1193 4 Category1
    1131 16656 16656 1205 4 Category2
    1131 16656 16656 1240 4 category3
    1131 16656 1131 1193 1 Category1
    1131 16656 16656 1205 1 Category2
    1131 16656 1131 1240 1 category3

    Does anyone know how to do this?

    Ok
    Try:

    WITH test_data AS (
    SELECT 1130 RecID, 16650 ProductID,  16650 VersionID, 1193  Category,  5 VersionNo, 'Category1' Type FROM DUAL UNION ALL
    SELECT 1130, 16650, 16650, 1205, 5, 'Category2' FROM DUAL UNION ALL
    SELECT 1130, 16650, 16650, 1242, 5, 'Category3' FROM DUAL UNION ALL
    SELECT 1130, 16650, 1130, 1193, 1, 'Category1' FROM DUAL UNION ALL
    SELECT 1130, 16650, 1130, 1205, 1, 'Category2' FROM DUAL UNION ALL
    SELECT 1130, 16650, 1130, 1242, 1, 'Category3' FROM DUAL),
    -- end test data
    max_data AS (
    SELECT RecID, ProductID, VersionID, Category, VersionNO, Type
      FROM test_data td1
     WHERE VersionNo = (
      SELECT MAX(VersionNo)
        FROM test_data td2
      WHERE td1.RecID = td2.RecID
         AND td1.ProductId = td2.ProductID))
    SELECT RecID, ProductID, VersionID, Category, VersionNO, Type
      FROM max_data
      UNION
    SELECT md1.RecID, md1.ProductID, td1.VersionID, md1.Category, td1.VersionNO, md1.Type
      FROM max_data md1
      JOIN test_data td1
     ON (md1.RecID = td1.RecID AND md1.ProductID = td1.ProductID)
    ORDER BY 1,2,3,5, 6
    
         RECID  PRODUCTID  VERSIONID   CATEGORY  VERSIONNO TYPE
    ---------- ---------- ---------- ---------- ---------- ---------
          1130      16650       1130       1193          1 Category1
          1130      16650       1130       1205          1 Category2
          1130      16650       1130       1242          1 Category3
          1130      16650      16650       1193          5 Category1
          1130      16650      16650       1205          5 Category2
          1130      16650      16650       1242          5 Category3
    

    And you simply:

    WITH max_data AS (
    SELECT RecID, ProductID, VersionID, Category, VersionNO, Type
      FROM test_data td1
     WHERE VersionNo = (
      SELECT MAX(VersionNo)
        FROM test_data td2
      WHERE td1.RecID = td2.RecID
         AND td1.ProductId = td2.ProductID))
    SELECT RecID, ProductID, VersionID, Category, VersionNO, Type
      FROM max_data
      UNION
    SELECT md1.RecID, md1.ProductID, td1.VersionID, md1.Category, td1.VersionNO, md1.Type
      FROM max_data md1
      JOIN test_data td1
     ON (md1.RecID = td1.RecID AND md1.ProductID = td1.ProductID)
    ORDER BY 1,2,3,5, 6
    
  • Keep details of the folder is changed in default for any file type.

    I would like to have the details for the defined folder to 'Name', 'Update', 'Type' and 'size '.
    But every time I save a file in this folder, the details in this case happen to the default value for the type of file, I just saved.
    Ex: I save an mp3 in a folder and the details get passed to 'Name', 'Artists', 'Album', ' # ', 'Gender' and 'Notation '.
    Or, if I save an image, the details mode 'Name', 'Date', "Tags", "Size" and "rating".

    It's really annoying. I want the details of the case to stay on what I put them.

    Here's how to change the default template for a folder: http://www.vistax64.com/tutorials/70819-windows-explorer-folder-view-settings.html.  Default behavior is to select the model based on the first type of file placed in the folder (you must choose something).  Vista sets the folder type template according to what are the types of files in the window and the settings display window Explorer. This will show how to reset the display settings for the Windows File Explorer, disable Automatic folder Type Discovery (which is I think what you want)and increase the folder display the cache to make Vista do not forget the display settings, the folder type template, the size or the position of a specific window for when it was still closed to the location of specific path.

    It does not work with the Sub record under, Open with, open in a new tab (Internet Explorer), etc... dialog windows of type through the good File menu bar item. These don't seem to be able to have their size or their position to recall. For the latter, you can use the free program AutoSizer to resize them.

    Here is another article on how to modify the columns in Windows Explorer and sort in Vista: http://www.vistax64.com/tutorials/108665-column-customize.html.  This will show you how Add, Remove, move, change the widthand change the sort order of the columns in Windows Explorer in the way that you want.

    Here is another article on how to change the display of the default folders in Vista (but she argues, it is not a perfect solution and can revert to the previous behavior is not as good as the two prior links provided: http://news.cnet.com/8301-13880_3-10019957-68.html.)

    I hope this helps in your situation.

    Good luck!

    Lorien - a - MCSE/MCSA/network + / A +.

  • Check the value of the attribute of a child node to xmltype data type.

    Hello

    I have a xml stored in the column with the data type as "XMLTYPE.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <Settings>
      <Setting Name="A1" Value="N"/>
      <Setting Name="A2" Value="N"/>
      <Setting Name="A3" Value="SOMEVALUE"/>
      <Setting Name="A4" Value="N"/>
      <Setting Name="A5" Value="Y"/>
      <Setting Name="A6" Value="N"/>
    </Settings>
    I don't want to loop in each child node. But want to know if the value of the A5 parameter is Y or N? Is there a way I can find it without making the child node extract "Setting" and then a loop of each node to find the value?

    Kind regards

    You specify your Oracle version then here are two options. If 10.2 or higher, use XMLTable, otherwise use the option of ExtractValue.

    -- The WITH simply simulates your existing table that I do not have.
    WITH fake_tab AS
    (SELECT XMLTYPE('
    
      
      
      
      
      
      
    
    ') tab_col
      FROM dual)
    -- For 10.2 and higher use this SELECT
    SELECT a5
      FROM fake_tab,
           XMLTABLE('/Settings'
                    PASSING fake_tab.tab_col
                    COLUMNS
                    a5   VARCHAR2(10)  PATH 'Setting[@Name="A5"]/@Value');
    
    -- For 10.1 and before
    SELECT ExtractValue(tab_col, '/Settings/Setting[@Name="A5"]/@Value')
      FROM fake_tab;
    
  • How to export the result of the SQL via automation like ksh file

    Hello
    I did a query sql statement, this sql file will be called using the ksh file.
    As soon as the ksh is double clicked, the sql will be called and executed on the database.

    Here is my file KSH syntax.

    sqlplus-s user/pass@database < < END
    @D:/sql/export.sql
    OUTPUT
    END

    We want to automate the generation of output result. Such that, when the ksh files are completed, the output from the export.sql will export a .csv or .dat file in the directory defined. Thus, automation is launched without having to manually export in the Toad for sql.

    Please let me know if this is possible? and give an example of the syntax to use? If not, let me know what corrective measures would be to achieve this? Thank you very much for your help.

    Published by: user10070712 on November 20, 2012 03:39
    set colsep ','
    set heading off
    set feedback off
    spool /tmp/result1.csv
    select * from table;
    spool off
    
    set heading off
    set feedback off
    spool /tmp/result2.csv
    select column1 || ',' || column2 || ',' || column3 ... from table;
    spool off
    
  • Export the results of the research of several PDF files

    Hi all

    I have a set of over 100 000 documents PDF, and seeks to identify those documents that contain a set of four numbers.  Preforably I would like to export this list in the format in which I can link to each document - ideally an Excel xls document.  Any advice on the export of an index search in Adobe or any other proposed option would be very useful.  Thanks in advance.

    See you soon,.

    Terry

    You will need Acrobat X or higher to do this, but here's how I would perform this task:

    (1) create an index of full text of the document as a whole (and I guess your 100K files all contain searchable text content)

    (2) run your search index via the advanced search of Acrobat functionality

    (3) save results to one. CSV file, which was a long-awaited feature that came to Acrobat X

    (4) when you open it. CSV in Excel (you can save as .xls (x) one more flexibility), you will have a list of file names, then a sublist of the page where the search took place

    (5) from there, you'll need to manipulate the data in the Excel worksheet to list the full filepaths for each line, how you should then be able to open the file directly from your Excel sheet.

    Doing the open to the exact PAGE Excel sheet is a bit more complex, but it is also possible with some VB scripts.  You can search for it on the web if you want an example of code.

    FYI, I approach this concept a little differently in my book, where I use a simple VB script instead of paths, I say just to point out that there are several options to set up the links once you're in Excel.

    Hope that helps!

    Jason Covey

    PDF Litigation Solutions, LLC

    www.pdflitigationguide.com

  • Divergence in the view 'real size' and PDF export the result

    I work with a document and leave me perplexed by the size when I export to PDF. When I export it and open it, the font size is considerably larger than those of my document in view "actual size." In addition, the page sizes are also larger, 60% larger.

    In addition, the size of the PDF file can vary on different computers?

    I am creating an ebook so I want to open a favorable for everyone, if possible size...

    You need guidelines?

    Take a look at this thread...

    http://forums.Adobe.com/message/3023679#3023679

  • How to export the results of the DIAdem script to Excel sheet?-attachment

    Please, this is the Script file for, y previous question?

    Hi lhab.

    Try to keep this discussion going on a wire

  • With the help of 1102 and 1308 cards for different input types

    If I use maps 1102 and 1308 to receive both voltage and current signals, remove the resistance of the 1308 on channels, I don't want tension?  I guess that is another way of asking, is it possible to always send the current signals "through" the 1308 directly to the 1102 so that I can use only one card of 1102 for my application?

    Hello Jim,

    Thanks for the clarification, I misunderstood the original investigation.  When you reference the Manual for the SCXI-1308 module, it can be read on page 2 you can measure the current and voltage.  In order to measure the voltage, you should remove the resistance of the current loop, and later, he identifies the resistance and their respective channels on the next page, 3.  That said, delete the resistance won't be a problem.

    Best,

Maybe you are looking for