我是Hsql的新手,
我尝试运行脚本:
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'table') AND type in (N'U'))
BEGIN
DROP TABLE table
END ;
Hsql抱怨IF关键字:
Caused by: java.sql.SQLSyntaxErrorException: unexpected token: IF : line: 2
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
at org.hsqldb.jdbc.JDBCStatement.executeQuery(Unknown Source)
有人可以帮我吗?
答案 0 :(得分:0)
HSQLDB不支持这种过程语言。
试试这个:
DROP TABLE MYTABLE IF EXISTS