Results 1 to 8 of 8

Thread: Column Width

  1. #1
    Join Date
    Sep 2006
    Posts
    19

    Unanswered: Column Width

    I'm having a problem with a column that is too short for it's data. It causes multiple lines for the same record. How can I change a column width in Oracle? I'm using a select statement to see the data.

    Please help me. Thanks

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Might answer be either OS or client s/w dependent?

    You could try enabling the Make_it_bigger parameter.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Sep 2006
    Posts
    19
    Quote Originally Posted by anacedent
    Might answer be either OS or client s/w dependent?

    You could try enabling the Make_it_bigger parameter.
    How is this enabled?

  4. #4
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    anacedent meant to say that if you're using SQL*plus, you could try setting a bigger linesize (with set linesize whatever) and also formatting your column appropiatelly (with column column_name format aN where N is the width).

    right anacedent ?

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Oh well, you didn't get the joke. There is no such a parameter.

    What does your question actually mean? You can't INSERT (or UPDATE) that column, or does the output of the SELECT statement spawn multiple lines?

    If it is the first option, you'll have to ALTER the table and MODIFY its length to a larger value, such as

    ALTER TABLE my_table MODIFY this_column VARCHAR2(50);

    If it is about the SELECT statement and you use it in SQL*Plus, perhaps you should use COLUMN command to set this_column width, such as

    SQL> COLUMN this_column FORMAT A50;

    If none of this is an option, could you explain it a little bit more?

    [EDIT] Also, I might type faster and answer questions on time instead of watching TV and typing at the same time.

  6. #6
    Join Date
    Sep 2006
    Posts
    19
    Quote Originally Posted by Littlefoot
    Oh well, you didn't get the joke. There is no such a parameter.

    What does your question actually mean? You can't INSERT (or UPDATE) that column, or does the output of the SELECT statement spawn multiple lines?

    If it is the first option, you'll have to ALTER the table and MODIFY its length to a larger value, such as

    ALTER TABLE my_table MODIFY this_column VARCHAR2(50);

    If it is about the SELECT statement and you use it in SQL*Plus, perhaps you should use COLUMN command to set this_column width, such as

    SQL> COLUMN this_column FORMAT A50;

    If none of this is an option, could you explain it a little bit more?

    [EDIT] Also, I might type faster and answer questions on time instead of watching TV and typing at the same time.
    It's the second option, I tried the statement you said and I get the following error:

    ORA-00900: invalid SQL statement

    I think I must specify the table in which the column is at? Maybe I am wrong.

    Thanks

  7. #7
    Join Date
    Sep 2006
    Posts
    19
    Please Help

  8. #8
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    If this is really what you need, here's an example:
    Code:
    SQL> create table test (col varchar2(200));
    
    Table created.
    
    SQL> insert into test values ('aslkdfjlaksfj lj lksj lksj lkjf alsfjk laksjf ačs
    fjoawifje aslfj aoiefj lifj asilf afasjfoiawej fl');
    
    1 row created.
    
    SQL> select * From test;
    
    COL
    --------------------------------------------------------------------------------
    
    aslkdfjlaksfj lj lksj lksj lkjf alsfjk laksjf ačsfjoawifje aslfj aoiefj lifj asi
    
    lf afasjfoiawej fl
    
    SQL> column col format a30
    SQL> select * From test;
    
    COL
    ------------------------------
    aslkdfjlaksfj lj lksj lksj lkj
    f alsfjk laksjf ačsfjoawifje a
    slfj aoiefj lifj asilf afasjfo
    iawej fl
    
    SQL>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •