Remove the column space

Hi, just wanted to help regarding the deletion of my user name column spaces. I used the following code to remove the double space to a single space.
regexp_replace(table_a.username, ' {2,}', ' ')
but when you look through my answers I noticed that there is an extra in a few names at the end of the field as well. The original double space was between first name and family name, but now I have to replace the space completely, but don't know how.

If someone could please advise.

Thanks in advance.
with t as (
           select 'ABC         DEF   ' str from dual
          )
select  regexp_replace(str,' *( |$)','\1')
  from  t
/

REGEXP_
-------
ABC DEF

SQL> 

SY.
P.S. It does not remove the spaces to the left, just backwards.

SY.

Tags: Database

Similar Questions

  • How to remove the extra space of oracle database column

    How to remove the extra space of oracle database column. I would like to clean up the column in the database by deleting the extra space is entered by the dataentery people.

    When I run the query:
    SELECT
    ROWID, C.CODETABLE_ID, C.CODEVALUE_ID, C.DESCR, LENGTH (C.CODEVALUE_ID).
    C.OBSOLETE_DT, C.RECORDSOURCE, C.CREATED_DT,
    C.CREATEDBY, C.LASTUPDATED_DT, C.LASTUPDATEDBY
    OF CODEVALUE C
    Where LENGTH (C.CODEVALUE_ID) > 6

    the data type is varchar2 and I would get rid of the any extra blank space added to the column. in my case, if the length is greater than 6

    Hello

    user452051 wrote:
    Thanks for the reply. Why should I have this line?

    AND codevlaue_id! = TRIM (codevalue_id) - see note below
    ;

    I just changed my post when you posted this. The explanation is there now:

    Frank Kulash wrote:
    ...
    The condition "codevlaue_id!" = TRIM (codevalue_id)"does not change the results of everything, but it can make the most effective statement if there are lines where codevalue_id is on 6 characters long, but contains no additional space. It will prevent the triggers from firing and redo the data generated.

  • remove the odd spaces of the hexadecimal string

    Hello

    I would like to remove the odd spaces to a hexadecimal string, and the output result.  That's what the input string will look like:

    01 00 04 0F FF 36 3B CC...

    I want the output to be:

    0100 040F FF36 3BCC...

    I got the attached forum labview code earlier, but it does not work with the text.

    Any help is greately appreciated.

    Thank you

    hiNi.

    Try this version 8.2.

  • Remove the empty spaces and LF between lines in xml

    Is there a way to remove the empty spaces and LF between XML nodes?

    Let's say I

    CLOB l_clob;

    ..

    l_clob: ='

    < root >

    < name > ioerio < / name >

    < 10 > < / age >

    < / root >

    ';

    I need to get a XML in a single line without spaces and withoud LF...

    Example:

    SQL > ed
    A written file afiedt.buf

    1 declare
    2 l_clob clob.
    3. start
    4 l_clob: ='
    5
    6 ioerio
    7    10
    8

    9  ';
    10 l_clob:=replace(l_clob,chr(10)); -Remove line breaks
    11 l_clob: = regexp_replace (l_clob, ' > +)<','><>
    12 dbms_output.put_line (l_clob);
    13 * end;
    SQL > /.
    ioerio 10

    Must say, this is a strange requirement.  Most people ask how to do the reverse.

  • Remove the column from the compressed tables

    NLSRTL11.2.0.3.0Production
    Oracle Database 11g Enterprise Edition11.2.0.3.064 bit Production
    PL/SQL11.2.0.3.0Production
    AMT for Linux:11.2.0.3.0Production

    Hello

    I read on how to do to remove a compressed table column - first set unused and then drop unused columns. However, in the example below on the basis of data, I ran it, it does not work. Please, can you tell me WHEN this approach does not work. What is dependent on - settings or something else. Why can't I drop unused columns?

    And the example and errors:

    create table tcompressed compress in select * from all_users;

    > TCOMPRESSED table created.

    ALTER table tcompressed add x number;

    > table TCOMPRESSED altered.

    ALTER table tcompressed drop the x column;

    >

    Error report:

    SQL error: ORA-39726: unsupported operation column add/drag on compressed tables

    39726 00000 - "operation column add/drop not supported on compressed tables. ''

    * Cause: Not support add/column operation move compressed tables

    elapse.

    * Action: When adding a column, do not specify a default value.

    DELETE column is only supported in a column SET UNUSED

    (remove the column metadata).

    ALTER table tcompressed unused column of the set x;

    > table TCOMPRESSED altered.

    ALTER table tcompressed drop unused columns;

    >

    Error report:

    SQL error: ORA-39726: unsupported operation column add/drag on compressed tables

    39726 00000 - "operation column add/drop not supported on compressed tables. ''

    * Cause: Not support add/column operation move compressed tables

    elapse.

    * Action: When adding a column, do not specify a default value.

    DELETE column is only supported in a column SET UNUSED

    (remove the column metadata).

    As you can see even after changing the table defining the column as unused X I still can't drop by DROP UNUSED COLUMNS.

    Thank you.

    If you enable compression for all operations on a table, you can delete the columns in the table. If you enable compression for the only direct-path inserts, you can't remove columns.

  • Remove the extra space of a long document

    Hello

    I've seen a number of find/replace and GREP formulas to do similar things. I have NO scripting language or coding experience and have worked to understand GREP.

    So I'm a little afraid to use it because I don't know what all the modifiers call (I have a few neat GREP cheatsheets print as Mike Witherell I can absorb up to get a good reference)

    I need something I can copy and paste into find/replace or dialog GREP that will do the following in less than 12 steps (we hope) without doing something as catastrophic as the removal of all my paragraph marks (which I almost did with someones GREP expression)

    1. No space before a comma, period, exclamation point, question mark, colon, semicolon
    2. A space only after any of these
    3. A space before an opening parenthesis and a space after the closing parenthesis
    4. No space before the closing parenthesis or after the opening parenthesis
    5. Remove double or extra spaces (en, em, etc.)
    6. Remove comma before parentheses
    7. Remove all white space after a paragraph mark

    I think that's it

    I found this one recently (perhaps Jongware?)

    [~ m ~ > ~ f ~ | ~ S ~ s < ~/~,~3~4%] {2.

    From my limited understanding addresses em, in, flush and hair, space nonbreaking, space figure, third space - not sure of the rest. It's really way over my head.

    I know it will be a piece of cake for you guys

    Thank you

    I was hoping Jongware would come in with something really elegant (and maybe he'll still) but in the meantime, my approach would be to start by eliminating all multiple spaces except paragraph returns and forced line breaks. This appears to do:

    Find (\s)(\p{space_separator}|\t) + and replace it with $1

    This leaves the first space and will remove the following spaces to a line or a paragraph break (and not completely tested, but I guess that other kinds of breaks) is encountered, leaving the jump line or paragraph intact.  Note that this will destroy the tables built with tabs (as opposed to the 'real' tables) with several tabs between the items, and it does not alter a single space before a line or paragraph break.

    Then I would remove the whitesapce at the ends of paragraphs, etc.:

    Find (\s)(\n|\r) and repace with $2 seems to do, and it also seems to leave several returns (I don't know if you want to delete these) and work with the other breaks as well (again, not fully tested). The \s$ and replace it with nothing more simple, removes the first return to a sequence of two-back and seems to ignore e other types of breaks completely.

    At this stage avoid any several spaces other than possibly empty paragraphs. If you want to get rid of these, you can run find/replace list script by the integrated switchis refers to the single request of return in the dropdown, find/replace.

    So now you find the opening of single and double parentheses, square brackets or braces quotes and remove space after them, if it exists:

    Find ([\[\{\(~{~[])(\s) and replace it with $1

    and finally to remove any white space before your selected punctuation and the closure of the above case:

    Find (\s)([.,;:!\)\]\}~}~]]) and replace it with $2

    The last two queries will probably also work with look-bhind for the first and to come to the second (putting classes in the expressions of the eyes) and repalcing with nothing, but I don't know which method is the most effective. The last request might also be missing a space and an apostrophe or mistakenly remove a space before a work that begins with an apostophe (again, not tested). and is ignoring straigh citations of any type, because they are ambdextrous and may want to space on each side.

    I hope that the forum does not spoil one of these phrases...

  • How to remove the white space between two response reports

    How to remove the white space between two response reports

    In the section of dashboard, I have 2 rqeuest. Each query returns Table view. When I view the dashboard, it shows a blank separating 2 table views. How can I get rid of the band of white/white space?

    See this link

    Re: Remove the space between the two reports on the dashboard page OBIEE Section

    Kind regards
    Sandeep

  • Remove activate them, deactivate and remove the columns of searchUser.do

    Hello
    What form of jsp I have to modify to remove the option activate, deactivate and remove the columns on the searchUser.do page? I edited tjspSearchUserResultsTiles.jsp but who do not appear to do.
    Thank you

    To do this, you will need to customize JSP. It includes TableGenerator.jsp, so you will need to write your logic here to hide these buttons or you will need to write your own JSP and put it instead of tjspSearchUser.jsp

  • Statement of update to remove the 'white spaces '.

    Database: Oracle 11.2.0.1.0

    In the database, we have values in the columns that contain the 'white spaces' a few times before and/or after the value.  What is the best procedure to remove these extra white space?  I have given some examples below.

    Account number InvoiceNumber
    123INV-123
    456INV-456
    789

    INV-456

    123 456INV 123456

    1st row, 5 white space before the value of a.

    Line 2 has 5 white spaces after the value

    Rank 3, has 5 spaces before and after the value

    Tier 4, has 5 white spaces between the value < = it's alright

    Essentially, I don't want to cut the sides LEFT and RIGHT only.  Every thing in the meantime doesn't seem to be a problem at this time.  Is the query below the best procedure to manage withdrawal?

    Update table1

    the AccountNumber value = trim (AccountNumber);

    Hello

    976563 wrote:

    Database: Oracle 11.2.0.1.0

    In the database, we have values in the columns that contain the 'white spaces' a few times before and/or after the value.  What is the best procedure to remove these extra white space?  I have given some examples below.

    Account number InvoiceNumber
    123 INV-123
    456 INV-456
    789

    INV-456

    123 456 INV 123456

    1st row, 5 white space before the value of a.

    Line 2 has 5 white spaces after the value

    Rank 3, has 5 spaces before and after the value

    Tier 4, has 5 white spaces between the value<==== this="" one="" is="">

    Essentially, I don't want to cut the sides LEFT and RIGHT only.  Every thing in the meantime doesn't seem to be a problem at this time.  Is the query below the best procedure to manage withdrawal?

    Update table1

    the AccountNumber value = trim (AccountNumber);

    The SET clause is the best way, but you can add a WHERE clause.  Without a WHERE clause, you will update every row of the table, including rows that are already perfect, who will be ineffective.

    Try this:

    UPDATE table1

    SET AcountNumber = TRIM (account number)

    WHERE AccountNumber <> TRIM (account number);

    If AccountNUmebr is NULL, the conditon of WHERE clause evaluate to UNKNOWN, and if the line will be not updated unnecessarily.

  • remove the column in csv

    No one knows how to delete a column, or changing the values in this column and leave the rest in a csv file?

    Example:

    CSV file has 70 rows and 40 columns. To remove a column or change its values.

    Thanks in advance.

    Yes, I did a quick VI, which is a combination of the cross and methods Happies, takes the whole CSV in memory in the form of a table and it then passes out CSV again to another. If you want to make any changes to the CSV just deal with it even as you would a table when she goes from one CSV to another.

  • Photo Story 3-How do to remove the silent space between tracks

    I use Photo Story 3 to make a video.  I've imported all the photos and added 7 different pieces of music.  The program automatically leaves a silent space between pieces of music.  If an image has no music to accompany it.  How delete/erase this silent space for songs by each other.  Help with Photo Story 3 tells me how to add a silent space between pieces of music by selecting Silence in the list in the dialog box create a music Genre, but it don't tell me how to do the reverse.  Here, any help would be greatly appreciated.  I need step by step help, thanks.

    Thank you, I already look at this link to the frequently asked questions for photo story and has not found a solution.  I have done several video reports using photo story for windows in the past and never encountered this problem before.  There are no breaks between different songs that I added.

    =========================================
    Maybe you could use Movie Maker to edit music files...
    It has an option for file sharing.

    (FWIW... after having been edited each individual piece... you could also)
    Add all the music files to the timeline and save them as one
    single music file.)

    Import a music file in Movie Maker and drag it to the
    Audio / music. (Make sure that the file is moved all the)
    way to the left).

    Split the file and click right/remove the unwanted parts.

    When editing is finished... go... File / save movie file...
    and follow the instructions... the resulting file will be a. WMA
    Music file.

    If you are unable to import music files into Movie Maker you
    may have to convert them to the. WMA format to
    the compatible.

    There are to many converters available on the net...
    Some are free - some details... the following freeware
    is but one example. :

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Freemake - Free Audio Converter
    http://www.Freemake.com/free_audio_converter/
    (Windows XP / Vista / 7 / 8)
    (* Read * all * the installation screens... it)
    may be a few items you want to unmark *)

    When you have installed Freemake... Open Freemake
    and drag and drop your music files on the main screen.

    Or... Click left on the Audio button, then navigate to the
    your audio files are saved in the folder.

    Select (highlight) the files you want to import into
    Freemake and left, click on the button 'open '.

    When your music files are imported into Freemake,
    On the left, click on the WMA icon at the bottom of the screen.

    The "Output settings" screen opens.  Choose
    ' Save in ' file so you can find the converted files.

    On the left, click the "Convert" button and the files must be
    converted very quickly.

    That should do it...

  • How can we remove the present space in the string in BlackBerry?

    Hello

    Suppose I have string like "New York". How can I remove the space between and do like "New York". As BlackBerry does not support the Java replaceAll() method, I am not able to do.

    Thank you...

    StringUtilities.removeChars (...)

  • To remove the empty spaces without filling of browser?

    Hi all

    I'm trying to get rid of the empty space on the left and right, also some items appear suddenly in preview mode. Here are two screenshots that show you exactly what's wrong. Is it possible to get rid of the empty spaces, or is the only thing that removes whitespace a background fill? Also how can I make sure the items the same size as in the design mode, since in the preview suddenly the gray rectangle is longer than composition.

    -Roy

    screenshot_volcano1.pngscreenshot_volcano2.png

    You must use a browser fill. The monitor must have some sort of element to show or it would only show through and you would see the interiors of your monitors technology.

    If you have a site that is 960px wide and a monitor that is 1200 for example there must be something out there. That is why the filling of the browser. To choose a fill color or image file of the browser background that matches your site.

  • How to remove the empty space between the lines of the content of a PDF file?

    Attempt to modify a document by removing lines of unnecessary operations and while that in the edition of content/tools I can easily remove the content.  The problem is who is left a vacuum and the white space and does not move the content below the space upwards to maintain the format.  I'm trying to find a way to eliminate the gaps of whitespace on a page where the content used to be. See below...

    There is no easy way to do it, as PDF files should never be edited in a way. You will need to select the items below and drag them to the top.

    Of course, the best approach is to change the format of the original file and then generate a new PDF file, if possible.

  • How to remove the tab space only once?

    Hello

    Each paragraph on my layout, I have this unwanted tab-space.

    How do you remove tab space paragraphs (marked in red) in a press without affecting the other tab-space (marked in green)?


    I have an idea to use the search feature, but I don't know what is the code for the tab space.

    Screen Shot 2014-11-09 at 10.30.29 AM-01.jpg

    Try on GREP find what: ^ \t and change to: nothing (leave it blank). Try it and let us know if it works.

Maybe you are looking for

  • Photo editing software

    I have a new Nikon DSLR camera and you are looking for a decent photo editing for my Mac software program. I don't want anything real extreme that I am a beginner. Any suggestions would be greatly appreciated.

  • Firefox blocks no plug-ins

    Under all: permissions I put plug-ins for 'always ask' under 'all pages '. However if I set any page to "allow" all pages is set to allow. The simply looking at "all pages" will be solved I return to "always ask" for all pages. However, regardless of

  • HP Pavilion Notebook 14-n271tx: a vertical line in the middle of my screen

    Hey there, I would like to know more about the vertical line in the middle of the screen of my laptop. There will be a white vertical line in the middle of my screen sometimes but when I adjust the position of my laptop, it disappears. Can I know why

  • Will be upgrading to Windows 7 get rid of black screen at startup?

    original title: kSOD question/idea. I was kSOD'd on my Dell XPS in early May. Since then I spent looking for a solution. I do not have a cursor, recovery mode does not work, safe mode does not work, sticky keys does not work. The list of possible sol

  • My OS windows 7 freezes randomly.

    I can restart only by pressing the power button. It also does not save user names and passwords even if I permanently authorizes to invite when appears. I cleaned up in selective upward startup so that only windows programs run msconfig. I always str