oracle数据库语法法错误

sql语句创建时,报错:第一行:“GO”附近有语法错误?sqlserver2000的器中的SQL界面“!”执行后包上述错误。
--------------------------------------
很可能是go之前一句语句应该有问题.你不贴出来,不好确定MySQL 1064错误原因及解决办法_数据库技术_Linux公社-Linux系统门户网站
你好,游客
MySQL 1064错误原因及解决办法
来源:Linux社区&
作者:kpiss
MySQL 1064错误意思是说我的SQL语法错误,然后显示错误的具体位置。
查看待更新的内容,以及执行跟新的php语句。
php语句如下:
if(!$handle= @fopen($fname, "r")) {echo "open $fname failed\n";};& &$str="";$count=0;&$ins="INSERT INTO pydot_g (id, aauthor) VALUES";& & while(($buf=fgets($handle, 1000)) !== false){& & & & & & list($id,$field) = explode("#",$buf);& &$str .= sprintf('(%d,'%s'),',$id,$field);& &$count++;&}& & &$str.="(')";&$dup="ON DUPLICATE KEY UPDATE aauthor=VALUES(aauthor);";&$sql=$ins.$str.$&//echo $sql."\n";&if(!mysql_query($sql)) &{echo "mysql failed\n";&echo mysql_errno() . ": " . mysql_error() . "\n";}&&fclose($handle);&mysql_close($link);
待跟新的内容如下:
1320#CarryDream Int'l Co., Ltd.1321#ES APP Group1322#app4uu
从中可以发现待跟新的内容中还有单引号&&&,使用的sql语句中打印的字段也含有单引号,两者产生了冲突。
所以解决的办法就是,将sql中的语句改为使用双引号&&&,至此问题得以解决。
MySQL错误:ERROR ): use near 'order&解决&
MySQL报错ERROR 1044 ERROR ):
相关资讯 & & &
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款查看: 2414|回复: 11
谁帮我看看这个存储过程哪里的语法错误?
论坛徽章:2
如题,新手写存储,请教我的这个存储过程哪里的语法有错误?
OR REPLACE PROCEDURE p1 (prin out VARCHAR2) IS
num NUMBER (10) ;
tempprin VARCHAR2 (200) ;
& & & & num := 0 ; SELECT
& & & & & & & & COUNT (*) INTO num
& & & & FROM
& & & & & & & & t1 ;
& & & & IF num & 10000 THEN
& & & & BEGIN
& & & & & & & & tempprin := '不足1W行数据' ; prin :=
& & & & END ;
& & & & END
& & & & IF ;
& & & & IF 10000 &= num & 20000 THEN
& & & & BEGIN
& & & & & & & & tempprin := '1W至2W行数据' ; prin :=
& & & & END ;
& & & & END
& & & & IF ;
& & & & IF num &= 20000 THEN
& & & & BEGIN
& & & & & & & & tempprin := '大于等于2W行数据' ; prin :=
& & & & END ;
& & & & END
& & & & IF ;
& & & & END ;
运行的时候报错如下:
[Err] ORA-24344: success with compilation error
论坛徽章:119
You can simplfy the pl/sql code.
create or replace procedure p1(prin out varchar2)
select case
& && && && && &&&when count*) & 10000 then
& && && && && && && && && &&&'&10000'
& && && && && &&&when count(*) &= 10000 and count(*) & 20000 then
& && && && && && && && && &&&'&= 10000 and & 20000'
& && && && && && &else
& && && && && && && && && && &'&=20000'
& && && && && && & end
& && && && && && & into prin
& && &from& &t1;
认证徽章论坛徽章:282
IF 10000 &= num & 20000 THEN
IF num&=10000 and num & 20000 THEN
论坛徽章:2
bell6248 发表于
You can simplfy the pl/sql code.
[SQL]create or replace procedure p1(prin out varchar2)
select case
& && && && && &&&when count*) & 10000 then
& && && && && && && && && &&&'小于1W'
& && && && && &&&when count(*) &= 10000 and count(*) & 20000 then
& && && && && && && && && &&&'1W至2W'
& && && && && && &else
& && && && && && && && && && &'大于2W行数据'
& && && && && && & end
& && && && && && & into prin
& && &from& &t1;
[Err] ORA-24344: success with compilation error
还是报错了。
C:\Users\hu\Desktop\QQ截图46.png
论坛徽章:4
IF&&THEN 后边不要&&加 BEGIN END ,直接 IF 。。THEN 。。 END IF;
论坛徽章:119
hucan1987 发表于
[SQL]create or replace procedure p1(prin out varchar2)
After executing the command &show err& in sql*plus, you can correct the error
论坛徽章:12
你的begin end 有点多
论坛徽章:1
if then elsif then&&end if
论坛徽章:1
IF 10000 &= num & 20000 THEN
编译都不能通过
求职 : 认证徽章论坛徽章:35
LS说的都是 ,这个排版看得也是好辛苦.
itpub.net All Right Reserved. 北京皓辰网域网络信息技术有限公司版权所有    
 北京市公安局海淀分局网监中心备案编号: 广播电视节目制作经营许可证:编号(京)字第1149号mysql5.5.23 TYPE=InnoDB语法错误
mysql5.5.23 TYPE=InnoDB语法错误
CREATE TABLE IF NOT EXISTS `ad_aXXXX_test_delete` (
`payment` double(15,4) default '0.0000',
`createdatetime` timestamp NOT NULL DEFAULT ' 00:00:00',
PRIMARY KEY
(`aspid`,`date`)
) TYPE=InnoDB;
You have an error in your SQL check the manual that corresponds to your MySQL server version for the right syntax to use near 'type=InnoDB'
在MYSQL5.5及以后版本中type=InnoDB 由ENGINE=InnoDB &代替。
由于5.5默认的存储引擎就是InnoDB,因此去掉这个属性不会有影响。
(window.slotbydup=window.slotbydup || []).push({
id: '2467140',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467141',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467142',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467143',
container: s,
size: '1000,90',
display: 'inlay-fix'
(window.slotbydup=window.slotbydup || []).push({
id: '2467148',
container: s,
size: '1000,90',
display: 'inlay-fix'

我要回帖

更多关于 数据库存储过程语法 的文章

 

随机推荐