Home » SQL & PL/SQL » SQL & PL/SQL » PLS-00103: Found symbol " CREATE ", HELP !!!!!!!!
PLS-00103: Found symbol " CREATE ", HELP !!!!!!!! [message #35787] Tue, 16 October 2001 03:10 Go to next message
André V. B.
Messages: 3
Registered: October 2001
Junior Member
I am with problem in procedure when has commands " CREATE " or " GRANT
", the following error appears, which would be the solution?

ERROR : "

PLS-00103: Found symbol " CREATE " when one of the following symbols was waited:

begin declare exit for goto if loop mod null pragma raise
return select update while <an identifier>
<

"

CODE : "

CREATE OR REPLACE PROCEDURE PR_CRIA_USUARIOS IS

XOBJETO VARCHAR2(40);

--CURSORES
CURSOR CUR_USUARIO IS
SELECT ID_USUARIO FROM GA_USUARIO;

BEGIN
--CRIA ROLE
CREATE ROLE ROLE_NOVOS_USUARIOS NOT IDENTIFIED;

--PERMISSÕES
GRANT SELECT ANY TABLE TO ROLE_NOVOS_USUARIOS;
GRANT INSERT ANY TABLE TO ROLE_NOVOS_USUARIOS;
GRANT UPDATE ANY TABLE TO ROLE_NOVOS_USUARIOS;
GRANT DELETE ANY TABLE TO ROLE_NOVOS_USUARIOS;
GRANT EXECUTE ANY PROCEDURE TO ROLE_NOVOS_USUARIOS;

--CRIA USUÁRIOS/PERMISSÕES
OPEN CUR_USUARIO;
LOOP
FETCH CUR_USUARIO INTO XOBJETO;
EXIT WHEN CUR_USUARIO%NOTFOUND;

--USUARIO
CREATE USER XOBJETO IDENTIFIED BY XOBJETO DEFAULT ROLE ROLE_NOVOS_USUARIOS;

--PERMISSÕES
GRANT CONNECT TO XOBJETO;
--GRANT ROLE_NOVOS_USUARIOS TO XOBJETO;
END LOOP;
CLOSE CUR_USUARIO;

END PR_CRIA_USUARIOS;


"

----------------------------------------------------------------------
Re: PLS-00103: Found symbol " CREATE ", HELP !!!!!!!! [message #35790 is a reply to message #35787] Tue, 16 October 2001 07:15 Go to previous message
Suresh Vemulapalli
Messages: 624
Registered: August 2000
Senior Member
you cant use CREATE,GRANT statements inside stored procedure the way you were using. Instead you cann execute those statements using DBMS_SQL package or EXECUTE IMMEDIATE.

SURESH

----------------------------------------------------------------------
Previous Topic: dates and count
Next Topic: Insufficient privileges !?
Goto Forum:
  


Current Time: Sat May 25 02:19:16 CDT 2024