MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Chris M. Oson Date:February 6 2001 8:02pm
Subject:RE: Boolean Datatype
View as plain text  
Maybe, but you could define a constant..


INSERT INTO logInfo2 (logID, ipAddress, boolVars) VALUES (null,
'', TRUE)

-----Original Message-----
From: Russ Davies [mailto:russ@stripped]
Sent: Tuesday, February 06, 2001 11:44 AM
To: Oson, Chris M.; mysql@stripped
Subject: Re: Boolean Datatype

Thanks for the suggestion, but this would still mean converting the data
type from within ASP (the 'True' type) down to a char ('T') would it not?

It is more sensical than using 1/0 but still involves the same number of

Russ Davies

----- Original Message -----
From: "Oson, Chris M." <CHRIS.M.OSON@stripped>
To: <russ@stripped>; <mysql@stripped>
Sent: Tuesday, February 06, 2001 6:36 PM
Subject: RE: Boolean Datatype

> Why not try using ENUM?
> You could setup your table like this:
> (
>     logID           INT NOT NULL UNIQUE,
>     ipAddress       VARCHAR(20) NOT NULL DEFAULT 'None',
>     boolVars        ENUM ('T', 'F') DEFAULT 'F'
> )
> SELECT ipAddress FROM logInfo2 WHERE boolVars = 'F';
> -----Original Message-----
> From: russ [mailto:russ@stripped]
> Sent: Tuesday, February 06, 2001 9:10 AM
> To: mysql@stripped
> Subject: Boolean Datatype
> Im new to the list, apologies if this has been asked before.
> Im developing a backend for a personal site ( using mySQL.
> The site is hosted on NT4 and has myODBC installed, I have some database
> access working, but I'm looking for a way to implement boolean types.
> Using Access/SQL server I can simple do an insert using SQL like the
> following (from within ASP):
> INSERT INTO tblMyTable (booleanField) VALUES (" & myBooleanVariant & ");"
> Unfortunately, mySQL doesn't appear to have a boolean datatype and myODBC
> doesn't seem to convert True/False to 1/0.
> The best solution I have so far is to use a TINYINT and change the
> True/False values within my ASP code to 1/0. This isn't perfect howevere
> its more code, more work for the server and far less readable. I also have
> to cast to boolean when I SELECT data from the mySQL database.
> Could anyone suggest a better way of implementing this, or am I missing
> something?
> I have done a Google search and searched the mySQL manual, but got
> Many thanks in advance of your efforts.
> Russ Davies
> ---------------------------------------------------------------------
> Before posting, please check:
>   (the manual)
>           (the list archive)
> To request this thread, e-mail <mysql-thread64373@stripped>
> To unsubscribe, e-mail
> <>
> Trouble unsubscribing? Try:
Boolean DatatypeRuss Davies6 Feb
RE: Boolean DatatypeChris M. Oson6 Feb
  • Re: Boolean DatatypeRuss Davies6 Feb
    • Re: Boolean DatatypeVivek Khera6 Feb
    • RE: Boolean DatatypeRoger Ramirez6 Feb
  • Re: Boolean DatatypeRuss Davies6 Feb
RE: Boolean DatatypeChris M. Oson6 Feb
  • Re: Boolean DatatypeRuss Davies6 Feb
  • Re: Boolean DatatypeMatt Friedman6 Feb
  • Re: Boolean DatatypeRuss Davies6 Feb
  • Re: Boolean DatatypeGregg Housh6 Feb
  • Re: Boolean DatatypeRolf Hopkins7 Feb
Re: Boolean Datatypebtjones6 Feb
Re: Boolean DatatypeGregg Housh6 Feb
Antwort: Boolean Datatypealexander.skwar7 Feb