Question on aligning char to the right side.

Hi there,
I got stuck on displaying numbers in varchar2.
As I saw the result of a select cmd, if the data type is char,
the result will be displayed as aligned left. If the data type is number,
the result is aligned right.
Say
create table tmp1(
id number,
name varchar2(10)
insert tmp1 values(1,'1');
insert tmp1 values(2,'2');
insert tmp1 values(3,'John');
select id,name from tmp1;
id name
1 1
2 2
3 John
How can I align the name column right?
In other words, how to make char column right aligned?
This is the result what I want.(To line them up, I used underline in Name column.)
id name
1 ____1
2 ____2
3 John
Thanks.
Phil

Use LPAD(col1,10,' ')
SQL> with data as ( select 1 id, '1' name from dual
  2  union all      select 2,    '2'      from dual
  3  union all      select 3,    'John'   from dual
  4  ) -- data
  5  select id, lpad(name,10,' ') name
  6  from data ;
        ID NAME
         1          1
         2          2
         3       JohnSS

Similar Messages

  • How can I align a character exactly flush with the right side of a text box?

    I'd like to automatically align some text so it touches the right side of its text box exactly for all characters ("Optical Margin Alignment" doesn't work). Figure-1 shows the default behavior for right-aligned text. Figure-2 shows what I want it to look like. Since these characters are inputs from a large Data Merge, manually adjusting each instance is not a practical solution.
    Selecting the "Align Left Edge" checkbox in "Drop Caps and Nested Styles" is exactly the kind of behavior I'm looking for, except it needs to be the "Right Edge" not the "Left Edge".
         Figure-1: This is the default behavior for right-aligned text.
         Figure-2: The is what I want the result to look like.

    Rob, thanks for the link with the thread. At least I know I'm not missing some obvious function somewhere.
    Olfar, I follow what you did with "Indent to Here" and the Hair Space, and I understand how to use tracking to manually align the second line, but I don't know much about grep styles, so I didn't follow that part. Does the technique you used work for all characters? For instance, if you replaced the "1" with a "7", would it automatically align the rightmost part of the "7" with the "N"? Also, I need something that works with double digit numbers, and I don't think the Hair-Space-and-Tracking trick is going to work in those cases, but I could be wrong.
    Thanks.

  • What's up with the mountain lion toolbar question mark on the right side?

    There was a picture connected to the right side of my toolbar. I deleted it and now a question mark sits in its place. How do I access this and correct it?

    The question mark is an orphaned alias. Cmd-drag it off and poof it!

  • Align af:output to the right side in facet top

    Hi Guys,
    I m trying to align af:output to the right side in facet top but its not working.how can i do that.
    <f:facet name="top">
    <af:panelGroupLayout layout="horizontal"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    id="pgl1" styleClass="AFStretchWidth">
    <af:panelHeader text="JCB Workbench" id="ph1"/>
    <af:outputText value="#{bindings.Name.inputValue}" id="ot1"/>
    </af:panelGroupLayout>
    </f:facet>
    Thanks,
    Raul

    Hi,
    set
    <af:panelGroupLayout layout="vertical" halign="right"  >
    <af:panelHeader text="JCB Workbench" id="ph1"/>
    <af:outputText value="#{bindings.Name.inputValue}" id="ot1"/>
    </af:panelGroupLayout>

  • Acrobat Reader DC on PC: How to deactivate the sidebar/element on the right side forever? (Question/Feedback)

    How can I deactivate the sidebar/element on the right side (export, create, edit PDF, more information, comment...) forever? It keeps coming back when I restart Acrobat Reader DC.
    If this is not a feature, I strongly suggest to implement that Acrobat Reader saves the last state whether it is shown or not (aka activated or deactivated).

    Hi Marcus,
    I can understand your concern, however its a part of core user interface in Adobe Acrobat Reader DC & Adobe Acrobat DC. So its not possible to disable it permanently.
    Some of our customers have raised the same issue & like them you too can fill a feature request for at Adobe - Feature Request/Bug Report Form
    Regards,
    Aadesh

  • How can I show my bookmarks on the right side of the page always

    I would like to see my entire bookmark list on the right side of any page I am viewing - in other words, I want the list turned on all the time.

    CTRL+B will open or close the Bookmarks sidebar. If the sidebar is open when you exit/close Firefox, the sidebar should be open when your re-start Firefox.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Next Generation Java Plug-in for Mozilla browsers: [https://support.mozilla.com/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • My iphone 4s screen turned freaked out before my eyes, changing all different colours, now it is blue and black along the right side with horizontal lines, and is flickering. I DIDN'T DROP IT.

    I was just sitting on the couch scrolling through facebook, I closed out of that and went to open safari, when it spazzed out, for a few mintutes it looked like LSD vision, it was all different colours and flickering the whole time. I turned it off and on again, and plugged it into my computer and now the right side is nearly completely blue, and bleeds to the left side with horizontal lines, and it is still flickering. I just finished paying the **** thing off. I thought I'd get another year out of it. I have taken exemplary care of it and it hasn't left the case since the day I bought it. I haven't dropped it, there was no warning for the screen to start doing this. So my question is, is there an easy fix (I am about to restore and update it, and I already played around with the screen brightness), and if not, am I going to have to pay for the screen to be replaced, because I don't have that kind money.

    Probably sounded funnier in your head.

  • Add a Web Part on the right side to an existing SP site (instead of top)

    Hi,
    I have read the existing threads and still have questions.
    I need to add a Web Part (I think) to an existing SP site - with the Web Part on the RIGHT side of the site - so:
    Libraries, Lists, Discussions, etc. on the left (existing) -- List of files in the middle (existing) -- Link(s) on the right (to be created)
    My goal is to create a link in this Web Part to another SP site under the same project.
    I can currently add a Web Part, but it is positioned at the top of the SP site to which I want to add it. This is not what I want.
    Any non-programmatic suggestions are welcome.
    (I can read code to a certain degree, but I doubt my team leaders have that in mind.)
    Thanks.

    Hello,
    Do you have designer? If yes then you can open yoru page in designer and add the webpart wherever you want.
    Make sure that you have added the new webpart zone right side to add link webpart in right side pane.
    http://sharepoint-videos.com/module-1/create-and-manage-web-part-zones-using-sharepoint-designer/
    https://support.office.com/en-in/article/Six-easy-ways-to-customize-your-site-by-using-Web-Parts-752f6e96-af2e-4bc0-a8cc-e82a26f3a932?ui=en-US&rs=en-IN&ad=IN
    Links are for 2007 but will work in 2010 as well.
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see<br/> Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • All web pages are not centerd cuts off the right side

    <blockquote>Locking duplicate thread.<br>
    Please continue here: [[/questions/875623]]</blockquote>
    I go to my email page and on the right side of the page is the login icon but I cant get to it its just off to the side

    This issue can be caused by the Babylon Toolbar extension
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Noise comming from the right side of my MBP

    Hi, i have a new 2012 regular 15" mbp. I had the Retina at first, it was completely silent, but this macbook i can hear, especially the right side. Both fans are running at idle 2000RPM. Is this the 7200RPM hard drive making noise? Its not terribly loud, but compared to the Retina its definitely audible.
    Thanks in advance.

    Morty89 wrote:
    Hi, i have a new 2012 regular 15" mbp.
    Thanks in advance.
    Call Apple Care.    
    #1 - You have 14 days from the date of purchase to return your computer with no questions asked. 
    #2 - You have 90 days of FREE phone tech support. 
    #3 - If you've purchased an AppleCare Protection Plan, your warranty last for 3 years.   You can obtain AppleCare anytime up to the first year of the purchase of your computer.    
    Take FULL advantage of your warranty.  Posting on a message board should be done as a last resort and if you are out of warranty or Apple Care has expired.

  • Why does my text in Indesign start on the right side instead of the left?

    I have done something to the newsletter that I am working on, but I don't know what I did.
    Whenever I try to write a caption on a picture or try to type a piece of text for the newsletter, the cursor starts on the right side instead of the left and makes weird spacing and never lines up correctly.
    The only way I can get text to work now is to use a snipping tool and snip text from another program!

    With just the text tool selected, but no text boxes selected (or made), any change to the style of paragraphs or fonts etc is 'set' for the document. If you have clicked on the right alignment tool with nothing selected, then everything from then onwards will default to right align.
    If every document you've worked on is doing this, then open InDesign with no document open (so just the panels showing, but no file/doc open) and select left align with the text tool in use. Any setting made with InDesign like this, is default for any new document created. Colours, alignment, optical kerning, fonts, sizes, leading etc etc changed in this state, is the new default.

  • HELP - hi with apple Configurator why does it show with a yellow triangle on the right side of the screen what am i doing wrong for the ipads not syncing or whatever and how do i fix that?

    HELP -- hi with apple Configurator why does it show with a yellow triangle on the right side of the screen what am i doing wrong for the ipads not syncing or whatever and how do i fix that? although i have looked online to try and figure it out and here is the website i found is this the stuff i need to do to fix this? is this site what i need to do to fix this? http://edtechstandish.wordpress.com/what-ive-learned-about-apple-configurator-so -far/  Thanks

    Sorry but I don't know anything about this.  But you might have better luck posting this question over ing the iPad in Business and Education forum here: https://discussions.apple.com/community/ipad/ipad_in_business_and_education?view =discussions.

  • I just install Photoshop CC. I try to open the file picture. All open as solid black picture. But on the right side under layer I can see little pic preview. Please help!

    I just install Photoshop CC. I try to open the file picture. All open as solid black picture. But on the right side under layer I can see little pic preview. Please help!

    These questions below may be for a different product... but the KIND of information you need to supply is the same, for the products you use
    More information needed for someone to help... please click below and provide the requested information
    -Premiere Pro Video Editing Information FAQ http://forums.adobe.com/message/4200840
    •What is your exact brand/model graphics adapter (ATI or nVidia or ???)
    •What is your exact graphics adapter driver version?
    •Have you gone to the vendor web site to check for a newer driver?
    •For Windows, do NOT rely on Windows Update to have current driver information
    •-you need to go direct to the vendor web site and check updates for yourself
    •ATI Driver Autodetect http://support.amd.com/en-us/download/auto-detect-tool
    •nVidia Driver Downloads http://www.nvidia.com/Download/index.aspx?lang=en-us

  • Chapter numbering on the right side

    I do not know hot to set up style for Heading1 - it should be my first level for document description and I need to have the numbers on the right side.
    Like this: Chapter 1

    Hi Ken
    I will explain it more in detail.
    I am preparing a document for user manual.
    I have set up the basic paragraph styles for document.
    Heading_1
    Heading_2
    Heading_3
    Heading_4
    For Heading_1 I suppose to create numbering with the number form left of that style.
    So it should look like this: Chapter 1
    Than Chapter 2 and so on.
    For TOC suppose to use the same style or a bit modified (maybe a smaller font)
    One more question:
    What is the difference btw. automatic chapter number and my using of paragraph style (Heading_1), where I have an automatic numbering for that style too?
    I will explane idfa

  • Access Connections icon on the left side instead of the right side on taskbar

    As stated in the title of this post the icon of Access Connection 5.72 is on the left side. The only way to have it correctly on the right side is to go to 'Toolbars' on the task bar -> uncheck Access Connections -> apply -> recheck Access Connections -> apply -> ok
    Lenovo, please fix this

    @kingskawn,
    Could you let me know where can I obtain this SCCM software so I may try to replicate this bug?
    Also do update the TVAC to the latest version.
    http://www-307.ibm.com/pc/support/site.wss/document.do?lndocid=MIGR-73682
    I understand you are using Update Retriver to download the software but there are some delays in the Update Retriver compared to the Lenovo Support site. Therefore try installing the latest TVAC and then install the SCCM software and see the bug still occur.
    //JameZ
    Check out the Community Knowledge Base for hints and tips.
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"!
    X240 | 8GB RAM | 512GB Samsung SSD

Maybe you are looking for