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
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
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.
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.