Home » SQL & PL/SQL » SQL & PL/SQL » Warning: Procedure created with compilation errors
Warning: Procedure created with compilation errors [message #234087] Sun, 29 April 2007 15:23 Go to next message
oracle1234ab
Messages: 2
Registered: April 2007
Junior Member
Hi All

I am new to store procedures
I have created a procedure to add a new dept in the dept table
I am getting the following message. Can someone help me or make me understand why this problem is coming

I code is

CREATE OR REPLACE PROCEDURE ADDNEWDEPT(
D_NO DEPTNO%TYPE,
D_NAME DNAME%TYPE,
D_LOC LOC%TYPE)
AS
BEGIN
INSERT INTO DEPT(DEPTNO,DNAME,LOC)
VALUES(D_NO,D_NAME,D_LOC);
END ADDNEWDEPT;


Thanks
Oracle1234ab

Re: Warning: Procedure created with compilation errors [message #234097 is a reply to message #234087] Mon, 30 April 2007 00:21 Go to previous messageGo to next message
Frank
Messages: 7901
Registered: March 2000
Senior Member
Hi, welcome to the forum.

oracle1234ab wrote on Sun, 29 April 2007 22:23

I am new to store procedures

Then please post in the Newbie forum.

To see what error you have type
show errors
right after you create your procedure.
Another way is
show errors prodedure addnewdept
Re: Warning: Procedure created with compilation errors [message #234116 is a reply to message #234097] Mon, 30 April 2007 01:35 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
The problem you have is probably the parameter declaration:
deptno, dname and loc are columns of dept. If you use %TYPE you need to prefix those column names by the table name. There are possibly more tables with deptno as column.

MHE
Re: Warning: Procedure created with compilation errors [message #234170 is a reply to message #234087] Mon, 30 April 2007 05:04 Go to previous messageGo to next message
Dipali Vithalani
Messages: 278
Registered: March 2007
Location: India
Senior Member
Hi,
the other thing might be, the variables used in query are having no values when they are used in insert query. Do you have any constraints like primary key, or not null on the fields used in the insert query? In such situations also error might be generated because they will be violated. So take care of them too..

Regards.
Re: Warning: Procedure created with compilation errors [message #234171 is a reply to message #234170] Mon, 30 April 2007 05:10 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
But those errors would not prevent successful compilation, right?

MHE
Re: Warning: Procedure created with compilation errors [message #234177 is a reply to message #234171] Mon, 30 April 2007 05:33 Go to previous messageGo to next message
Dipali Vithalani
Messages: 278
Registered: March 2007
Location: India
Senior Member
So take care of them [B]too[/B]..


Dear, You are correct, but He/She is newbies.
So i point out what i think would be helpful to him/her.
My intension was to out that thing only. You already told to do "Show Errors" to get the proper direction about error, so i did not repeat that thing..
Re: Warning: Procedure created with compilation errors [message #234270 is a reply to message #234177] Mon, 30 April 2007 11:59 Go to previous message
oracle1234ab
Messages: 2
Registered: April 2007
Junior Member
All

CREATE OR REPLACE PROCEDURE ADDNEWDEPT(
D_NO dept.DEPTNO%TYPE,
D_NAME dept.DNAME%TYPE,
D_LOC dept.LOC%TYPE)
AS
BEGIN
INSERT INTO DEPT(DEPTNO,DNAME,LOC)
VALUES(D_NO,D_NAME,D_LOC);
END ADDNEWDEPT;

Now it is worrking fine , I just added dept table name infront of the column name

Thanks
Oracle1234ab
Previous Topic: update statement behavior
Next Topic: Cursors.
Goto Forum:
  


Current Time: Wed Feb 12 07:11:12 CST 2025