2 Replies Latest reply on Nov 18, 2019 11:49 PM by L. Fernigrini

    Oracle 12c - DBA True or False condition from DBA

    SPathak

      Dear Friends

      How to give the True or False condition from DBA Itself , while creating a Database Table . for example if i want to give T/F for customer .

       

      Sanjay

        • 1. Re: Oracle 12c - DBA True or False condition from DBA
          John Thorton

          SPathak wrote:

           

          Dear Friends

          How to give the True or False condition from DBA Itself , while creating a Database Table . for example if i want to give T/F for customer .

           

          Sanjay

          No sane OLTP application should be creating any table on the fly for a customer.

          Application objects should be known & static between application version releases.

          Who is supposed to do what when "F" is returned to customer?

           

          Please click on URL below & provide details as stated in #5 - #9 inclusive

           

          How do I ask a question on the forums?

          • 2. Re: Oracle 12c - DBA True or False condition from DBA
            L. Fernigrini

            I really do not understand the question... You mean that you need a column to store True / False information and want to know the datatype to use? Oracle does not have a boolean type in SQL, so you cannot define a column as boolean (or bit like SQL Server).

             

            You may want to use a CHAR(1) column accepting just 'Y' or 'N' (or S and N, or whatever letter better represent true/false), or, as I prefer, just accept '0' and '1' to make them language agnostic). You need a check constraint to ensure that only 0, 1 and nulls are possible.

             

            Using NUMBER(1,0) seems also a good idea, but a NUMBER column will use 2 bytes of storage and a CHAR(1) only 1, so you may want so save some space by using the CHAR type.