PLS-00201: identifier 'CTX_DDL' must be declared [message #672674] |
Tue, 23 October 2018 07:14  |
 |
Sania Fatimi
Messages: 1 Registered: October 2018
|
Junior Member |
|
|
Hi friends,
I am trying to create a procedure as below, but getting error as -PLS-00201: identifier 'CTX_DDL' must be declared
CREATE or replace PROCEDURE try_ctx
IS
BEGIN
CTX_DDL.CREATE_POLICY ('test_policy', 'CTXSYS.AUTO_FILTER');
END;
I am unable to understand, how to resolve this error?Please help.
Thankyou
|
|
|
|
|
|
Re: PLS-00201: identifier 'CTX_DDL' must be declared [message #672680 is a reply to message #672674] |
Tue, 23 October 2018 22:23  |
 |
Barbara Boehmer
Messages: 9005 Registered: November 2002 Location: California, USA
|
Senior Member |
|
|
The following is just a demonstration of what has already been said, using user test. You will need to substitute your actual user. You can also grant privileges from CTXSYS or from a user with DBA privileges.
-- reproduction of problem:
SCOTT@orcl_12.1.0.2.0> CREATE USER test IDENTIFIED BY test
2 /
User created.
SCOTT@orcl_12.1.0.2.0> GRANT CREATE SESSION TO test
2 /
Grant succeeded.
SCOTT@orcl_12.1.0.2.0> GRANT CREATE PROCEDURE TO test
2 /
Grant succeeded.
SCOTT@orcl_12.1.0.2.0> CONNECT test/test
Connected.
TEST@orcl_12.1.0.2.0> CREATE or replace PROCEDURE try_ctx
2 IS
3 BEGIN
4 CTX_DDL.CREATE_POLICY ('test_policy', 'CTXSYS.AUTO_FILTER');
5 END;
6 /
Warning: Procedure created with compilation errors.
TEST@orcl_12.1.0.2.0> SHOW ERRORS
Errors for PROCEDURE TRY_CTX:
LINE/COL ERROR
-------- -----------------------------------------------------------------
4/3 PL/SQL: Statement ignored
4/3 PLS-00201: identifier 'CTX_DDL' must be declared
-- solution:
TEST@orcl_12.1.0.2.0> CONNECT ctxsys/ctxsys
Connected.
CTXSYS@orcl_12.1.0.2.0> GRANT EXECUTE ON CTXSYS.CTX_DDL TO test
2 /
Grant succeeded.
CTXSYS@orcl_12.1.0.2.0> CONNECT test/test
Connected.
TEST@orcl_12.1.0.2.0> CREATE or replace PROCEDURE try_ctx
2 IS
3 BEGIN
4 CTX_DDL.CREATE_POLICY ('test_policy', 'CTXSYS.AUTO_FILTER');
5 END;
6 /
Procedure created.
TEST@orcl_12.1.0.2.0> SHOW ERRORS
No errors.
|
|
|