Results 1 to 7 of 7
  1. #1
    Join Date
    Oct 2004
    Posts
    105

    Unanswered: datatype "yes/no" in Access in oracle too?

    Hi everybody i have a question
    im just beginning with oracle, i have a Database in Access and now i have to create that Database in Oracle
    I got the tool "Toad" to do that
    now i have colums of the datatype "yes/no" in Access and i would need that too in oracle. Does such a type exist there?
    Thanks a real lot

  2. #2
    Join Date
    Jan 2005
    Posts
    6
    hi,

    one method is to define a type boolint which is ranged between -1, 0 (-1 true, 0 false) and using those fields

    but a simple number field does fit, too.

    regards,
    gore

  3. #3
    Join Date
    Oct 2004
    Posts
    105
    Hi yes i thought about just using a number 0 and 1 instead but then i would have to change that everywhere in my programme that is using the database
    So if i create a type there i can say 0 is false and 1 is true?
    or do i have to do it with yes and no fro false and true like it is in access?
    and how can i create such a type?
    sorry so many questiones
    thanks so much

  4. #4
    Join Date
    Oct 2004
    Posts
    105
    oh i found types but it says create object type
    and create collection type?
    which one would be the right one? my tables are not Objecttables
    so i have to create a collection type then?
    thanks

  5. #5
    Join Date
    Jan 2004
    Posts
    492
    To answer your question, there is no such column datatype like YES/NO in Oracle. Typically, in the Oracle ERP packaged systems, if they need a column for a flag, they will use a varchar2(1) column, and put 'Y' or 'N' as values. You could do this, and add a check constraint that ensure you could only put in one of those 2 values. You could if you wanted do a varchar2(3) column and put YES/NO, although Y/N would more than suffice.

    As far as not changing your application, I can understand not wanting to, but you cant expect to move from Access to Oracle and not change some things. Thats like moving from a one bedroom appartment to a mansion and not expecting to buy any new furniture.
    Oracle OCPI (Certified Practicing Idiot)

  6. #6
    Join Date
    Oct 2004
    Posts
    105
    yes i guess your right i will do that then, thanks for your help

  7. #7
    Join Date
    Mar 2004
    Posts
    370
    Hi,
    You do NOT need that! trust me.If you design your database well you wont need it at all."Yes/No" is not a data type ,It is so low level to be defined in logical design level.Also I dont recommend using 0,1 at all.It will bring misunderstandings to your design and difficulty of porting and readablity of code in next.And ofcourse you will need to use a mechanism such as triggers to avoid nonsense data that have obviose overhead.
    If you could redesign your database before migrating it to Oracle.
    -Best wishes

Posting Permissions

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