Q
Problem solve Get help with specific problems with your technologies, process and projects.

Compilation errors in SQL*Plus stored procedure

I have a problem writing stored procedures in Oracle. I am using SQL*Plus to write. I typed ED at SQL prompt and entered the following in my procedure..

create or replace procedure ppp(v1 INTEGER) as DECLARE begin end; /

Then I saved the file and entered / at prompt. Then it gave me this warning: Procedure created with compilation errors. Please help!
DECLARE is not necessary when CREATING a stored procedure. DECLARE is only necessary for anonymous PL/SQL block.

So you should write:

CREATE OR REPLACE PROCEDURE PPP(vi INTEGER) IS

BEGIN
   Null;  -- Just to get PPP compiled
  -- Write your statements here.
END;

Secondly, you should try to create your procedures in a file (say ppp.sql) and from SQL*Plus prompt execute the file like this.

Please make sure to include the / slash in your file.

SQLPLUS>@ppp.sql

If you still get errors, make sure to type SHOW ERRORS so you can debug.

Dig Deeper on Using Oracle PL-SQL

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close