DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  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.


Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links