BOOLEAN column in DB2


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: BOOLEAN column in DB2

  1. #1
    Faraw Guest

    BOOLEAN column in DB2


    How can I define a Boolean or Yes/No column when creating a DB2 table ? Please
    help.

  2. #2
    J. Lemire Guest

    Re: BOOLEAN column in DB2


    "Faraw" <betemariam@hotmail.com> wrote:
    >
    >How can I define a Boolean or Yes/No column when creating a DB2 table ?

    Please
    >help.


    GOOD question!

    Actually you cannot have boolean in sql-92.

    Use char(1) with constraint on the value or a check.

    Example:

    create table demotbl1
    (boolcolumn1 char(1)
    ...
    check (boolcolumn1 in ('Y', 'N'))
    )

    There are good books on SQL and BD2
    (1) Understanding the new SQL: a complete guide by J. Milton
    a must for SQL but not easy reading

    (2) Books by CJ Date like A guide to the SQL standard.
    very informative

    (3) Books on DB2 by IBM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center