SQL Developer: How to copy the data with the output grid column headers?

Hello

I use the 2.1.1.64 Version.

I run a SQL query, down the results grid in the "Query result" window below. Say that I get 10 rows returned, with 5 columns.

I want to copy this whole grid, as well as the names/column headers to the Clipboard. If I can stick under the original query to document the results of this query.

I can't find any way to do this. I can copy/paste the results grid, but it does not copy the headers.

The only way I think to do is to go through many steps to export in a TXT file, then paste that. Unfortunately, that's a lot of steps wasted if I need to do it again and again, and more, the output is pasted in an ugly format with double quotes, etc..

It seems that the easiest feature is copy and paste the entire grid of the results, and of course, you could the headers. Why is it so difficult/impossible to do?

(I think that the toad has the same problem. DBArtisan lets you copy and paste the results together, as well as headers, however.)

Any help would be appreciated!

Thank you
John

Shift-Ctrl-C will copy the headers of columns as well as the selected data.

Tags: Database

Similar Questions

  • Oracle SQL Developer - how to display the date with TIME

    OK I change the setting of the NLS to DD-MON-RR HH.MI. SS
    (Tools-> Preferences-> database-> parameter NLS)

    BTW - what is changing the format of the database or just my client side? I don't want to change the database and other users would be affected by my change.


    I check the date time poster by practice
    SELECT double TO_CHAR(SYSDATE + 1, 'DD-MON-YYYY HH:MI:SS');

    Returns
    JUNE 24, 2009 10:32:55

    OK, here is my problem or question...
    but I wan't do in East... I have a column in a table that stores a number of minutes from a given date...
    the given date is 12/30/1899 00:00:00

    If I want to display the minutes in a format of date and time... but when I do
    Select To_TIMESTAMP (30 December 1899 00:00:00 "," mm/dd/yyyy HH24:MI:SS) + (Start_Moment) / 1440.
    To_Date (30 December 1899 00:00:00 "," mm/dd/yyyy HH24:MI:SS) + (Stop_Moment) / 1440
    from tableA

    RESULTS
    22 JUNE 09 23 JUNE 09

    I tried the function TO_CHAR but don't have time to be like
    Select TO_CHAR (to_date('12/30/1899 00:00:00', 'mm/dd/yyyy HH24:MI:SS') + 57580140 / 1440) double

    RESULTS
    22 JUNE 09

    I don't know that it's the simple convert function that I do not know...

    Mark as answer?

  • How to copy the recovery on the new HARD drive partition, HARD drive failed?

    Hallo,

    I have a Compaq Mini netbook with Windows 7 Starter.

    The HARD drive has failed and it is not repairable. However, it seems that the recovery partition is OK.

    I want to buy a new HARD drive, install the driver on the netbook, and then use the tools/recovery partition to install windows 7 on a new PC.

    So, the question is simple: how to copy the recovery for the new HARD drive partition?

    Hello s91066.

    If your hard drive of your laptop doesn't have? If this is the case, what do you mean by the "recovery partition is ok? I doubt that this laptop has two hard disks, so if you are able to see this partition of your hard drive may still work.

    You will need a set of recovery disks to restore the partitions on the new drive. If you can start Windows, which you can probably not with a dead hard drive, you can follow these steps if you can get into Windows.

    If you are unable to boot into Windows, you need a set of disks. You can order it directly from HP. The number of the United States / Canada is 1-800-474-6836. If you are in another domain, you must visit HP's Support around the world to find contact information for your region.

    I hope that is useful; have a great weekend!

  • How to copy the code snippet?

    Hi all, please help me. How to copy the code snippet? (screenshot)

    div.png

    If you want to avoid using drag-to-select your operating system function to select blocks of code starting and ending with a specific tag, you can do the following...

    1. click anywhere in the code in the tag/block to copy
    2. click on the button select the Parent tag in the toolbar display of Code on the left side of the display window of the Code (the icon with a pointer arrow inside sharp brackets)
    3. press Ctrl + C

    Repeated by clicking on the button will continue select parent tag higher following.

  • How to create dummy data with 1 TB

    Hi Expert,

    May I know how to create dummy data with 1 TB to test performance. ?

    Respect of

    Liang

    what columns you want to include? Basically, you can generate as many lines as you like to connect by queries - something like:

    create the table big_t

    as

    with

    generator1 like)

    Select rownum id

    of the double

    connect by level<=>

    )

    ,

    generator2 as)

    Select lpad ('* ', 1000,' *') col1

    of the double

    connect by level<=>

    )

    Select g1.id

    g2.col1

    of generator1 g1

    generator2 g2

    ;

    Of course, it is not 1 TB, but you can change the number of levels. Who said: I think you need to find a sensitive table first structure.

  • How to validate a date with time

    Hi all

    How can I validate date with time?

    Here is my code:

    var tempDate:Date = new Date();

    If (tempDate < 18 September 2012 07:30 ') {}

    doSomething

    }

    Thanks in advance

    A cleaner way is the dateCompare method:

    If (ObjectUtil.dateCompare (date1, date2) > 0) {}

    Date1 > date2

    } else ObjectUtil.dateCompare (date1, date2)<0)>

    date2 > date1

    } else {}

    date2 is date1

    }

  • How to copy the parameter FDM (import format, mapping of dimension, the command table)

    Dear all,
    How to copy the parameter FDM (import format, mapping of dimension, table of control) of application to another application.
    I found that one dimension mapping can be imported. Is it possible to copy the FDM application quickly?

    Thank you for your help

    If you get a chance try the following script, it is so simple and easy to extract all the map as XML data and help to import via import script.

    ---------------
    Void MapExtractor()
    '------------------------------------------------------------------
    "Script custom upstream Internet link:
    '
    "Created by: SatyaK"
    "Creation date: 08/12/09.
    '
    ' Object: this Script will produce a file of account mapping for
    "the current location.
    '
    '------------------------------------------------------------------

    'Run the export '.
    strFilePath = API. IntBlockMgr.InterfaceMgr.fExportMapToXML ("File Path", PPOVPeriod)

    End Sub

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

  • How to copy the numbers in a cell to another cell and gets their total

    500.40

    192932.90

    231838 * 90

    290414 * 15

    222312 * 15

    222314 * 5

    141722 * 20

    Hello, can I ask how to copy the numbers after the period/asterisk to another cell and then add up all the numbers copied without having to type them.thank you

    Hi mirijin,

    Break the problem into small steps:

    Step 1. All separators (periods and asterisks) convert the asterisks.

    Formula in B2 (fill down)

    = SUBSTITUTE(A2,".","*")

    Step 2. Find the position of an asterisk in each cell.

    Formula in C2 (fill down)

    = FIND("*",B2)

    Step 3. Extract everything to the right of the asterisk.

    Formula in D2 (fill down)

    = RIGHT (B2, LEN (B2) −C2)

    Step 4. Convert the text to numbers re using the VALUE function.

    Formula in E2 (fill down)

    VALUE = (D2)

    This table has a header row and footer of the line, so the SUM in E9 apply to all cells in the body.

    = SUM (E)

    You can combine the individual forms in a unique and complex formula, or simply to hide intermediate columns B, C and D:

    Kind regards

    Ian.

  • How to copy the attachment

    How to copy the attachment

    Save the attachment to disk, such as the desktop.  Then copy it to another location and you have a copy.

    Steve

  • How to find the primary key columns in the tables in MS Access using SQL queries

    How to find the primary key columns in the tables in MS Access using SQL queries

    Hello

    This is the forum for Windows Vista programs related issues.

    For better assistance, please try instead the Forums in SQL Server .

    Thank you! Vincenzo Di Russo - Microsoft MVP Windows Internet Explorer, Windows Desktop Experience & security - since 2003. ~ ~ ~ My MVP profile: https://mvp.support.microsoft.com/profile/Vincenzo

  • How to count the number of columns in an oracle table using sql

    How to count the number of columns in an oracle table using sql

    You must put the name of the table in capital letters

    As

    SELECT COUNT(1)
      FROM user_tab_columns
    WHERE table_name = 'EMP';
    
    or
    
    SELECT COUNT(1)
      FROM user_tab_columns
    WHERE table_name = UPPER('Emp');
    

    Concerning
    Arun

  • How to remove the output of a SELECT on the page out of the Script

    Hello

    I'm running a particular piece of SQL with bind variables. The goal is to get the execution
    plan using DBMX_XPLAN. DISPLAY_CURSOR.

    To get the variables and bind the values of the variables in make them work, I found that I have to select
    instructions in the worksheet, and then press F5.

    It's working very well, but the question I have, is that this SQL data returns more 60 000 rows.

    I don't want to see the lines, and in addition there are limits on the number of rows can be displayed
    in SQL developer.

    Is there a way I can delete the results of the SQL query that appears in the output window of the Script?

    I tried:

    termout off Set
    Set autotrace traceonly
    set pagesize 0

    But nothing makes no difference. Surely I can stop behaving this way? Any suggestions?

    I use SQL Developer 3.2.09

    Thank you!

    Paul Stuart

    Hi Paul,.

    I don't believe it. Same queue the result of a query (whether inline or embedded via @.sql) does not output to the spreadsheet results pane. And internally, to explain the Plan and auto-trace, Developer SQL uses dbms_xplan.display instead of display_cursor.

    Probably your best bet is to reduce total output via Tools | Preferences | Database | Worksheet | Max lines to print in a script. That the setting does not affect the SQL sent to the database, it just limits how the SQL Developer result set that bothers to display when you run Script. Any information you get from display_cursor should be affected. Of course, the worksheet sends many other SQL to the database, that you don't see, so based on the default behavior of 'Look the last cursor' will not work. I assume that you have already taken into account for this.

    Kind regards
    Gary
    SQL development team

  • How to reference the names of columns, if you use select *.

    Hello

    How to reference the names of columns to get out of the data, when you use select * and not aware of the column names (and number of columns) in advance.

    Even if I could get the column names in the other variables. I am new to CF so question may be stupid.

    getting column names: -.

    < cfquery datasource = "RTW_ORA" name = "cn" >
    SELECT COLUMN_NAME
    OF ALL_COL_COMMENTS
    WHERE TABLE_NAME = ' #meas #
    < / cfquery >

    obtain data: -.

    < cfquery datasource = "RTW_ORA" name = "cd" >
    SELECT *.
    To #meas #.
    < / cfquery >

    How do all the output data?

    Any help would be much appreciated!

    Thank you

    Tushar Saxena

    How to reference the names of columns to get out of the data, when you use select * and not aware of the column names (and number of columns) in advance.

    Even if I could get the column names in the other variables. I am new to CF so question may be stupid. getting column names: -.


    SELECT COLUMN_NAME
    OF ALL_COL_COMMENTS
    WHERE TABLE_NAME = ' #meas #

    obtain data: -.


    SELECT *.
    To #meas #.

    How do all the output data?

    Your question is not stupid. You can use the concept of a query requestand their properties cfquery attributes name and result.


    SELECT *.
    To #meas #.






    column names: #column_names #.

    number of columns: #no_of_columns #.



    SELECT #column_names #.
    FROM the cd



    A SQL query: #resQoQ.sql #.

    Query:


       
       
    #column #: #cd [column] [currentrow] #.
       


    T/t:


       
    #column #: #QoQ [column] [currentrow] #.
       


  • How to set the size of column sqlplus.exe?

    SQL> select * from dba_cons_columns where user='USER1' and table_name='PARENT1';
    
    OWNER                          CONSTRAINT_NAME
    ------------------------------ ------------------------------
    TABLE_NAME
    ------------------------------
    COLUMN_NAME
    --------------------------------------------------------------------------------
      POSITION
    ----------
    USER1                          PARENT1_PK
    PARENT1
    COL2
             2
    
    
    OWNER                          CONSTRAINT_NAME
    ------------------------------ ------------------------------
    TABLE_NAME
    ------------------------------
    COLUMN_NAME
    --------------------------------------------------------------------------------
      POSITION
    ----------
    USER1                          PARENT1_PK
    PARENT1
    COL1
             1
    It seems little ugly to see these data. Why the length of the column is so long? Please tell how to set the length of columns and other settings so that the displayed data should come out in the form of a well managed and beautiful way.
    Like this:
    OWNER     CONSTRAINT_NAME     TABLE_NAME       COLUMN_NAME   POSITION
    -----------     ----------------------------     ------------------        ---------------------    --------------
    USER1        PARENT1_PK              PARENT1             COL2                  2
    USER1        PARENT1_PK              PARENT1             COL1                  1
    I wrote this by hand. How do I get the display to sqlplus.exe?

    Easiest would be to use the command column format and also the linesize option.

    sql>column column_name format a30
    sql>set linesize 300
    

    The order of column would make the display limited to 30 characters only. Also the linesize enlarge the display. Try it and see what it looks like?

    HTH
    Aman...

  • How to store the output of a statement select * statement in a file?

    How to store the output of a statement select * / statement of dsc in a file?

    As user sys:

    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    /
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /
    

    As myuser:

    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      --
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;
    

    This allows the header line and the data to write into files separate if necessary.

    for example

    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    
    PL/SQL procedure successfully completed.
    

    Output.txt file contains:

    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10
    

    The procedure allows for the header and the data to separate files if necessary. Just by specifying the file name "header" will put the header and the data in a single file.

Maybe you are looking for