Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Location
    Italy
    Posts
    11

    Question Unanswered: formatting query result in db2

    Anybody knows how to format queries result in db2 using clp for instance? as in oracle?

    Rosario

  2. #2
    Join Date
    Dec 2003
    Location
    Italy
    Posts
    11

    formatting.. 2nd part

    ..for example in oracle sqlplus was the column command allowing the formatting of columns in result queries

    ex: col table_name format a10

    does exists something similar in db2 or in some of its tools?
    It is possible so to have a more readble and ordered result queries?

    Thanks again
    Rosario

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1

    Re: formatting.. 2nd part

    Originally posted by downtown
    ..for example in oracle sqlplus was the column command allowing the formatting of columns in result queries

    ex: col table_name format a10

    does exists something similar in db2 or in some of its tools?
    It is possible so to have a more readble and ordered result queries?

    Thanks again
    Rosario
    The answer is no. You can't format query output using CLP, as you would in Oracle's SQLplus. However, you could use string functions to accomplish what you need. E.g. instead of

    COL TABLE_NAME FORMAT A10

    you could use

    SUBSTR(TABLE_NAME, 1, 10)

    which will result in a string right-padded with blanks to the length of 10 characters.
    ---
    "It does not work" is not a valid problem statement.

  4. #4
    Join Date
    Dec 2003
    Location
    Italy
    Posts
    11
    thanx much n_i

Posting Permissions

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