Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql 关键字';结束';_Sql_Sap Ase - Fatal编程技术网

Sql 关键字';结束';

Sql 关键字';结束';,sql,sap-ase,Sql,Sap Ase,有人能帮我吗 我不知道为什么以下SQL会出现语法错误: if not exists (select 1 from sysobjects where type='U' and name='pg_result') create table pg_result (parent char(10), child char(10)) else delete from pg_result end if 我得到以下错误: [错误]脚本行:141-146 关键字“end”附近的语法不正确 消息

有人能帮我吗

我不知道为什么以下SQL会出现语法错误:

if not exists (select 1 from sysobjects where type='U' and name='pg_result')
    create table pg_result (parent char(10), child char(10)) 
else
    delete from pg_result
end if
我得到以下错误:

[错误]脚本行:141-146

关键字“end”附近的语法不正确

消息:156,级别:15,状态:2

服务器:SYBDEV,第5行

我在跑步:

Adaptive Server Enterprise/12.5.4/EBF 16785 ESD#10/p/Sun_svr4/OS 5.8/ase1254/2159/64位/FBO/Mon 2009年11月2日13:08:08

有什么想法吗?

试试看

if not exists (select 1 from sysobjects where type='U' and name='pg_result')
    create table pg_result (parent char(10), child char(10)) 
else
    delete from pg_result

看 试试看

if not exists (select 1 from sysobjects where type='U' and name='pg_result')
    create table pg_result (parent char(10), child char(10)) 
else
    delete from pg_result


如果您不使用
开始,您不需要
结束

如果您不使用
开始