Home » SQL & PL/SQL » SQL & PL/SQL » PLS-00103: error (oracle 10g)
PLS-00103: error [message #316152] Wed, 23 April 2008 23:54 Go to next message
qaziasad
Messages: 1
Registered: April 2008
Location: chicago
Junior Member
1) I connect as user hr/password
then run the following script for procedure

create or replace procedure hr.create_db_link as
BEGIN
eXECUTE IMMEDIATE 'CREATE database link testdblink5';
end;

grant execute on create_db_link to user2;

2) Now i log in as different user(user2). and run the script below:

create or replace procedure CREATE_db_link_others as
BEGIN
eXECUTE IMMEDIATE 'grant create database link to hr';
exec hr.create_db_link;
eXECUTE IMMEDIATE 'revoke create database link from hr';
end;

This script gives the following error:
LINE/COL ERROR
-------- -----------------------------------------------------------------
4/7 PLS-00103: Encountered the symbol "hr" when expecting one
of the following:
:= . ( @ % ;
The symbol ":=" was substituted for "hr" to continue.



3) When I run the command(below) standalone, the above script(2) which gives the error, in case below, there is no error.

SQL> exec hr.create_db_link;
Re: PLS-00103: error [message #316157 is a reply to message #316152] Thu, 24 April 2008 00:31 Go to previous messageGo to next message
kecd_deepak
Messages: 52
Registered: December 2007
Member
Hello qaziasad,
EXEC is used to execute a procedure from SQL*Plus environment.
When u call a procedure from another procedure u just write its name with parameter list(if parameter exists)without EXEC.

Regards
Deepak
Re: PLS-00103: error [message #316158 is a reply to message #316152] Thu, 24 April 2008 00:32 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
exec hr.create_db_link;

"exec" is a SQL*Plus command not a PL/SQL one.
Remove that.

Regards
Michel
Re: PLS-00103: error [message #316290 is a reply to message #316152] Thu, 24 April 2008 08:44 Go to previous message
joy_division
Messages: 4642
Registered: February 2005
Location: East Coast USA
Senior Member
qaziasad wrote on Thu, 24 April 2008 00:54
1)
create or replace procedure hr.create_db_link as
BEGIN
eXECUTE IMMEDIATE 'CREATE database link testdblink5';
end;



What is the purpose of this?
Previous Topic: Mutating Trigger
Next Topic: DBMS_OUTPUT
Goto Forum:
  


Current Time: Thu Dec 08 00:34:30 CST 2016

Total time taken to generate the page: 0.15113 seconds