问题描述 :
SELECT distinct a.user_id INTO userID FROM authorization_record a WHERE a.open_id = openId AND a.auth_type = '5001'
错误如下:
[Err]1267- Illegal mixofcollations (utf8_unicode_ci,IMPLICIT)and(utf8_general_ci,IMPLICIT)foroperation'='
解决方法 :
将比较等式一边进行字符串转换,如改为“ CONVERT(b.fullCode USING utf8) COLLATE utf8_unicode_ci ”
SELECT distinct a.user_id INTO userID FROM authorization_record a WHERE a.open_id = CONVERT(openId USING utf8) COLLATE utf8_unicode_ci AND a.auth_type = '5001'
create procedure student()begin
select stu_no from student -- 加个分号
end
-- 如果加了分号还不行的话,提示的错误应该是
错误:PLS-00428: 在此 SELECT 语句中缺少 INTO 子句
原因是单独的一个select语句在存储过程中是不应该存在的,所以应该改成select stu_no into 的模式
create procedure student()
is
v_stu_no student.stu_no%TYE
begin
select stu_no into v_stu_no from student where rownum <= 1 -- 改成select into 字句
end
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)