我正在使用MySQL 5.5,并将其与我的ASP.net应用程序链接。
我添加了一个数据集,用于在MySQL存储过程中链接我的应用程序!!!
问题是当我调用任何包含BOOLEAN的存储过程时,就像这样:
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,DetDescription,
DetDescriptionAR,Price,CreatedOn,DisplayOrder,AllowDisplay,PictureID,ShowTypeID)
VALUES (ParCatID,ParCustomerID,ParDetTitle,ParDetTitleAR,ParShoertDesc,ParShoertDescAr,ParDetDescription,
ParDetDescriptionAR,ParPrice,ParCreatedOn,ParDisplayOrder,ParAllowDisplay,ParPictureID,ParShowTypeID);
END
当我将此存储过程添加到我的数据集时,它会向我显示一个警告,因为ParAllowDisplay数据类型是布尔值!!
所以任何建议???
答案 0 :(得分:1)
MySQL中没有布尔数据类型。改为使用TINYINT(1)
。
请参阅此处http://dev.mysql.com/doc/refman/5.5/en/numeric-type-overview.html
很奇怪,我在上面提到的网址中看到了BOOL, BOOLEAN
。从未使用过它们。
也请参阅此帖 Which MySQL data type to use for storing boolean values