Adsenseコード

2017-10-26

【MySQL】テーブルのストレージエンジンを設定する方法




■以下のエラーが発生


<エラーメッセージ>
「Error Code: 1253. COLLATION 'utf8_unicode_ci' is not valid for CHARACTER SET 'binary'」
<ファンクションの定義>
CREATE DEFINER=`root`@`%` FUNCTION `SUMPlanMM`(projectCode VARCHAR(7) CHARACTER SET utf8, memberName VARCHAR(150) CHARACTER SET utf8, date date) RETURNS double
BEGIN
    DECLARE w DOUBLE DEFAULT 0.0;
    DECLARE c CURSOR FOR SELECT SUM(p.WORKLOAD) FROM aries.ANLY_MemberPlanWorkLoad__c p
        WHERE p.PROJECTCODE__C = @projectCode COLLATE utf8_unicode_ci
        AND p.NAME__C = @memberName COLLATE utf8_unicode_ci
        AND p.RESULTYM__C > @date;
    OPEN c;
    FETCH c INTO w;
RETURN w;
END




■以下を実行


CREATE TABLE `YoteiKosu__c` (
  `ID` char(18) COLLATE utf8_unicode_ci NOT NULL,
  `ISDELETED` tinyint(4) DEFAULT NULL,
  `NAME` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `CREATEDDATE` datetime DEFAULT NULL,
  `CREATEDBYID` char(18) COLLATE utf8_unicode_ci DEFAULT NULL,
  `LASTMODIFIEDDATE` datetime DEFAULT NULL,
  `LASTMODIFIEDBYID` char(18) COLLATE utf8_unicode_ci DEFAULT NULL,
  `SYSTEMMODSTAMP` datetime DEFAULT NULL,
  `LASTACTIVITYDATE` datetime DEFAULT NULL,
  `KAIHATUANKEN__C` char(18) COLLATE utf8_unicode_ci DEFAULT NULL,
  `RESULTYM__C` date DEFAULT NULL,
  `KADOYOTEIKOSU__C` double(8,2) DEFAULT NULL,
  `YOJITSU__C` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `PARTNERMEMBER__C` char(18) COLLATE utf8_unicode_ci DEFAULT NULL,
  `KADOZANTIME__C` int(11) DEFAULT NULL,
  `KADOCOST__C` decimal(18,1) DEFAULT NULL,
  `KADOYOTEI__C` double(8,2) DEFAULT NULL,
  `KEY1__C` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `YOUINSEI__C` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `MEMO__C` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `YOTEIKOSU__C` double(8,2) DEFAULT NULL,
  `JISSEKIKOSU__C` double(8,2) DEFAULT NULL,
  `COMPLETEDATE__C` date DEFAULT NULL,
  `GENKA__C` decimal(18,1) DEFAULT NULL,
  `ANKEN_YOJITSU__C` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ANKEN_TANTOU__C` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `TANTOU_ANKEN__C` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `PRJCODE__C` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
  `ENGINEERIDAPP__C` char(18) COLLATE utf8_unicode_ci DEFAULT NULL,
  `YOTEIESTIMATEDCOST__C` decimal(18,1) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;




■解決の候補


グローバルとセッションで値がずれてる?
http://atsuizo.hatenadiary.jp/entry/2016/08/23/095537







0 件のコメント:

コメントを投稿