sqlplus formatting / set

Hi all

I am creating a report with the help of SQL * Plus and shell.

I use a lot of a shell script sql script. In my report, output, k I still see the actual query:

SQL > select * from v version $;

BANNER

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

Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

PL/SQL Release 11.2.0.2.0 - Production

CORE Production 11.2.0.2.0

AMT for Linux: Version 11.2.0.2.0 - Production

NLSRTL Version 11.2.0.2.0 - Production

Is it possible to remove the query and get the result of the query in my report? What SET option would do that?

I would really appreciate any suspicion!

Thank you so much in advance!

M

Hello

Have you tried SET POSITION OFF and SET ECHO OFF?

Cat sql_test.sh:

sqlplus-s $login<>

Set serveroutput on

trigger the echo

set the position

Select 'Testing' to double;

output

++

Tags: Database

Similar Questions

  • Date format setting

    Hi all

    I am trying to format the setting date a report in my RTF and I failed with each attempt. I hope someone has a solution that is easily available.

    The name of the parameter is param_start_date. I tried them all as the value of the output parameter: 2011-01-18 00:00:00.0 I need the date to display as MON-DD-YYYY (April 18, 2011 or April 18, 2011).

    Here is what I tried:
    & lt;? param_start_date? & gt;
    & lt;? xdofx:TO_DATE(param_start_date,_'YYYY/mm/dd_HH24:MI:SS.) FF1')? & gt;
    & lt;? xdofx:TO_DATE(param_start_date,_'DD-Mon-YYYY')? & gt;
    & lt;? xdofx:TO_CHAR(param_start_date,_'DD-Mon-YYYY')? & gt;
    & lt;? xdofx:TO_CHAR (xdofx:to_date(param_start_date,_'YYYY/MM/DD_HH24:MI:SS.) FF1'), 'MON-DD-YYYY')? & gt;
    & lt;? xdoxslt:ora_format_date(param_start_date,'DD-Mon-YYYY')? & gt;

    I can't change the source query, so it must be done in the RTF model.

    Any suggestions are welcome.
    use
    
    
  • Output of sqlplus formatting

    Oracle 11.1.0.7:

    I followed SQL. But when I run it it gives me all the SQL statements and other things. How can I get just the result of select?
    sqlplus stream_mon/stream_mon << EOF!
     set head off
     set pagesize 0
     set feed off
     set echo off
     spool ${MON_FILE} append
    
     SELECT APPLY_NAME || '|NoOfErrors=' || COUNT(*) FROM DBA_APPLY_ERROR group by APPLY_NAME;
    
     select APPLY_NAME || '|Latency=' ||
         (apply_time-applied_message_create_time)*86400
      from dba_apply_progress;
    
     select QUEUE_NAME || '|SrcSpillMsgs=' || spill_msgs || chr(10) || 'SrcInMemoryMsgs=' ||  (NUM_MSGS - SPILL_MSGS)
    from V\$BUFFERED_QUEUES;
    
    SELECT APPLY_NAME || '|DestSpilledTransactions=' || MESSAGE_COUNT
      FROM DBA_APPLY_SPILL_TXN;
    
    select APPLY_NAME || '|DestTotalMessagesSpilled=' || TOTAL_MESSAGES_SPILLED from V\$STREAMS_APPLY_READER;
    
    select case when status = 'ENABLED' then CAPTURE_NAME || '|CaptureProcess=1'
               else CAPTURE_NAME || '|CaptureProcess=0'
               end
          from dba_capture;
    
    select case when status = 'ENABLED' then PROPAGATION_NAME || '|PropProcess=1'
               else PROPAGATION_NAME || '|PropProcess=0'
               end
          from dba_propagation;
    
    select case when status = 'ENABLED' then APPLY_NAME || '|AppProcess=1'
               else APPLY_NAME || '|AppProcess=0'
               end
          from dba_apply;
    
     select CAPTURE_NAME || '|CaptureErrMsg=' || replace(error_message, ' ', '_') from dba_capture;
     select PROPAGATION_NAME || '|PropErrMsg='    || replace(error_message, ' ', '_') from dba_propagation;
     select APPLY_NAME || '|ApplyErrorMsg=' || replace(error_message, ' ', '_') from dba_apply;
    
     spool off
    
    EOF!
    Out something like this
    SQL>  select QUEUE_NAME || '|SrcSpillMsgs=' || spill_msgs || chr(10) || 'SrcInMemoryMsgs=' ||  (NUM_MSGS - SPILL_MSGS)
      2  from V$BUFFERED_QUEUES;
    CAP_QUEUE|SrcSpillMsgs=0 

    sqlplus stream_mon/stream_mon<>

    not above but below
    sqlplus-s stream_mon/stream_mon<>

  • How to keep the format setting when generating a table of contents

    Hello

    I have a superscript® in a title in a document that should be put in the Table of contents. When I generate the table of contents, I can't keep the format in the table of contents.

    I could cheat and manually change the, but there must be a way that remains with these properties whenever I have to regenerate the table of contents.

    No idea how?

    Kind regards.

    What version of FM?

    What the police?

    There are two separate issues here:

    1. If you are super as a character Format in the files of body, the format must be in character for the OCD catalogue, or the formatting is not applied.
    2. If you do this and get it display correctly in the table of contents, which will break the hyperlink linking it.

    The solution is usually to do great as characters of Unicode natively by exposing and not the character Formats.

    See: TOC link with a character index does not in PDF format

  • SQLPLUS formatting

    I have the following SQL code

    Select file_name, bytes/1024/1024 * 80 of dba_data_files

    I want the output for each line look like this (remove the line breaks, tabs...)  Y at - it an easy way to do it. I know you can use single quotes

    around the literals

    ALTER database datafile '+ DATA01/da01fmd_imkl065d/datafile/dw_daily_acct_sum.8.820408375' resize 24576 M Note size must be an integer

    Thanks to all those who responded


    Thank you all. Frank your example was a syntax error, so I used the following which works perfectly for me.

    Select 'alter database datafile ' | ''''|| file_name | '''' || "resize".

    || TO_CHAR (trunc (bytes/1024/1024 * 0.8)) | ' m;'    from dba_data_files

  • Format setting flash8 avi video

    Hi Im using flash 8 to convert an avi amination to post on YouTube. Can someone give me the correct settings to use when the options before the publish. Also, I need to find these settings for clarity and the large file as I'd like keep compressed.

    Advice would be appreciated.

    Thank you.

    Do not use Flash to compress unless you don't have any other compression software. Export to an uncompressed AVI file and then compress him with other software. Flash8 is too old to have Adobe Media Encoder so it is not really ideal for compression.

    If you have no software to make a compressed MP4 (there are free stuff out there) I find that YouTube does a good job with WMVs. You can still download the old version WMV9 , which is a little weird (the user interface), but very exceptional WMVS or enter the most recent Microsoft Expression Encoder 4 (free version is done pro H264, WMV). Even after the expression encoder is out, I continued to use the old version because it worked better, even if the user interface is weird.

    If it's essentially a one time thing I wouldn't mind compress for you if you give me the source or an uncompressed AVI file (zipped up hosted somewhere online). Let me know if you want to do and I'll send you a PM.

  • Set linesize does not work in sqlplus

    I am trying to use sqlplus to empty a few DOF for a stored procedure. I found a problem with my script where it isn't properly unload the lines in a file, and this seems to be caused by problems with the 'set linesize' command in sqlplus. Lines are getting truncated to 80 characters, no matter what I set the linesize variable to (currently I changed it to 500 as test - but it still doesn't work)!

    For example, I have a line in the procedure as follows:



    CREATE OR REPLACE PROCEDURE
    ...
    INSERT INTO SOME_TABLE_NAME_HERE (OWNER, ACTIVITY, ACTIVITY_COST, NUM_WORKERS, NULL)
    SELECT...


    I can see that the 80th character is the "NULL" and "ULL" is beyond the limit in SQL Developer. When I empty the DDL in sqlplus, it appears like this, no matter what I set linesize to:



    CREATE OR REPLACE PROCEDURE
    ...
    INSERT INTO SOME_TABLE_NAME_HERE (OWNER, ACTIVITY, ACTIVITY_COST, NUM_WORKERS, N
    ULL)
    SELECT...



    Here are the options I use in their entirety. This is an excerpt from a shell script that I'm trying, but you can see the options that echoes in the file that is ultimately read / performed by sqlplus:

    echo "set position off;" > > proc.sql
    echo "set echo off;" > > proc.sql
    echo "value 999 pages;" > > proc.sql
    echo "set off termout;" > > proc.sql
    echo 'long set 90000'; > > proc.sql
    echo ' set linesize 200; "> > proc.sql
    echo "${schema} .txt reel" > > proc.sql
    echo "select dbms_metadata.get_ddl ('PROCEDURE'," ${proc} ") from dual;" > > proc.sql


    No matter what I set linesize she always truncates to the 80th character and begins printing on the next line. Change the linesize option seems only right key to exit with spaces. So if the line is longer than 80 characters and I set linesize to 90, it truncates the 80th character, impression 10 places and then print 'LLD') and 86 seats on the next line. If I change to 100 then I get 20 seats on the first line, followed by "ULL") and 96 places on the next line. And so on...


    I tried to use trimspool ON but it does not help the issue. Set linesize seems to be useless - everything is truncated to 80 characters. What I'm doing wrong here? Thank you!

    Hi and welcome to the forum,

    Looks like you need the LONGCHUNKSIZE of the VALUE

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14357/ch12040.htm#SQPUG089

    Concerning
    Peter

  • sqlplus formattin question

    Hello

    my version of the database is:
    BANNER                                                                          
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production          
    PL/SQL Release 11.2.0.1.0 - Production                                          
    CORE     11.2.0.1.0     Production                                                      
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production                         
    NLSRTL Version 11.2.0.1.0 - Production                                          
    I am running the following instructions in sqlplus:
    set serveroutput on size unlimited
    set linesize 100
    col lvl format 9999
    col txt format a80
    set pagesize 9999
    
     select level lvl
          , rpad ('*', level * 20, 'The quick brown fox jumps over the lazy dog') txt
       from dual
    connect by level <= 10;
    The keyword col instruct sqlplus to maintain txt to 80 column width. It is originally word of packaging when the column is greater than 80:
    Output:
    
      LVL TXT
    ----- --------------------------------------------------------------------------------
        1 *The quick brown fox
        2 *The quick brown fox jumps over the lazy
        3 *The quick brown fox jumps over the lazy dogThe quick brown
        4 *The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the l
        5 *The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the l
          azy dogThe quick bro
    
        6 *The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the l
          azy dogThe quick brown fox jumps over th
    
        7 *The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the l
          azy dogThe quick brown fox jumps over the lazy dogThe quick
    
        8 *The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the l
          azy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over
    
        9 *The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the l
          azy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over
           the lazy dogThe qui
    
       10 *The quick brown fox jumps over the lazy dogThe quick brown fox jumps over the l
          azy dogThe quick brown fox jumps over the lazy dogThe quick brown fox jumps over
           the lazy dogThe quick brown fox jumps o
    Any time the column is greater than 80 characters, after packaging is also add an empty line (from id 5).

    This is not a big problem, but is it possible to avoid this blank line?

    Kind regards.
    Al

    Hi, Al,

    SET     RECSEP  OFF
    

    eliminates the extra lines.

    The UN - do this command is to, unintuitively:

    SET     RECSEP  WRAPPED
    
  • How to show number of given length hexdecimal format

    Hi all

    I want to show a 32-bit number in hexdecimal format. In the number control, right-click menu and I click on the "Display Format", I can change the format to the spell. But I wonder if there is a way to show the hexagon with the number considering the number of licensee. In C language, I can trace the number as

    printf ("%.10x", number)

    so, to keep the result for total 10 places. I find an "advanced editing mode" in "Display Format" but I do not have the work of "%.10x". Any idea?

    Many on the left are integers, so there should be no delay in the format. You don't need the advanced format.

    Simply set the hexadecimal format, set a minimum field width and pad with zeros on the left.

  • When selecting several fields of the same type why tab formatting does not appear in the properties?

    Creating pdf with lines Qty and total order forms, I want to format the fields as number with 0 decimal places for the qty column and the sign $ and 2 decimals for the totals column.

    Why when choosing several fields quantity, then go to properties, the format tab disappear? Why do I have to choose and the format of each field one at a time? They have the same type of field.

    I'm working currently on a document with more than 200 fields are most of the quantity fields and others are total fields. I right click on each field individually.

    It's 2015! Can you imagine if Excel did it?... Adobe WTF?

    Only the Adobe developers can answer why it is like that, but it's unfortunately.

    The only solution is to use a script to set the Format setting for several fields at the same time.

    I developed such a tool, so if you are interested you can get it here: Scripts custom Adobe: Acrobat - Format applies to several text fields

  • CC wants to save to the default TIFF format. How can I register as a default PSD?

    I know that the PSD are the default file format, and I read CS6 is sticky and will save a file in the latest file format that has been saved.

    Here is my scenario:

    1 to 5 of Lightroom, I right-click on one of my RAW (NEF) files and select Edit in CC.

    2 CC opens and I do some changes.

    3 try to save the file.

    a. If I just "Save" the file, it saves to the TIFF format.

    b. If I use "Save as...". "the dialogue is set by default to a TIFF file

    I tried to open a file of LR in CC, by registering as a PSD, then closing CC in the hope that it would be sticky, nope.

    How can I force CC always default to save PSD files unless I tell him otherwise?

    It helped me to get to the resolution.

    I opened CC and opened a NAVE across the bridge. File... Save as... high by default save the PSD. So I took a peek in LR.

    In LR, I went to "Edit"... Preferences"on the external publishing tab, I got"File Format"set to TIFF.  Why, when and how I made this change I don't remember. Especially the "why" part.

    Change to PSD solved this problem.

    Thank you for your help.

    Ed

  • SQLPLUS helps with a Linux Script

    I get an error SQLPLUS to 155.

    Apparently my SQL code is truncated (I think).

    Initially, I had all this code on separate lines to make it readable. Unfortunately for this test, I also received a return code of 155.

    I copied the SQL of my SQL DEVELOPER where this SQL works correctly.

    Can anyone make suggestions?

    BTW, I am newbie to Linux Shell, SQL and SQLPLUS Scripts.

    Here is the log of the execution of the script:


    SQL * more: Production release 11.2.0.2.0 on Friday, may 4, 17:49:38-2012

    Copyright (c) 1982, 2010, Oracle. All rights reserved.

    SQL > SQL > connect.
    SQL > SQL > SQL > SELECT to_char (c.update_date, 'FMMonth, YYYY') 'Date of update of shipping' |' | ' || b.SHIPMENT_GID 'Expedition number' |' | ' || Count (distinct (b.SHIPMENT_GID)) 'of the expeditions' |' | ' || Count (distinct (a.i_transaction_no)) 'Auction by expedition' |' | ' || Count (*) 'notified carriers no' |' | ' || sum (where the a.responding_gl_user_gid is null then 0 otherwise 1 end) 'No bidders' |' | ' || min (numtodsinterval ((b.expected_response-b.insert_date),'day "")) 'Time of auction' |'| ' | min (numtodsinterval ((a.update_date-a.transaction_time),'day "")) 'Elapse time for first auction' |'| ' | Max (numtodsinterval ((a.update_date-a.transaction_time),'day "")) 'Elapse time for the last bid' |'| ' | NUMTODSINTERVAL ((Max (a.update_date) - min (a.update_date)), 'day') 'Elapse time of auction' |' | ' || NUMTODSINTERVAL ((Max (b.shipment_time) - max (c.insert_date)), 'day') 'Driving time to bid to P/U' |' | ' || (max (a.bid_amount) - min (a.bid_amount)) "High bid - low-bid Diff" of tender_collab_servprov a, tender_collaboration b, c of the expedition where a.i_transaction_no = b.i_transaction_no and b.shipment_gid not in (select sqa.shipment_gid from the sqa, CBRS tender_collab_servprov tender_collaboration where sqa.i_transaction_no = sqb.i_transaction_no and sqb.acceptance_code = 'A') and a.i_transaction_no in (select i_transaction_no from the tender_collaboration where tender_type = 'Offered Spot') and b.shipment_gid = c.shipment_gid AND c.update_date > = trunc (last_ day (to_date ((to_char (ADD_MONTHS (sysdate-2), 'DD-MM-YYYY')), "MM-DD-YYYY")) + 1) Group c.update_date, b.SHIPMENT_GID order of c.update_date, b.shipment_GID
    *
    ERROR on line 1:
    ORA-00923: THE KEYWORD not found where expected


    Disconnected from the database to Oracle 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production
    With partitioning, OLAP, Data Mining and Real Application Testing options


    Here is the Linux Shell script:

    / bin/sh
    LOGFILE = "$(date +" %A-%m-%j %H ") REPORT Oracle LOG. TXT ".
    FILENAME = "$(date +" %Y-m %-%d ")" PROD unfinished Spot Bids.CSV ""
    echo "filename for the coil is: ' '$FILENAME '.
    #spool "$FILENAME".
    sqlplus/nolog < < EOF > $LOGFILE
    whenever sqlerror exit sql.sqlcode
    connect glog_read/parker@OTMDEV
    coil PROD_Unfinished.CSV
    Set linesize 32000 trimspool on pagesize 3000
    SELECT to_char (c.update_date, 'FMMonth, YYYY') 'Date of update of shipping' |' | ' || b.SHIPMENT_GID 'Expedition number' |' | ' || Count (distinct (b.SHIPMENT_GID)) 'of the expeditions' |' | ' || Count (distinct (a.i_transaction_no)) 'Auction by expedition' |' | ' || Count (*) 'notified carriers no' |' | ' || sum (where the a.responding_gl_user_gid is null then 0 otherwise 1 end) 'No bidders' |' | ' || min (numtodsinterval ((b.expected_response-b.insert_date),'day "")) 'Time of auction' |'| ' | min (numtodsinterval ((a.update_date-a.transaction_time),'day "")) 'Elapse time for first auction' |'| ' | Max (numtodsinterval ((a.update_date-a.transaction_time),'day "")) 'Elapse time for the last bid' |'| ' | NUMTODSINTERVAL ((Max (a.update_date) - min (a.update_date)), 'day') 'Elapse time of auction' |' | ' || NUMTODSINTERVAL ((Max (b.shipment_time) - max (c.insert_date)), 'day') 'Driving time to bid to P/U' |' | ' || (max (a.bid_amount) - min (a.bid_amount)) "High bid - low-bid Diff" of tender_collab_servprov a, tender_collaboration b, c of the expedition where a.i_transaction_no = b.i_transaction_no and b.shipment_gid not in (select sqa.shipment_gid from the sqa, CBRS tender_collab_servprov tender_collaboration where sqa.i_transaction_no = sqb.i_transaction_no and sqb.acceptance_code = 'A') and a.i_transaction_no in (select i_transaction_no from the tender_collaboration where tender_type = 'Offered Spot') and b.shipment_gid = c.shipment_gid AND c.update_date > = trunc (last_ day (to_date ((to_char (ADD_MONTHS (sysdate-2), 'DD-MM-YYYY')), "MM-DD-YYYY")) + 1) Group c.update_date, b.SHIPMENT_GID order of c.update_date, b.shipment_GID;
    spool off
    EXPRESSIONS OF FOLKLORE
    RV = $?
    ECHO "fronm the sqlplus return code was: ' «$RV»»»

    HM wrote:


    @Billy: empty lines are possible in a query in sqlplus:

    set sqlblanklines on
    

    It is not enabled by default. I've never seen any SQL * more script start. :-)

  • Video format without constraint.

    I am currently working on a video of 3500 x 1000, but I can't make the full 3500 x 1000 pixel, as most of the output format have been forced into a maximum of 1920 x 1080

    can anyone help me please with a parameter that allows you to compress the video in good quality but compressed video size? I tried Quicktime compression but for 10 seconds, the video was like 600 MB +.

    I use the video for a LED wall using a Windows operating system (Dataton Watchout) as a player, I tried to divide the video into two 1750 x 1000 but there was delay between 2 videos when they are projected on the LED wall and large video format will simply slow down the system. My final solution was to create a 1920 x 1080 video and double to 3500 pixels but I'm avoiding to do this.

    Thanks in advance

    p.s. I saw that someone has actually created a quicktime 3840 x 1080 video, then using a mac system to convert .mpeg video with 3840 x 1080. But I don't know how it was done.

    Go to a lossless format like Quicktime Animation (100% quality) of After Effects.  Then compress using a different compression tool: Apple Compressor, Quicktime Pro, Adobe Media Encoder, episode Pro etc.

    What is the driving - Watchout system shows how?  In what format/setting?  It is usually best to provide video Watchout into segments for each output device, rather than a huge file on all devices.  The delay you encountered between files was probably the result of the player low speed I/O.

    If, for example, the view is created by using two parallel projectors in 1920 x 1080, you're much better off building your model at full resolution, and then rendered two segments to the native resolution of the two projectors, account duplication etc.

  • Change throughout a book format

    How can you change a style of paragraph or charater in a book?

    For example, if I have a paragraph style that is green, Times New Roman and I decide to blue Courier instead, how can I change it in all 30 chapters at once without manually changing all 30 chapters of the book?

    How can you change a style of paragraph or charater in a book?

    It's simple if and only if, the FMP FMT is supposed to be the same in all the components of the work.

    In the menu .book:

    1. Open an instance of definining one of a body.fm file. Target files must not be opened.
    2. Revise contents fissile TFP. Leave the file open.
    3. From the book menu, CTRL-select all other component book files (or at least the ones you want to update).
    4. File > import > Formats
      Import of Document: [definingBody.fm]
      [Clear all]
      [*] Paragraph formats
      [?] Format/set other substitutions in page
      [Import]

    There are a lot of things at the level of the book you can do this in the menu of the book.

  • How to save in report formatting (model) response?

    Hello
    wish I could save the formatting set to respond to a report defining a template and import this format in other reports.
    You can set the formatting of rows, columns, steps, line totals, the total columns total, without having to do it on individual objects?

    Response I have seen in the report format can be imported into another report, but how do I save? I put the formatting for each object?

    Can you help me?

    Thank you

    Thank you

    Published by: user10708407 on 3-Dec-2009 8.47

Maybe you are looking for