Q
qiangzai
Unregistered / Unconfirmed
GUEST, unregistred user!
我想在程序中运行以下SQL语句,判断oracle中的‘GL’用户是否存在,如果存在就将其删除,但是始终有错误出现,请各位高手救命
--------------程序--------------------
DECLARE
IS_GL_EXIST NUMBER;
BEGIN
SELECT COUNT(*) INTO :IS_GL_EXIST FROM USER$ WHERE NAME='GL';
IF IS_GL_EXIST>0 THEN
DROP USER GL CASCADE;
END IF;
END;
--------------报错信息--------------------
PLS-00103: 出现符号 "DROP"在需要下列之一时:
begin case declare exit
for goto if loop mod null pragma raise return select update
while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge
<a single-quoted SQL string> pipe
--------------程序--------------------
DECLARE
IS_GL_EXIST NUMBER;
BEGIN
SELECT COUNT(*) INTO :IS_GL_EXIST FROM USER$ WHERE NAME='GL';
IF IS_GL_EXIST>0 THEN
DROP USER GL CASCADE;
END IF;
END;
--------------报错信息--------------------
PLS-00103: 出现符号 "DROP"在需要下列之一时:
begin case declare exit
for goto if loop mod null pragma raise return select update
while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge
<a single-quoted SQL string> pipe