Format script output in SQL developer

HI,
when I use sql plus every column is separated while in sql developer is mixed, or coalesced.
I cannot clearly see the columns in the output.
tnx
Edited by: user10491698 on 07-Sep-2011 06:37

You could ask in the {forum:id=260} forum ;-)

Similar Messages

  • How to flush script output in sql developer

    Greetings from a newbie,
    how can I flush script output in sql developer?
    regards,
    Valerie

    Flush? You can wipe the Output pane by pressing the "Clear" icon (crayon gum): the first icon on the tab's mini-toolbar.
    Does that answer your question?
    K.

  • Truncated script output in SQL Developer ... what options are there?

    SQL Developer 1.5.5
    I have tried the following:
    1) put a statement like this in the SQL Worksheet ( select dbms_sqltune.report_sql_monitor(session_id=>sys_context('userenv','sid')) from dual; )
    2) highlight the text and right click on "Run Script"
    The output will appear in the script window ( evidently a CLOB is returned ). Sometimes you will get a complete report but often if the SQL statement is long the output is truncated. It can look like this at the end:
    DBMS_SQLTUNE.REPORT_SQL_MONITOR(SESSION_ID=>SYS_CONTEXT('USERENV','SID'))
    *** LINES REMOVED ***
    (CLOB) SQL Monitoring Report
    *** LINES REMOVED ***
    Last Refresh Time : 09/22/...
    1 rows selected
    Three dots appear just near the end of the output then I get the message 1 rows selected.
    Using sqlplus I would set it up something like this and put it out to a file:
    spool latest_sql_monitor_report.txt
    set long 10000000
    set longchunksize 10000000
    set linesize 200
    select dbms_sqltune.report_sql_monitor(session_id=>sys_context('userenv','sid')) from dual;
    spool off
    If I do the same basic thing in Toad I can get all the lines of output.
    Ideas anyone?
    Thanks John
    Edited by: John Hurley on Sep 22, 2009 2:38 PM

    Instead of running as script (F5), execute as statement (F9). This should put the CLOB in the result grid, hopefully complete.
    Hope that helps,
    K.

  • Copying SQL Script from Oracle SQL Developer into Excel with formatting

    I need to copy a SQL Script into Excel in order to develop some VBA code. Is there any nice way that I can copy SQL Script from Oracle SQL Developer into Excel and retain its formatting? I am a stickler for having legible, readable SQL and like to have all my columns lined up and aliases lined up. When we used to use SQL Navigator, the tab formatting seemed to copy and paste just fine. Now that we have migrated to Oracle SQL Developer, the formatting seems to get all messed up.
    And suggestions are greatly appreciated and Thanks in advance for your review and am hopeful for an answer.
    Thanks.
    PSULionRP

    I suppose you want a real tabulator instead of spaces. You can configure this in the preferences (SQL Formatter - Oracle). You have to apply it then to your existing code (e.g. CTRL-F7), but new code should get it right from the start.
    Hope that helps,
    K.

  • SQL Developer formatting script output

    Im new to sql developer. I have been unable to format the script output to decrease the width of the column below.
    All numeric columns seem to use 22 underscores. I would like to format this to make it more presentable to users.
    I have tried column, substr, and the various trims. While these work in native unix, they do not seem to work in
    SQL Developer. Up till now I have found SQL Developer to be a very usefull tool. I hope this is just a matter of me not
    having enough knowledge of the product and not a problem with it.
    Any and all assistance greatly appreciated.
    MACCNO
    3021202

    788184 wrote:
    What I need is to produce the following (column is numeric 5)
    HEAD1
    12345
    instead of what comes out currently
    HEAD1
    12345
    Yes, have checked preferences but could not see anything to change.
    Edited by: 788184 on 12/08/2010 19:55I think the problem is related to SQL*PLUS. SQL Developer tries to mimick SQL*PLUS whan you run something as a script. The mimicking s not perfect though.
    The size of this line depends on the typeof the database field. For numbers a larger line is taken. For varchar2 it depends from the size of the values or the header.
    If you are absolutly sure that data inside this column is always smaller, then you could try the following thing.
    select cast(HEAD1 as varchar2(5)) as HEAD1 from yourTableBe careful since this will do a number to string conversion. But since it seems to be for reporting purposes that should be ok.

  • Formatting SQL Output in SQL Developer

    I tried to google around a little bit and wasnt able to find an answer really.
    In 10g and in SQL plus i remember being able to format output as follows
    Using the generic HR schema and the following query i get the following output
    BREAK ON REPORT
    COMPUTE SUM LABEL TOTAL OF SALARY ON REPORT
    SELECT LAST_NAME, SALARY
    FROM EMP_DETAILS_VIEW
    WHERE JOB_ID='SA_MAN';
    Expected output
    LAST_NAME SALARY
    Russell 14000
    Partners 13500
    Errazuriz 12000
    Cambrault 11000
    Zlotkey 10500
    TOTAL 61000
    Now using SQL developer I am no longer getting the TOTAL line and only the following
    LAST_NAME SALARY
    Russell 14000
    Partners 13500
    Errazuriz 12000
    Cambrault 11000
    Zlotkey 10500
    Was this unique to SQL plus the formatting?
    Is there anything similar i can do in SQL Developer?
    Thanks in advance

    SQL Developer
    As its name implies, it was never intended to be a data reporting utility.
    It was designed to develop SQL & PL/SQL code.
    When your only tool is a hammer, all problems are viewed as nails.
    While a hammer is a GREAT tool, it is suboptimal to divide 1 board into 2 pieces.
    My father always told me to use the proper tool for the task at hand.
    You should consider following this advice.

  • Formatting Script Output

    Why does SQL Developer ignore
    col name format a15 ?
    col name format a15
    col value format a15
    select name,value from v$parameter
    where name ='statistics_level'Each column length seems to default to 80 charaters.
    I end up needing to use the hortizontal scroll bar to see the results in the Script Output window.

    "col" is a SQL*Plus command. SQL Developer does understand a few SQL*Plus commands, but most of the formatting commands like "column" are not supported.

  • SQL script works in SQL Developer but not when scheduled

    I have a script that I can run, logged onto my server as a user with full permissions and into my database as SYSDBA, that produces a CSV file on the server when I run it from SQL Developer ON the server. HOWEVER, when I set it up as a scheduled job, using those SAME CREDENTIALS (same Windows/network user; same database user), I get no output. The job indicates that it's running successfully, but no file gets created.
    Any advice is greatly appreciated.
    Here's the script:
    WHENEVER SQLERROR EXIT FAILURE;
         set serveroutput on
         DECLARE
         my_query varchar2(5000);
         BEGIN
         my_query := q'[
    SELECT client_id, JOB_NAME, SCHEDULE_TYPE, TO_CHAR(START_DATE,'MM/DD/YYYY HH24:MM') AS START_DATE,
    REPEAT_INTERVAL, ENABLED, STATE, RUN_COUNT,
    TO_CHAR(LAST_START_DATE,'MM/DD/YYYY HH24:MM') AS LAST_START, LAST_RUN_DURATION,
    TO_CHAR(NEXT_RUN_DATE,'MM/DD/YYYY HH24:MM') AS NEXT_RUN
    FROM DBA_SCHEDULER_JOBS
    WHERE instr(client_id,'10.') is not null
    ORDER BY LAST_START_DATE DESC
         p2k.ccsd_any_query_to_csv('HRISEDB_E_OUTPUT_MK', 'dbserver_job_output.csv',my_query);
         end;
    =================================================================
    Here's the called procedure (I don't really understand it -- I gleaned it from others on the internet):
    -- DDL for Procedure CCSD_ANY_QUERY_TO_CSV
    set define off;
    CREATE OR REPLACE PROCEDURE "CCSD_ANY_QUERY_TO_CSV" (p_dir in varchar2, p_filename in varchar2, p_query in varchar2) AUTHID CURRENT_USER
    is
    l_output utl_file.file_type;
    l_theCursor integer default dbms_sql.open_cursor;
    l_columnValue varchar2(4000);
    l_status integer;
    l_query long;
    l_colCnt number := 0;
    l_separator varchar2(1);
    l_col_desc dbms_sql.desc_tab;
    l_col_type varchar2(30);
    l_datevar varchar2(8);
    BEGIN
    l_query := 'SELECT SYSDATE FROM DUAL; ';
    dbms_sql.parse(l_theCursor, p_query, dbms_sql.native);
    dbms_sql.describe_columns(l_theCursor, l_colCnt, l_col_desc);
    l_output := utl_file.fopen( p_dir, p_filename, 'w' );
    dbms_sql.parse( l_theCursor, p_query, dbms_sql.native );
    for i in 1..l_col_desc.count LOOP
    utl_file.put( l_output, l_separator || '"' || l_col_desc(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;
    /

    hello,
    does oracle showing any errors in user_scheduler_job_run_details for this job ? I would advise try inserting some debug statement to identify where exactly its stuck. Also please check sample configurations syntax for user_scheduler_jobs.
    Cheers
    Sush

  • How to get server output in SQL Developer

    I am learning SQL Deverloper and am using it in a University environment as well as Oracle test instances at Oracle.
    I know my way around SQL some but I am just learning PL/SQL.  I want to run an anonymous block and see output for the "dbms_output.put_line" items.
    At school, I enter my block in the "SQL Worksheet" and receive the "anonymous block completed" in the "Script Output" screen.  Then there is a 3rd screen, the name of which I cannot remember, but I believe it is the equivalent of "server output".  When I open it I have to tell it which database I'm using.  Then, I see the dbms output lines in this 3rd section.
    The problem is when I am using SQL Developer at work, I see only 2 sections:  "SQL Worksheet" and "Script Output".
    I have looked but cannot find an option or a button or a window that is called something like "server output" or "view server output."
    Can a more experienced user please help me?
    I am using:
    SQL Developer Version 3.1.07
            Build MAIN-07.42
    Linux x86-64
    (Oracle Internal:
    Instance: http://celalnx38.us.oracle.com:10507/
    tnsnames: 10500)

    Hi Makel,
    There are no changes of which I am aware in the Dbms_Output view functionality between the 3.2 and 4.0 releases.
    As to your point about confusion, keep in mind the following:
    1. Each Worksheet tab and Dbms_Output tab include the name of the connection in use.  Match on that name when checking output results.
    2. Opening multiple Worksheets on the same connection name will share one database connection by default.
    3. Multiple Worksheets sharing a database connection also share one Dbms_Output tab.  That is by design.
    To force worksheets to use unshared connections:
    4. Change the default behavior of (2) via Tools -> Preferences -> Database -> Worksheet -> New Worksheet to use unshared connection.
    5. Or avoid (4's) overhead of always using unshared connections by opening one-off unshared Worksheets: Ctrl + Shift + N from a shared Worksheet.
    Finally:
    6. When using unshared Worksheets, one Dbms_Output tab may be opened per unshared Worksheet.  Note that the names of any unshared Worksheets will appear in Dbms_Output's Select Connection dialog drop down list. That should avoid any confusion.
    Hope this helps,
    Gary

  • DBMS Output - Oracle SQL Developer 3.0 Early Adopter 2 (3.0.02.83)

    The DBMS output is not working in 3.0.02.83. Whenever i turn on the DBMS Output for a DB connection nothing happens. I run the same script in older versions and it works. The script could be as simple as a small anonymous block with a print statement (dbms_output.put_line)

    Currently it's broken but you have a workaround
    30EA2 dbms_output.put_line not working
    Hope it helps,
    Dani

  • System events not captured when call from SQL Developer?

    Hi,
    This seems a bit weird to me. I'm not sure if there is something going on that I'm not seeing, or just not aware of.
    Oracle 9.2.0.5.0
    SQL Developer 2.1.1.64
    If I run the following in sqlplus, I correctly get a trace file generated
    alter system set events '1403 trace name errorstack level 14';
    begin
    raise no_data_found;
    end;
    OS Pid: 553 executed alter system set events '1403 trace name errorstack level 14'
    Fri Apr  9 14:11:01 2010
    Errors in file /filer3/admin/dev2/udump/dev2_ora_553.trc:
    ORA-01403: no data found
    ORA-06512: at line 2However, If I run it from SQL Developer.. No trace file is generated. All i get in the log file is the alter system message
    OS Pid: 6806 executed alter system set events '1403 trace name errorstack level 14'Any idea what could be going on here? I'm not sure if this is an Oracle problem, or an SQL Developer problem? Or I'm just misunderstanding how this should work?
    Thanks
    Matt.

    Sorry I forgot to mention, I'm selecting Run script ( F5 ) in SQL Developer.. The script output in SQL Developer is
    alter system set succeeded.
    Error starting at line 71 in command:
    begin
    raise no_data_found;
    end;
    Error report:
    ORA-01403: no data found
    ORA-06512: at line 2
    01403. 00000 -  "no data found"
    *Cause:   
    *Action:

  • SQL Worksheet - Script output is restricted to 5000 rows

    Hello,
    till now only 5000 rows are currently supported in a script results.
    I have read, this count will be a preference in future releases. Is there such a release and if "yes" how can I change this count of rows?
    Script Output of SQL Worksheet is the only possibility in SQL Developer I know, to export data from a query, that is a join of multiple tables, into flat file. Is there another one?
    Thanks,
    Tzonka

    You can run your query as a statement (F9) and the results will be displayed in the Results tab. In the Results tab, you can right-click, select Export and then Text. This will allow you to export the results of the query into a text file (or the clipboard). This will enclose values with " and separate with tabs (allowing alternatives is another "wait for a later release" function).
    This will produce the equivalent output of creating the view and exporting the data from the view tab as suggested by Sharon, without having to go to the effort of creating the view.
    If by "flat file" you mean exactly what you would get with a spool from SQL*Plus, then the Script tab is your only option and you are restricted to the 5000 rows.

  • How to import/export data in pl/sql developer

    how to import/export data,table script in pl/sql developer.
    By using the export functionality i am getting the dump file.I want a sql file.How do i do it?
    And i want the data in csv file and table script in a sep sql file.How do i do it?

    <li>run your query in "Query Builder"
    <li>Right-Click on the Query-Results
    <li>Click "Export"
    <li>Click on the "Drop-Down" in front of "Format" and choose "insert"
    <li>Provide the location and name of ther "sql" file.
    If you want output in CSV format, choose "csv" from the "format" drop-down.
    HTH

  • Spool command in SQL Developer 3.1

    Hi,
    I am using sqldeveloper-3.1.05.97 .
    There are few scripts that I need to run on a EBS sandbox to generate txt files for a analysis tool input .
    The script is meant to be run with SQL * Plus but I am getiing a TNS listener error due to which I want to use SQL Developer.
    The Spool command is able to create file in local directory but the oputput is not the query result but the query itself. Please help if anything is wrong in the syntax below:
    ALTER SESSION SET NLS_DATE_FORMAT = 'MM/DD/YYYY';
    SET NEWPAGE 0
    SET SPACE 0
    SET PAGESIZE 0
    SET ECHO OFF
    SET FEEDBACK OFF
    SET COLSEP |
    SET MARKUP HTML OFF
    SET LINESIZE 600
    SPOOL FND_USER.txt
    SELECT USER_ID, USER_NAME, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, START_DATE, END_DATE, DESCRIPTION, LAST_LOGON_DATE, PASSWORD_DATE, PASSWORD_ACCESSES_LEFT, PASSWORD_LIFESPAN_ACCESSES, PASSWORD_LIFESPAN_DAYS, EMPLOYEE_ID, CUSTOMER_ID, SUPPLIER_ID
    FROM APPS.FND_USER;
    SPOOL OFF

    Hi Partha,
    It seems the line "SET PAGESIZE 0" is suppressing all output in SQL Developer, and not just "all headings, page breaks, titles, the initial blank line, and other formatting information" as documented for SQL*Plus. Keep in mind that SQL Developer does not yet provide full support for all SQL*Plus formatting commands. For example, without SET PAGESIZE 0, the script output tab shows these messages:
    line 2: SQLPLUS Command Skipped: set NEWPAGE 0
    line 3: SQLPLUS Command Skipped: set SPACE 0
    line 8: SQLPLUS Command Skipped: set MARKUP HTML OFF
    I will log a bug for this.
    Regards,
    Gary
    SQL Developer Team

  • SQL Developer not accepting certain characters from the keyboard

    Hello,
    I have been using SQL Developer for 5 or 6 months now, with minor issues and great satisfaction.
    A few days ago, just out of the blue, in the middle of the day, SQL developer started not accepting the following characters:
    Ctrlv, Ctrl + c, F5, F9 (I Think all function keys), BackSpace, Delete, Enter and arrow keys.+*
    T*his is only happening in the text editor part*. I am able to use this keys in the results, whether they were a script output or an execute query output.
    SQL developer also functions properly (if i paste using the mouse, paste works.. and all the other keys)
    I checked the pc for viruses, using AVG, no viruses were found (my avg is updated daily and runs daily virus checks on a schedule, and this issue has been here for the past 1 or 2 weeks, so it was a virus, i think it should have been discoverd, besides, the keys are still working in sql developer, only not in the text editor part)
    Needless to say, but if i run notepad and type, keys work properly.
    I also reinstalled it in another folder with no luck
    Tried so many restarts .. no luck
    Tried it in safe mode .. no luck
    I am using SQL developer Version 1.5.4, Build MAIN-5940.. on Windows Xp
    I am suspecting there's some option in it that I disabled without paying attention..
    HELP!!!
    Regards,
    Charles

    All that time trying possible solutions is understandable, but then typing them in your post... when searching the forum would have given you the solution under 1 minute:
    Preferences - Accelerators - Load Preset - Default
    Hope that helps,
    K.

Maybe you are looking for

  • BI Publisher - output file window won't open

    My customer is having an issue with opening or saving report output generated by BI Publisher. Environment is Siebel CRM 8.1.1 running on RH Linux 4. Out of box reports work fine to the extent we can fin all the outputs under Administration - BIP Rep

  • How is liability relieved column calculated in Account Payables.

    Hello all, I am unable to find the exact definition of Liability relieved. How is it calculated in "Payables Posted Payment Register" report in Account payables module in oracle r12?. I know that its amount of the liability that is relieved after you

  • Shared Services Connection to SQL Server Failed

    Hi all Am trying to configure an SQL Server 2005 user directory in Hyperion Shared Services and have got to the screen where I need to type in all of the database details (i.e. Type, Name, Server, Port, etc) and a username/password but I keep getting

  • Flash Player group policy installation

    Hi All, Consider the following scenario: BigCorp deploys thier Flash player the Group Policy Software Installation (GPSI). BigCorp rolls out the latest version of Flash player to thier site.  Although BigCorp has followed all thier testing plans, and

  • Change style of ABAP web dynpro

    Hi, I have to change the style / color of an ABAP Web Dynpro application at one of our customers. So the standard blue background must be white and the dark blue heading backgrounds should be green for example. How can I do this? Is there a guide to