开发者

why Boolean Data type are not working in MySQL?

I am using MySQL 5.5 and i linked it with my ASP.net Application .

i added a dataset to link my application within the MySQL stored procedure !!!

the problem is when i call any stored procedure which contains BOOLEAN like this one :

CREATE DEFINER=`root`@`localhost` PROCEDURE `SpCatDetailsDML`(
    ParDetDescription TEXT,
    ParDetDescriptionAR TEXT,
    ParPrice INT,
    ParCreatedOn DATETIME,
    ParDisplayOrder INT,
    ParAllowDisplay BOOLEAN,
    ParPictureID BIGINT,
    ParShowTypeID BIGINT
)
BEGIN-- INSERT --
    INSERT INTO cms.tbcatdetails(CatID,CustomerID,DetTitle,DetTitleAR,ShoertDesc,ShoertDescAr,DetD开发者_JAVA技巧escription,
                                 DetDescriptionAR,Price,CreatedOn,DisplayOrder,AllowDisplay,PictureID,ShowTypeID) 
    VALUES (ParCatID,ParCustomerID,ParDetTitle,ParDetTitleAR,ParShoertDesc,ParShoertDescAr,ParDetDescription,
            ParDetDescriptionAR,ParPrice,ParCreatedOn,ParDisplayOrder,ParAllowDisplay,ParPictureID,ParShowTypeID);
END

when i add this stored procedure to my dataset it will show me a warning becaues th ParAllowDisplay data type which is Boolean!!

so any suggestions???


There is no Boolean data type in MySQL. Use TINYINT(1) instead.

See here http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html


weird, I see BOOL, BOOLEAN in the URL mentioned above. Never used them.

also, refer this post Which MySQL data type to use for storing boolean values

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜