Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Unanswered: NOOB ??? Thing to ask

    I know it would be kind of strange to ask, but it is related to SQL Plus.
    I have been using yasql for quite sometime, and I like the features it provides, like automatic command completion, table name completion, and command history, which are missing in SQL Plus.

    But installation, SQLPLUS worksheet which is based on SQL Plus, I am not able to set the viewable width for the column. If a column is of 80 characters, and the value in table is 16 chars, it would still take 80 columns to display the result.

    Does anyone has any solutions to this.
    Thanx and Regards
    Aruneesh

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: NOOB ??? Thing to ask

    Originally posted by aruneeshsalhotr
    I know it would be kind of strange to ask, but it is related to SQL Plus.
    I have been using yasql for quite sometime, and I like the features it provides, like automatic command completion, table name completion, and command history, which are missing in SQL Plus.

    But installation, SQLPLUS worksheet which is based on SQL Plus, I am not able to set the viewable width for the column. If a column is of 80 characters, and the value in table is 16 chars, it would still take 80 columns to display the result.

    Does anyone has any solutions to this.
    Thanx and Regards
    Aruneesh
    SQL Plus has a command COLUMN that you can use like this:

    SQL> COLUMN name FORMAT A16

  3. #3
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Column Width

    Just one thing I had, suppose I have two tables A and B both with columns title, could i specify the table name along with the column name, which the query should trim.

    Thanx and Regards
    Aruneesh

  4. #4
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Column Width

    Originally posted by aruneeshsalhotr
    Just one thing I had, suppose I have two tables A and B both with columns title, could i specify the table name along with the column name, which the query should trim.

    Thanx and Regards
    Aruneesh
    You would have to use column aliases:

    COLUMN a_title FORMAT A16
    COLUMN b_title FORMAT A24

    SELECT a.title a_title
    FROM a;

    SELECT b.title b_title
    FROM b;

  5. #5
    Join Date
    Jul 2003
    Location
    US
    Posts
    314

    Thanx a ton

    Andrew
    Thanx for the quick fix to the formatted output.
    I might switch back to sqlplus if i can find solutions like this one.

    The only thing that bugs me is that if the total width exceeds around 80 chars, the output wraps and goes to second line. Any ideas how to escape this too.
    Aruneesh

  6. #6
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: Thanx a ton

    Originally posted by aruneeshsalhotr
    Andrew
    Thanx for the quick fix to the formatted output.
    I might switch back to sqlplus if i can find solutions like this one.

    The only thing that bugs me is that if the total width exceeds around 80 chars, the output wraps and goes to second line. Any ideas how to escape this too.
    Aruneesh
    SET LINESIZE 200 -- your choice of number here
    There's a whole bunch of useful SET and COLUMN commands to play with!

Posting Permissions

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