SQL * more: indicates if a column has been truncated?

So, I have a report where I am squeezing all the columns, I want to see in a 120-character wide display.

I put something like this:

Col some_column format a10

90% of the lines, this works very well, but there are a few that are too wide. So if the value is "snuffleupagus", it shows "snuffleupa", truncating to 10 letters (which are what I told it to do).

Is it possible to have rather print something like "snuffleup *" (or any other character), indicating that he has more output, but he had to truncate?

I am aware of word_wrap, which is exactly what I'm looking for.

If there is an Oracle function that could be achieved, that would be fine, too. I guess that if comes from getting worse, I could write a PL/SQL function to do this.

Brute force the way, perhaps?

WITH t AS
 (SELECT 'snuffleupagus' some_string FROM dual)
SELECT CASE
         WHEN length(some_string) > 9 THEN
          substr(some_string, 1, 9) || '*'
         ELSE
          some_string
       END actual_display_value
  FROM t;

Tags: Database

Similar Questions

  • Caused by: java.sql.SQLRecoverableException: IO error: NL Exception has been generated

    Hello gurus

    We face below question in oracle11g r2 11.2.0.3.0 platform

    11 April 2014 14:40:45, 078 [TRACE] SVR-SCH0 [TRAN-FACTORY] ST KEY: [11] com.elitecore.core.commons.util.db.DatabaseInitializationException: java.sql.SQLRecoverableException: IO error: NL Exception has been generated

    at com.elitecore.core.commons.util.db.datasource.OracleConnectionDataSource.init(OracleConnectionDataSource.java:103)

    at com.elitecore.core.commons.util.db.DBConnectionManager.init(DBConnectionManager.java:264)

    at com.elitecore.core.commons.util.db.DBConnectionManager.init(DBConnectionManager.java:203)

    at com.elitecore.core.commons.util.db.DBConnectionManager.reInit(DBConnectionManager.java:173)

    at com.elitecore.core.commons.utilx.db.TransactionFactory.scan(TransactionFactory.java:93)

    to com.elitecore.core.commons.utilx.db.TransactionFactory$ 2.execute(TransactionFactory.java:165)

    to com.elitecore.core.serverx.BaseEliteServer$ BaseServerContext$ 2.run(BaseEliteServer.java:378)

    to java.util.concurrent.Executors$ RunnableAdapter.call (Executors.java:441)

    to java.util.concurrent.FutureTask$ Sync.innerRun (FutureTask.java:303)

    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

    to java.util.concurrent.ScheduledThreadPoolExecutor$ ScheduledFutureTask.access$ 301 (ScheduledThreadPoolExecutor.java:98)

    to java.util.concurrent.ScheduledThreadPoolExecutor$ ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:207)

    to java.util.concurrent.ThreadPoolExecutor$ Worker.runTask (ThreadPoolExecutor.java:886)

    to java.util.concurrent.ThreadPoolExecutor$ Worker.run (ThreadPoolExecutor.java:908)

    at java.lang.Thread.run(Thread.java:619)

    Caused by: java.sql.SQLRecoverableException: IO error: NL Exception has been generated

    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:419)

    to oracle.jdbc.driver.PhysicalConnection. (PhysicalConnection.java:536)

    to oracle.jdbc.driver.T4CConnection. (T4CConnection.java:228)

    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)

    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)

    at java.sql.DriverManager.getConnection(DriverManager.java:582)

    at java.sql.DriverManager.getConnection(DriverManager.java:185)

    at com.elitecore.core.commons.util.db.datasource.OracleConnectionDataSource.init(OracleConnectionDataSource.java:98)

    ... 14 more

    Caused by: oracle.net.ns.NetException: NL Exception has been generated

    at oracle.net.resolver.AddrResolution.resolveAddrTree(AddrResolution.java:614)

    at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:411)

    at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:678)

    at oracle.net.ns.NSProtocol.connect(NSProtocol.java:238)

    at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1054)

    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:308)

    ... 21 more

    Please help us

    We use this Oracle RAC - URL JDBC

    JDBC: thin: @(DESCRIPTION = (ENABLE = BROKEN)

    (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(Host = x.x.x.1)

    (Port = 1521)) (ADDRESS = (PROTOCOL = TCP) (Host = x.x.x.2) (Port = 1521)))

    (FAILOVER = ON) (LOAD_BALANCE = on) (CONNECT_DATA = (SERVICE_NAME = orcl)

    (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC)))

    Share your suggestions

    Thank you

    hitgon

    As suggested by link below, we added (SERVER = DEDICATED) already in place the URL and it works

    http://www.DBA-Oracle.com/bk_nl_exception_connecting_10g_rac_jdbc.htm

    JDBC: thin: @(DESCRIPTION = (ENABLE = BROKEN)

    (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = dbnode1-vip)

    (Port = 1521)) ((ADDRESS = (PROTOCOL = TCP) (Host = dbnode2-vip)(Port = 1521)))

    (FAILOVER = ON) (LOAD_BALANCE = on) (CONNECT_DATA = (SERVICE_NAME = orcl)(SERVER = DEDICATED)

    (FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC)))

    anyone please share the same experience or suggestions.

  • Updated for PowerPoint 2007 will not install. It indicates that the installation has been cancelled.

    Updated for PowerPoint 2007 wants to install. I have PowerPoint 2003 is NOT 2007.
    Why is-2007 tries to install?
    Why I can't stop the message from popping up update?
    I have Windows XP SP3
    There is no error message accompanying the absence of installation.
    According to the list in the history of the update - it indicates that the installation has been cancelled.

    There may be an update for Powerpoint that has been downloaded so that you can see the Powerpoints from Office 2007. Try to run for Office 2007 here http://support.microsoft.com/kb/928218 removal tool

  • Hello. I bought Lightroom, paid license 1 year view, did not have serial. E number and then past the 30 day trial and may not use the product or work more hard. I paid has been deducted from my credit card. How I'm going to work now?

    Hello. I bought Lightroom, paid license 1 year view, did not have serial. And number and then past the 30 day trial and may not use the product or work more hard. I paid has been deducted from my credit card. How I'm going to work now?

    Hi Sergior96769872,

    I saw your Adobe ID (email address), you used to post on the forums, and I see an active subscription on it.

    Please see Help below links: { make sure you use the same Adobe ID (email address) that you used to purchase the subscription }

    Connect and disconnect activate Cloud Creative applications

    Adobe Creative Cloud apps back in test mode after 2015 set CC to update

    * NOTE: Make sure that your firewall of your computer or security software firewall does not block Adobe, if you are not sure of it can just disable the firewall for a while and then log off and log on creative application of cloud and check.

    If it still gives you an error of the trial, then please refer to the troubleshooting listed below:

    If you are using MAC:

    1-force Quit the sub process in the same sequence as shown below from Activity Monitor: see, use the monitor activity on your Mac - Apple Support

    • Creative cloud
    • Basic timing & sync to basic support
    • CC library & process CCX
    • Adobe Common Desktop
    • Adobe update daemon
    • Broker CIB Adobe
    • After that, everything that said adobe on it do a force quit for her

    2 - right click on the Finder icon, then select the "Go - To" folder. You will get a text box, type in the following command and then press the 'return '. ("Not to be missed ~ symbol")

    ~/Library (it will open the folder of the user's library.)

    3. browse to the Application Support > Adobe > trash OOBE folder and folder AAM Updater

    4 - CUT any installed security software with firewall system.

    5 - go to: Apple icon > system preferences > Security & Privacy > General > "allow applications downloaded on" change this anywhere (to make these changes click the padlock in the corner at the bottom left of this window and enter your computer password)

    These changes are temporary you can restore these changes back to normal once your creative cloud app is running *.

    6 - restart the cloud creative app and connect


    If you use the WINDOW:

    1 complete the process / Task Manager tasks in the same order, as mentioned below the Manager tasks. See, Open the Task Manager

    • Creative cloud
    • Basic timing & sync to basic support
    • CC library & process CCX
    • Adobe Common Desktop
    • Adobe update daemon
    • Broker CIB Adobe
    • After that, everything that said adobe on it do a force quit for her

    2 - C:\Users\\AppData\Local\Adobe\ MAA UPDATER and two OOBE (App data & Program Data is hidden folder please see, Show files and folders hidden in Windows 7, 8.x, 10, or Vista)

    3 - CUT any security software installed with firewall system, also if your having any browser Add On installed for blocking advertising that turn off too.

    These changes are temporary you can restore these changes back to normal once your creative cloud app is running *.

    4 - raise the cloud creative app and connect

    Let us know if that helps.

  • How to find how many times, how many numbers in a range of numbers (number of lines and columns) has been repeated (numbers 3.6.2)

    Hello

    I have a range of numbers from B2 - B11 until the G2 - G11. For example:

    31

    7

    28

    10

    4

    17

    20

    13

    44

    2

    1

    39

    32

    45

    39

    4

    10

    25

    26

    38

    27

    43

    12

    3

    42

    35

    37

    1

    34

    21

    13

    39

    11

    14

    5

    37

    21

    33

    34

    4

    13

    10

    31

    14

    1

    24

    35

    3

    20

    2

    24

    27

    22

    30

    10

    34

    36

    32

    3

    27

    I would like to know who among these numbers have occurred and how many times. For example (just to have as an example): number 10 repetitions 5 times, number 13 repeated 3 times, 24 repetitions 9 times.

    Repeats = duplicates.

    I want to know all the repetitive number and how many times they repeat.

    Is there some kind of formula I can use to get there. It would be good to have the sorted result. For example:

    32 repeats 10 times

    24 repeat 9 times

    6 reps 8 times

    5 repeat 7 times

    22. repeat 6 times

    10 repeats 5 times and so on.

    Hello

    Problem of three steps:

    1. Determine the distinct values
    2. Count the number of times each appears in the table
    3. Sort by value or frequency (or both).

    The first step is easily handled by copy separate Automator Service, a Service of Automator, written by SGIII. A link to the file in post June 21 of the SG in this thread: Re: Analyzing column (maybe not the correct wording)

    After downloading and installing the service, select the cells containing the numbers, call the service, and then select the first regular (ie. non-header) cell to a new table and the dough.

    (The following assumes the new table has a header row, no column header, and you have selected - click - cell A2 before pasting.)

    You will get a list of distinct numbers in a single column (A2 - A34, of your sample and support of note).

    To count the numbers:

    In this example, the existing table is named 'Table 1'

    Enter the following formula in B2 the new table, and then fill up to the last line of the column B:

    = COUNTIF (Table 1::B:G, A)

    Results should be as shown:

    Sort the results on column (value) or B (frequency)

    Two types (A, then B) will be put in order of frequency, with values appear the same number of times sorted by value within this group.

    Kind regards

    Barry

  • In my screen vertical bookmarks, since this morning, I don't see more most visited websites, which has been very helpful.

    There was a section near the top of all bookmark folders, who had the right, most visited sites, I think. This folder contained about 8 of my most common seats. Since this morning, I see more, which is really frustrating.

    See:

  • Looking for an example application where more than a similar unit has been tested at the same time

    I'm looking for an example application where more than one unit of the same kind are tested simultaneously on a grid of test with several stations. My first thought was to use loops Parallels, but because that test equipment is shared is probably not the best approach.

    Thank you.


  • CD is not visible in the window 'computer '. It indicates that the driver has been disabled by another driver

    restart resolves the problem, then it repeats very soon

    Hello
     
    1. when the question is is produced?
     
    Follow the steps below and check if that helps.
    Step 1:

    I would say you click on "fix it" link for automated troubleshooting and fixing the issue below. If the "fix it" does not work, follow the steps manually.

    http://support.Microsoft.com/kb/929461

    Step 2:

    You can remove and reinstall the existing drivers. To do this, follow these steps:
     
    a. Click Start and then click Control Panel.
    b. click System and security, click System and then click on Device Manager.
    Note that if control panel is in Classic view, double-click System and then click on Device Manager.
     
    If you are prompted for an administrator password or a confirmation, type the password, or click on allow.
     
    (c) in Device Manager, expand CD-ROM/DVD-ROM drives, right click on the device CD and DVD and then click on uninstall.
    d. When you are prompted to confirm that you want to remove the device, click OK.
    e. restart the computer.
     
    After the computer restarts, the drivers will be installed automatically.
     
    Aziz Nadeem - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • I tried to update firefox, then the update crashed. I can't open firefox more because the "firefox.exe" has been "changed or deleted". How can I fix it?

    I tried to update firefox to open a pdf file from a website that says at the top of the page that my plugins are up-to-date.

    Hello
    Run an antivirus program. It is very possible you just dive.

    If that didn't fix it, reinstall firefox.

    Hope that helps.

    Ian

  • Space not to be released after the table has been truncated.

    Hi all

    I've truncated at a table, but the space is not to be released after the truncation is done. Tried several option for relased back space that nothing works. Please can you help out me.

    SQL > select * from v version $;

    BANNER
    ----------------------------------------------------------------
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE 10.2.0.4.0 Production
    AMT for Solaris: release 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production

    SQL > /.
    Enter the value for the owner: CMSPRD
    Enter the value 1: WEB_LOG
    4 old: where the owner as ' & OWNER ' AND nom_segment = UPPER ('& 1')
    4 new: where the owner as 'CMSPRD' AND nom_segment = UPPER ('WEB_LOG')

    OWNER NOM_SEGMENT SIZE_IN_M
    ------------------------------ --------------------------------------------------------------------------------- ----------
    NOM_TABLESPACE SEGMENT_TYPE NOM_PARTITION
    ------------------------------ ------------------ ------------------------------
    CMSPRD WEB_LOG 601.515625
    OWDATA TABLE

    SQL > alter the movement line of table WEB_LOG enable;

    Modified table.

    SQL > truncate table WEB_LOG;

    Table truncated.


    SQL > analyze table WEB_LOG statistics calculation.

    Parsed table.

    SQL > ALTER TABLE WEB_LOG DEALLOCATE UNUSED;

    Modified table.

    SQL > ALTER TABLE WEB_LOG shrink space;
    ALTER TABLE WEB_LOG shrink space
    *
    ERROR on line 1:
    ORA-10635: Type of invalid segment or tablespace


    SQL > select count (*) in the WEB_LOG;

    COUNT (*)
    ----------
    0
    SQL > select sum (BLOCKS) from dba_tables where TABLE_NAME like 'WEB_LOG' and the OWNER as "CMSPRD."

    SUM (BLOCKS)
    -----------
    0

    SQL > select blocks 'Never used', empty_blocks 'Never used', 'Total of lines num_rows. "
    from user_tables where table_name = 'WEB_LOG '; 2

    Never used never used Total lines
    ---------- ---------- ----------
    0 76993 0

    SQL > select SUM (blocks)
    dba_extents 2
    3 nom_segment = "WEB_LOG";

    SUM (BLOCKS)
    -----------
    76994

    SQL > select MIN_EXTENTS from dba_tables where table_name like 'WEB_LOG ';

    MIN_EXTENTS
    -----------
    1

    SQL > @os
    Enter the value for the owner: CMSPRD
    Enter the value 1: WEB_LOG
    4 old: where the owner as ' & OWNER ' AND nom_segment = UPPER ('& 1')
    4 new: where the owner as 'CMSPRD' AND nom_segment = UPPER ('WEB_LOG')

    OWNER NOM_SEGMENT SIZE_IN_M
    ------------------------------ --------------------------------------------------------------------------------- ----------
    NOM_TABLESPACE SEGMENT_TYPE NOM_PARTITION
    ------------------------------ ------------------ ------------------------------
    CMSPRD WEB_LOG 601.515625
    OWDATA TABLE


    There is no change in the tablespace space remaining before or after truncation.

    What is the result of
    Select owner, segment_name, SUM (blocks), sum (extent_id) from dba_extents nom_segment = "WEB_LOG" group by owner, nom_segment;

    and

    Select num_rows, initial_extent, table_name, owner of dba_tables where table_name = 'WEB_LOG ';

  • Question about Aperture library after it has been migrated to Photos

    After an Aperture library has been upsized to Photos, its extension becomes ".migratedaplibrary".

    Anyone know what effect, if any, has this change of extension on use Aperture?

    As far as I can see that the library can continue to be used as before, even if the changes do not appear in the library of Photos of course.

    I have a feeling that she could prevent this library will have to be transferred to the Photos again, but I guess that I might want to migrate again if I wanted to trash the original photo library and start again, or if I had added a large number of photos at the opening since the initial migration.

    Thank you

    I have a feeling that she could prevent this library will have to be transferred to the Photos again, but I guess that I might want to migrate again if I wanted to trash the original photo library and start again, or if I had added a large number of photos at the opening since the initial migration.

    It's true. The extension indicates that the library has been upsized. There is no other difference.

    Photos will not migrate the library with this extension.  I just change the extension back to .aplibrary after you migrate an Aperture library.  Then Photos can migrate again, if need be, and I can use it in opening again.

    BTW, the migrated Aperture library and new photo library share storage, but not the files of images, photos are stored very efficiently by hard links. See: Photos saves disk space to share images with your iPhoto or Aperture - Apple Support libraries

    and Six colors: the (hard) link between iPhoto and photo

    Migration is almost without loss, but not perfect: How Photos handles content and metadata for iPhoto and Aperture - Apple Support

  • I ran microsoft security scan, and it says a voris has been partially deleted. How can I remove the rest or what should I do next

    I ran a scan of microsoft security and it indicates that a virus has been partially deleted. How can I remove the rest or what step I need to take the next

    Hi Lucie,.
    Try following the steps in this virus/malware removal guide: http://www.selectrealsecurity.com/malware-removal-guide
    It contains instructions which will remove most malware infections. If you have any questions, just ask me. I hope this helps you.
    Brian
  • Received the error that my operating system has been installed too many times and does not allow installation.

    installs Windows is no longer permitted

    Hi, my sons computer crashed several times due to hardware problems. It resulted in windows being installed several times. He just had a disk crash and after installing a new disk, windows indicate that the key has been used repeatedly, not allowing an installation again. How can I fix it?

    Use the Activate by phone and speak to a live operator.

    Activate by phone

    Click the Start button
    in the search box, type
    SLUI 4
    and press the Enter key
    Follow the instructions - but when asked which service you need the ansafone phone, don't answer - it should oblige the operator to answer, who can deal with you.

  • The module page should include the date at which each add-on has been more recently updated to help diagnose problems.

    Sorry, this isn't a question, but a suggestion. If a conflict exists between the modules, it would be useful to know that it has been updated recently. I often keep track of myself, but it would be easier to have this information on the page Add on.

    "Last update" is available from the display of the modules for each module by clicking on the "More" link... "just below the name of the add-on. Scroll down on this new view of the page.

    An add-on that lists information about all Extensions or Plugins, including the date of update (last updated date shows in the options for the Extension List Dumper as "Date of installation")

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

    Not related to your question, but...

    You may need to update some plug-ins. Check your plug-ins and update if necessary:

  • My hotmail account has been blocked. I tried to send a request to reopen the account. It is said that you will get a feedback within 24 hours. There are now more than 48 and I can't hear anything

    Original title: hotmail

    My hotmail account has been blocked. I tried to send a request to reopen the account. Itsays you will get feedback within 24 hours, there are now more than 48 and I hearnothing...
    What should I do?

    Hello

    This problem is specific to Hotmail, I you should post the question in the forums of Windows Live e-mail.
    http://windowslivehelp.com/forums.aspx?ProductID=15

Maybe you are looking for

  • Clean install El Capitan

    Mac Min (end 2012) with OS 10.11.4 After almost 4 years of loyal service, my Mac Mini has crashed. I have restored from Time Machine (Time Capsule). It took 3 days! It does not restore Mail and delete my account administrator a second restoration too

  • Wavesurfer 24XS TCP/IP

    I'm unable to and receive information from my Lecroy Wavesurfer oscilloscope 24XS. I'm trying to connect to a network.  I downloaded and installed both the driver of instruments of NOR and ACIP Lecroy passport.  I got the IP address of the range by v

  • HPC6180 function to scan lost all-in-one photosmart when changing the broadband providers

    After changing the broadband providers I could no longer use the functions to scan my printer on the network. Print still works perfectly, but when I tried to scan I got a message telling me that the scanner could not be found. It is a symptom that i

  • Obwohl keiner ist Papierstau

    Habe einen Canon Pixma MP 190 shows Papierstau Drucker an obwohl keiner is. Der Druckauftrag wird gesendet und ist ok. DAS Blatt paper zwar aber nicht weiter befordert eingezogen wird. Drucker der druckt dann, however without paper, nur auf die Druck

  • Windows Vista update error 80080005.

    I just bought a new laptop.  I ran windows update and after you download 34 updates, it installed 14 then asked me if I wanted to install IE 8.I clicked No. (or remind me later), and then I was forced to do a reboot.During the restart, he installed t