how to get colunms displacement for a table in Oracle?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • h13p
    New Member
    • Jun 2008
    • 5

    how to get colunms displacement for a table in Oracle?

    How do I get columns displacement for a table or tables in Oracle? Is there a command for it?

    I am thinking about to write a COBOL program to do this by read in the output of SQL/PLUS DESC TABLE-NAME and format its column length to get the displacement. But, I think some of you must have a better way to this. Please advise!

    Thank you for you help!
    --Hiep
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    try to use dictionary object USER_TAB_COLS

    Comment

    • h13p
      New Member
      • Jun 2008
      • 5

      #3
      Thank you Debasisdas!
      I am looking to that.. if you have example of SQL statements that would be great..

      Again thank you for your help.
      --Hiep

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        what exactly you are trying to findout ?

        Comment

        • h13p
          New Member
          • Jun 2008
          • 5

          #5
          Hi debasisdas,

          I need to unload a table into a flat file and want to know the column name, length and the start position of each column.

          I'll need these information on every table in the Oracle data base. I'm using 10g.

          Again, thank you in advanced for your advise.
          --Hiep

          Comment

          • debasisdas
            Recognized Expert Expert
            • Dec 2006
            • 8119

            #6
            you can use this

            select * from user_tab_cols

            but since you want for number of tables better write a procedure for that.

            Comment

            • h13p
              New Member
              • Jun 2008
              • 5

              #7
              Originally posted by debasisdas
              you can use this

              select * from user_tab_cols

              but since you want for number of tables better write a procedure for that.

              Thank you debasisdas!

              Do you know the way to set the sql/plus to display the whole line without wrap around or trunkcated?

              select * from user_tab_cols will display a long line and it warped around so it hard to read. I set wrap off then it truncated. I set linesize 132 but it still wrap around.

              --h13p

              Comment

              • debasisdas
                Recognized Expert Expert
                • Dec 2006
                • 8119

                #8
                you need to use

                SET LINE SIZE 1500
                PAGE SIZE 200

                Comment

                Working...