Format output - set width of column and also two-lined column name

Hi,
I want column EMPLOYEE_ID to be printed also in two lines and also that the width of the column will be 8 like this:
EMPLOYEE
ID
(width 8)
I tried this:
column EMPLOYEE_ID HEADING EMPLOYEE|ID Format a8
but the two-line formatting didn't work (the width really was 8).
How can I combine this 2 options?
Thanks

Hi Frank,
Which version of SQL*Plus are you using?my version is:
SQL> DEFINE  _sqlplus_release;
DEFINE _SQLPLUS_RELEASE = "000000000" (CHAR)
Here is the complete test script that shows the problem:
SQL> column EMPLOYEE_ID   HEADING EMPLOYEE|ID Format a12
SQL> column FIRST_NAME    HEADING FIRST|NAME Format a10
SQL> column LAST_NAME     HEADING FIRST|NAME Format a12
SQL> column EMAIL         Format a30
SQL> column PHONE_NUMBER  HEADING PHONE|NUMBER Format a12
SQL> column HIRE_DATE     HEADING HIRE|DATE Format a12
SQL> column SALARY        Format a5
SQL> column JOB_ID        HEADING JOB|ID Format a6
SQL> column MANAGER_ID    HEADING MANAGER|ID Format a12
SQL> column DEPARTMENT_ID HEADING DEPARTMENT|ID Format a13
SQL>  SELECT * FROM employees;
EMPLOYEE_ID FIRST_NAME LAST_NAME    EMAIL                          PHONE_NUMBER HIRE_DATE    SALAR JOB_ID   MANAGER_ID DEPARTMENT_ID
         362 Tracy      Freeman      [email protected]        0544456377   10/28/2009    8013    879          165          1100
         598 Deborah    Hutch        [email protected]          0522915345   9/11/2009     6027    927          147          2500
         282 Steve      Weber        [email protected] 0582564427   9/17/2012    17825    101          147          2600
         710 Shawn      Winans       [email protected]        0584555378   7/19/2004     7713    879          147          1100
         452 Marlon     Costa        [email protected]  0587903317   10/24/2010    9695    354          158          1500
         198 Pamela     Dalton       pamela.dalton@innovateecommerc 0525647730   11/4/2004    20890    101          171          1100
         987 Christma   Maxwell      [email protected]  0587166637   11/14/2001   18865    198          146          1700
         698 Joey       Sweet        [email protected]              0587757460   1/17/2007     8136    947          198          2100
         145 Armin      Preston      [email protected]            0575161830   3/22/2009    12772    735          839          1600
         159 Aida       Rourke       [email protected]             0574977531   8/24/2010     9779    421          453          2400
         165 Natalie    Murdock      [email protected]     0583019470   2/28/2001     8665    354          402          1700
         158 Lynette    Kravitz      [email protected]             0523285052   1/3/2009      9344    735          734          2700
12 rows selectedThe width works fine, but the two-line column name doesn't work.
Thanks for the help

Similar Messages

  • Dependant Dropdown - Format string as date?? And hopefully two dates as a range?

    I'm stuck - been trying to figure this out all afternoon and with a launch in 2 days am probably missing something obvious....so please help me!! hehe<br />I have the a dependent drop down.  The first one is a list of Locations and the second one is then populated by a list of dates that events will be at those locations.<br /><br />1st problem:  when I've been hand coding this drop down I am able to show the start and end date with something like:<br />echo date( 'l, M j', $row_getalldates['date_start']).' - '.date( 'M j',$row_getalldates'date_end']);<br /><br />b How do I translate that into one string to display in wdg:displayfield=""<br /><br />2nd:  Right now since I can't get the two values in...I'm just going with one value so I can continue with development till I figure it out.  <br /><br />I cannot get the date formatted as I usually do with the date() function I usually use. See: http://camp.studentlife.com/housing2/index.php?op=addinfo<br /><br />b SQL STATEMENT:<br />$query_getalllocations = "SELECT distinct(b.title),locationid FROM calendar a LEFT JOIN sllocations b USING (locationid) WHERE b.title is NOT NULL and a.date_start>$mstart_date and a.date_start<$mend_date AND (a.calid='1' ) GROUP BY b.title ORDER BY b.title ";<br />$getalllocations = mysql_query($query_getalllocations);<br />$row_getalllocations = mysql_fetch_assoc($getalllocations);<br />$totalRows_getalllocations = mysql_num_rows($getalllocations);<br /><br />$colname_getalldates = "-1";<br />if (isset($_GET['locationid'])) {<br />  $colname_getalldates = $_GET['locationid'];<br />}else{<br />     $colname_getcalendar = "-1";<br />     if (isset($_GET['eventid'])) {<br />       $colname_getcalendar = $_GET['eventid'];<br />     }<br />     <br />     $query_getcalendar = sprintf("SELECT * FROM calendar WHERE eventid = %s", GetSQLValueString($colname_getcalendar, "int"));<br />     $getcalendar = mysql_query($query_getcalendar);<br />     $row_getcalendar = mysql_fetch_assoc($getcalendar);<br />     <br />     $colname_getalldates =$row_getcalendar['locationid'];<br />     mysql_free_result($getcalendar);<br />}<br /><br />$query_getalldates = sprintf("SELECT a.* FROM calendar a WHERE locationid = %s and a.date_start>$mstart_date and a.date_start<$mend_date ORDER BY a.date_start ASC", GetSQLValueString($colname_getalldates, "int"));<br />$getalldates = mysql_query($query_getalldates);<br />$row_getalldates = mysql_fetch_assoc($getalldates);<br />$totalRows_getalldates = mysql_num_rows($getalldates);<br /><br />b ABOVE MY HEAD TAG:<br />//begin JSRecordset<br />$jsObject_rs_alldates = new WDG_JsRecordset("rs_alldates");<br />echo $jsObject_rs_alldates->getOutput();<br />//end JSRecordset<br /><br />b AND INSIDE MY FORM:<br /><select name="location" class="required" id="location" tabindex="1"><br />   <option value="0" <?php if (!(strcmp(0, $row_rs_alllocations['locationid']))) {echo "selected=\"selected\"";} ?>>SELECT LOCATION</option><br />   <?php<br />do {  <br />?><br />   <option value="<?php echo $row_rs_alllocations['locationid']?>"<?php if (!(strcmp($row_rs_alllocations['locationid'], $row_rs_alllocations['locationid']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rs_alllocations['title']?></option><br />   <?php<br />} while ($row_rs_alllocations = mysql_fetch_assoc($rs_alllocations));<br />  $rows = mysql_num_rows($rs_alllocations);<br />  if($rows > 0) {<br />      mysql_data_seek($rs_alllocations, 0);<br />       $row_rs_alllocations = mysql_fetch_assoc($rs_alllocations);<br />  }<br />?><br />    </select></span></label></p><br />  <p><label><span><br />    <select name="date" class="required" id="date" tabindex="2" wdg:subtype="DependentDropdown" wdg:type="widget" wdg:recordset="rs_alldates" wdg:displayfield="date_start" wdg:valuefield="eventid" wdg:fkey="locationid" wdg:triggerobject="location" wdg:selected="SELECT YOUR CAMP DATE" ><br />    </select></span></label></p><br />1st I though it was the wdg:selected parameter that I could just throw make echo date( instead of just echo.   But no...that would be too easy ;)<br /><br />I figure its either in the "echo $jsObject_rs_alldates->getOutput();" above the head or hard coded into the included ADDT javascript files. Don't mind if I have to hard code as the site's lifespan is short

    Hi Amanda,
    how about preparing that within your query by using a CONCAT function and by formatting the dates right in here, like:
    SELECT CONCAT(DATE_FORMAT(date_start, '%I, %M %j')," - ",DATE_FORMAT(date_end, '%M %j')) AS date_range ?
    The wdg:displayfield expects one table column, and in this case it would be the alias column "date_range".
    Works ?
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Combine 2 different list columns and showning in 1 column

    Hi,
    Is it possible to combine columns of 2 different lists and show in one column?
    I have a custom list called "Levels" which contain data like "Developer", "Tester". The levels have some training associated. Training is another column.
    I have another custom list called "Project", which contain "project name" and also some training for each project. Training is another column.
    I have another  list in which i have user names which contain the level and project name columns as look up.
    I want to show all the trainings attached to the user in another list in a single column.
    Example: If user is a developer and part of project A, then column named training should show all the developer training and the project related training.
    Note: custom coding is not possible.
    How to achieve this?
    Thanks

    Hi,
    For your issue, you can combine 2 different list columns into one cloumn using SharePoint Desinger Workflow with update list item action:
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • First of the column and last of the column

    hi there,
    sorry if it is a repost, please redirect me if this topic has been discussed. thank you.
    my question is how do i get the first entry of the particular column and the last entry of the same column without calculating the number of row?
    as for now my way of doing it is
    select column1 from table1 where rownum=1
    and
    select column1 from table1 where rownum=lastrow
    but this takes up too much time....
    appreciate for recommendations

    "select column1 from table1 where rownum=lastrow"
    I think this SQL statement will return nothing, the reason can be found here.
    http://www.oracle.com/technology/oramag/oracle/06-sep/o56asktom.html
    Get the last entry of the particular column:
    select * from(
    select column1 from table1 order by rowid desc
    ) where rownum = 1
    Get the first entry of the particular column:
    select * from(
    select column1 from table1 order by rowid order by rowid
    ) where rownum = 1

  • Adding the value of two columns and place to 3rd column in jtable

    hi all,
    i have table with 3 columns with rows
    say for example --loan, interest, total
    i want add loan+interest and place into total column.
    how can i do this?
    thanks in advance
    daya

    Use a TableModelListener:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=566133

  • Update a column with info from columnA, and if not in columnA, then columnB

    I have a situation where I have to update a columnC with information stored one of 2 ways. It is stored one way in ColumnA, and another way in columnB. I must check the string if it is in columnA first, and if it is, that value will go in columnC to be updated. If it is not, I must go on to columnB and find it there. It will be in one of the 2 columns but I must use the way it is stored in these columns to store in my columnC to be updated. The data is basically turned around (not reversed letter for letter, though) in the 2 columns and must be stored the way it is found in columnA or columnB. Any ideas?

    It's that simple? It will look in both columns this way? Now, I actually mentioned UPDATE when I meant INSERT, so I am doing this in a VALUES clause? Will I just use the phrase 'nvl(A, B);'?

  • How do you sort specific columns and freeze a header column?

    I'm creating a list of people attending a workshop and would like the first column to be the number of people attending. The first column is the number and that row sorts with the rest, so then my numbers go 1, 9, 5, etc instead of remaining 1-20. Is there a different way for me to determing the number? I put 1 in cell A 2 and then for A 3 I give it a formula A1 + 1 to create the number sequence. I've tried making it a header column and freezing the column, but it still changes.
    thanks,
    Nancy

    Nancy,
    You can search the discussions when you have a specific question, or you can just browse them from time to time to see what there is to be learned. Your question is a little like "How did you learn to be a good cook?" Most of the good home cooks never went to cooking school, but they have had lots of good coaching and lots of experience. Many of the helpers here have been using spreadsheets for so long that they don't remember when they learned a particular trick or method. And, we like to share, so keep the questions coming.
    I keep the Formula Browser in view, and I study the examples for the functions I think I might want to use.
    Regards,
    Jerry

  • How to add a new column in between two other columns

    I need to add a new column in between two other existing columns. Does anyone know how to do that? The ALTER statement adds the column at the end. Can someone give an example.
    Thanks
    Murali
    null

    There is no simpler way of doing this because it is not strictly necessary: you can always see your data in the order you want simply by going SELECT col1, col2, col98, col4, etc. Thus the column order only matters when you execute SELECT * FROM...
    If that really is important enough to you you'll have to drop and re-create the table, for which there are a number of different strategies.
    Your final comment suggests that you don't retain your database build scripts. If you did then rebuilding your constraints would be painless. There is a lesson there. The good news is that if you have TOAD (download from www.quest.com) you can generate DDL scripts from your existing schema.
    HTH, APC

  • How to save report output in a PDF file and also show preview in one processing cycle

    Hi every body,
    We R re-developing an application from COBOL to Oracle.
    Using Reports 6i 6.0.8.11.3.
    The requirement is that whenever a user processes a report, it should be saved on disk say in PDF format. Then it should be shown in Reports Runtime Previewer.
    So far I have explored that only one of theses can be done in one processing cycle.
    That is if we set DESTYPE to FILe it will only be saved to disk. If we set DESTYPE to Preview, the report can be previewed and optionally printed but not saved.
    I want that both saving to disk and preview should be possible.
    I have explored .DST file option but there is only provision for FILE, PRINTER and MAIL.
    Printing facility should be optional, otherwise we would have used FILE and PRINTER destinations in .DST file.
    Once that file is saved on disk, it can later on be printer if user requires more copies.
    I would prefer a solution other than User_exit as I don't have training in developing user_exits.
    Any help please.
    Tariq

    I had a similar requirement and decided to run the report from forms. When a button is pressed, the report is run to create the pdf file, followed by separate command to invoke acrobat reader or internet explorer to display the file, rather than using reports previewer.
    The file can be displayed from forms by a host command in client server, or by web.show_document on the web.

  • Csv file to database tables and also foreginkey related columns directly

    i have created dimensions tables in ssis  and i need to load  the data into that tables from my given csv files. iand i have foriegien key columns of fact table for this also data need to load

    definitely we have primary key relations..  the tables contain primary keys and forien keys  i have created tables nearly 20 tables  in sql server some of them consist of dimensions and facts.. so i have an csv files of data. so that i need
    to load data in that tables by using ssis package
    i have an idea taking one data flow task in control flow task for  each and every single table i am taking one oldb destination. for each and every one i need source as csv file. by connecting this both we can load data
    but i need to load data into 20 tables by taking on dataflow task..how it is possible any solution and any different ways to load data from csv files to ssispacke tables

  • I wnat the date formate. year with 4 digigt, month and date two digit. I do

    This is my code.
    TimeZone timeZones = null;
    DateFormat dateFormating = null;
    boolean dateCheck = true;
    Date newDate = new Date);
    if(dateCheck)
         dateFormating = DateFormat.getDateTimeInstance( DateFormat.SHORT, DateFormat.SHORT, Locale.GERMAN); // Locale.FRANCE
         timeZones = TimeZone.getTimeZone("America/Los_Angeles"); // "Europe/Berlin"
    }else{
    timeZones = TimeZone.getDefault();
    dateFormating = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT, Locale.US);
    dateFormating.setTimeZone(timeZones);
    String formatedDate = dateFormating.format(newDate);
    // System.out.println(" DateFormatManager ================ formatedDate "+dateFormating.format(newDate));
    I got the this date 5/29/08. But I want the date for this formate 5/29/2008. I don't want to set the date formate. It's automaticaly change based on the timezone and locales.
    Anybody help me correct result. Which part i want to change the above code.
    Thanks
    palani

    this is a reusable component which i developed try it
    import java.awt.FontMetrics;
    import java.awt.Graphics;
    import java.text.DecimalFormat;
    import java.util.Calendar;
    import java.util.Date;
    public class DateTime// implements Runnable
    protected DecimalFormat tflz, tf;
    private boolean stopped=false;
    javax.swing.JTextField text_field;
    public DateTime(javax.swing.JTextField text)
    text_field=text;
    new Thread(new Runnable() {
    public void run() {
    while (stopped==false) {
    // run1();
    paint1();
    try {
    Thread.sleep(1000);
    } catch (InterruptedException e) { /* do nothing */
    }).start();
    // java.util.concurrent.ExecutorService es=java.util.concurrent.Executors.newFixedThreadPool(0);
    //     es.execute(this);
    public void paint1() {
    tf = new DecimalFormat("#0");
    tflz = new DecimalFormat("00");
    Calendar myCal = Calendar.getInstance();
    StringBuffer sb = new StringBuffer();
    sb.append(tflz.format(myCal.get(Calendar.MONTH)+1));
    sb.append("/");
    sb.append(tflz.format(myCal.get(Calendar.DATE)));
    sb.append("/");
    sb.append(tflz.format(myCal.get(Calendar.YEAR)));
    sb.append(" ");
    sb.append(tf.format(myCal.get(Calendar.HOUR)));
    sb.append(':');
    sb.append(tflz.format(myCal.get(Calendar.MINUTE)));
    sb.append(':');
    sb.append(tflz.format(myCal.get(Calendar.SECOND)));
    String sss = sb.toString();
    text_field.setText(sss);
    public void stop()
    stopped=true;
    public void start()
    stopped=false;
    }

  • HT2020 I try to set up the Ichat and it put my computer name a some password that i dont know, how to fix this problem

    Hi there
    I just bought a macbook pro i have been using windows my whole life so i am really strugling to do every simple thing now, literaly crawling.
    Could somebody help me please.
    Thanks

    HI,
    It would help to know which version of iChat you are using.
    A New MacBook Pro  is more likely to be running OS X 10.8.something.
    Go to the Apple Icon top left and select the "About this Mac" item.
    The Panel that shows up will show the OS version the Mac is running.
    My iMac's panel.
    It says I am running OS X 10.8.4
    OS X 10.8.x is generically know as Mountain Lion.
    In Mountain Lion Apple introduced Messages which has a different set up to the iChat versions in earlier OSes.
    iChat first run
    In versions 2 through 5 you get sent through a set of Start Up Screens.
    These ask you for your AIM or @mac.com or @me.com names at that time.
    Then there is a another screen that prompts you for your Jabber or Google ID.
    There is a screen to Enable Bonjour (a way of Chatting with other Mac s on the same LAN).
    Alternative for iChat
    You can click through the Start Up Screens and not enter anything (it cannot tell that you have not entered an AIM name or a Jabber based name as you don't have to enter an AIM valid name or a Jabber one the first time).
    iChat will now start but not show any Buddy lists
    With iChat in the Menu bar chose the iChat menu > Preferences > Accounts.
    This will list the Bonjour Account (everyone has this and it cannot be deleted.) although it is not likely to be Enabled.
    Below this area for the list of Accounts is a Plus and Minus icon/Buttons
    Click the Plus one.
    This will open a new pane. (window)
    The top item is a drop down.
    Depending which version you have will alter what options you see.
    iChat 4 and 5 will list AIM then @mac.com and MobileMe before a line that then has GoogleTalk and Jabber.
    iChat 6 will also have Yahoo
    iChat 3 will list AIM and @mac.com and Jabber (it did not list Google separately)
    In Messages the AIM options are reduced to just "AIM" but you can still use this for @mac.com and @me.com ending IDs from Apple (That are valid AIM names)
    With the drop down expanded.
    Messages in Mountain Lion  (OS X 10.8.x)
    This will start up differently
    It will ask for an Apple ID so you can "Register" it for iMessages.
    iMessages is a form of Messaging that Apple have included on iOS devices (IPhone and iPads) that has been aded to what was iChat to make the  Messages App.
    Again if you click  through this the Preferences > Accounts of the App will still show the Bonjour and the iMessages accounts that cannot be deleted.
    You can still go ahead and enter AIM valid names or Jabber/Google ID s and Yahoo IDs using the Plus icon below the list.
    Passwords
    If you have a version that means you can create and Yahoo or Google Account in Messages or iChat then you use the password that works logging into Yahoo or Google.
    If you have an @mac.com ending ID from Apple make sure the password at Apple is 16 characters or Less as this is needed by the AIM servers to work.
    The same applies to @me.com and @icloud.com ending IDs
    However these particular "iCloud issued" IDs will not work in iChat 5 or earlier versions.
    This is dues to a change in iChat 6 and Messages where by there is a Login to Apple that in turn allows the AIM server to "Read" the Password.  This does not happen in iChat 5 or earlier so the names issued since iCloud started don't work.
    8:40 PM      Monday; June 10, 2013
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.4)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • How to concatinate values of two columns and update into another column

    There is a table : TEST contains three columns - Column1 , Column2 , Column 3
    Column1 contains values - (1,2,4)
    Column2 contains values : (a,b,c)
    Column 3 is empty .
    Target : Values in column 3 should be (1a,2b,4c)
    Need to achieve this through procedure .

    Paul if i want to concatenate two strings or alpha numeric characters from 2 fields and display in the third field,Will this code be able to do that?

  • Recently my iPhone 4 has started to delete the content of messages as soon as I open them and also is changing the names of some of my contacts from the name that I give them to their email addresses and all of this is without any input from me help!

    My iPhone 4 has started to delete the content of messages automatically as soon as I open them and is also changing some of my contact names from their names to their email addresses. Help!

    I've had the same problem with the names being changed to email addresses.Did you ever find out how to stop this ?

  • Taking info from Column and Pasting to another Column without losing content?

    Hi Numbers Masters,
    I am working on an e-commerce store CSV spreadsheet.
    For instance:
    I have column "A" which is a description of a product and column "B" which is a SKU Number. I want the SKU number column info to be added to Column "A" without deleting the description content in Column "A". There is different values for each SKU number in column B and different content for info in Column "A".
    If I copy and paste I lose the info in Column "A" and am just left with info from Column "B".
    THANK YOU

    In Excel I would do this
    Save a copy of the file.
    Concatenate the text by creating a formula in a third column that "adds" the contents of A and B.
    Then inspect the column
    I expect Numbers works similarly.
    Use the & function to add strings (Descriptions or SKU)
    Something like this
    A1 & B1
    A1 & " " & B1
    gives you a space
    A1 & " -" & B1
    gives you a dash
    Description
    SKU
    Combine
    Scissors
    1234
    Scissors 1234
    Clipboard
    78766
    Clipboard 78766
    Masking tape
    9832
    Masking tape 9832
    Scissors
    1234
    Scissors:1234
    Clipboard
    78766
    Clipboard:78766
    Masking tape
    9832
    Masking tape:9832

Maybe you are looking for