Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-7324

Change the data type in ORACLE for the tinyint(1) field

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: None
    • Fix Version/s: 5.5
    • Component/s: Database
    • Labels:

      Description

      We have a wrong mapping between ORACLE and the others rdbms (SQL SERVER, PG , MYSQL) regarding the tinyint(1) field

      What is the range of these values ?

      Tinyint => 0-255
      Number (without precision) => 0-9999999999999999999999999

      The storage is not the same for each case !

      Here is the list of the fields storing a tinyint value (0-255) in ORACLE :

      ce_activity is_last number (22,0)
      characteristics enabled number (22,0)
      dashboards is_global number (22,0)
      dashboards shared number (22,0)
      issue_filters shared number (22,0)
      issues manual_severity number (22,0)
      metrics delete_historical_data number (22,0)
      metrics enabled number (22,0)
      metrics hidden number (22,0)
      metrics optimized_best_value number (22,0)
      metrics qualitative number (22,0)
      metrics user_managed number (22,0)
      projects enabled number (22,0)
      rules is_template number (22,0)
      rules_profiles is_default number (22,0)
      snapshots islast number (22,0)
      users active number (22,0)
      widgets configured number (22,0)

      The official recommendation (Oracle source) :
      tinyint(1) => number(3).

      Example , I want to modify the precision (22=>3) for the table ISSUES , col MANUAL_SEVERITY

      ALTER TABLE ISSUES MODIFY(MANUAL_SEVERITY NUMBER(3))
      

        Attachments

          Activity

            People

            Assignee:
            eric.duquesnoy Eric Duquesnoy (Inactive)
            Reporter:
            eric.duquesnoy Eric Duquesnoy (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: