Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    5

    Unhappy Unanswered: problems with NUMBER data_type

    COLUMN_NAME DATA_LENGTH DATA_TYPE
    ACTION_AMT 22 NUMBER
    ACTION_END_DATETIME 7 DATE
    ACTION_GROUP_ID 22 NUMBER
    ACTION_GROUP_NAME 25 VARCHAR2


    Hi. I am creating an asp page that displays certain information from an
    oracle db. everything works ecept for the that vlaue of the data_length with the data_type of NUMBER. It is displaying the Number data_type default value than the value it has in the db. The other data_typse are showing the correct data_length. I don't know what is wrong. Can anyone help me? code included. (io txt form jus change extension to asp if needed)
    Attached Files Attached Files

  2. #2
    Join Date
    Apr 2003
    Location
    NY
    Posts
    208

    Re: problems with NUMBER data_type

    Oracle Data Definition tables store the "Length" of the Number data_type in a couple fields. Data_Precision(left of decimal), and Data_Scale(right of decimal) ie (32 , 4)

    Try using a decode on the data_type to get the length:

    decode(data_type,'NUMBER',Data_Precision||','||dat a_Scale,data_length)

    would result in


    COLUMN_NAME DATA_LENGTH DATA_TYPE

    ACTION_AMT 32,0 NUMBER
    ACTION_END_DATETIME 7 DATE
    ACTION_GROUP_ID 22 NUMBER
    ACTION_GROUP_NAME 25 VARCHAR2

    Sel1="SELECT TABLE_NAME, COLUMN_NAME, decode(data_type,'NUMBER',Data_Precision||','||dat a_Scale,data_length)
    DATA_LENGTH, DATA_TYPE From ALL_TAB_COLUMNS WHERE"

  3. #3
    Join Date
    Sep 2003
    Posts
    5

    Talking thank you

    thank you sooo very much. your code did it

Posting Permissions

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