在服务器上传存储过程时收到错误 [英] getting error when uploading stored procedure in server

查看:85
本文介绍了在服务器上传存储过程时收到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在服务器上传存储过程时出现此错误

错误



SQL查询:文档



CREATE PROCEDURE`sp_fetch_keyinformation_type_null`(intCoID int)BEGIN SELECT *

FROM keyinformation

WHERE TYPE IS NULL

AND CompanyID = intCoID;



MySQL说:文档

#1064 - 您的SQL语法有错误;请查看手册对应你的MySQL服务器版本,在第3行附近使用正确的语法



请帮帮我...

试试这个,



创建程序sp_fetch_keyinformation_type_null(IN intCoID int)

BEGIN

从keyInformation中选择*,其中TYPE为NOT NULL且CompanyID = intCoID

END







类型为非NULL,因为不存在条件为NULL和Compa的任何数据nyID = intCoID因为它总是返回0行。



希望这应该有效。


i get this error when uploading stored procedure in server
"Error

SQL query: Documentation

CREATE PROCEDURE `sp_fetch_keyinformation_type_null` ( intCoID int ) BEGIN SELECT *
FROM keyinformation
WHERE TYPE IS NULL
AND CompanyID = intCoID;

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3 "

please help me out...

解决方案

Try this,

CREATE PROCEDURE sp_fetch_keyinformation_type_null(IN intCoID int)
BEGIN
Select * from keyinformation where TYPE is NOT NULL and CompanyID=intCoID
END



Type is NOT NULL, because there don't exists any data with condition "NULL and CompanyID=intCoID" as it always returns 0 rows.

Hope this should work.


这篇关于在服务器上传存储过程时收到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆