showing errors while creating stored procedure (pls-00103) [message #184483] |
Wed, 26 July 2006 14:33 |
sheharyararshad
Messages: 10 Registered: May 2006 Location: KUWAIT
|
Junior Member |
|
|
hello every one
can any one help me aout am creating a stored procedures and getting an error can any one tell me that what mistake i am doing......................
create or replace package depart_pkg is
procedure add_depart (deptno number,name varchar2:='shary',loc number:=123) is
BEGIN
insert into depart (DEPARTMENT_ID,DEPARTMENT_NAME,LOCATION_ID)
values(deptno,name,loc);
END add_depart;
procedure add_depart (name varchar2:='razi',loc number:=1234) is
BEGIN
insert into depart (DEPARTMENT_ID,DEPARTMENT_NAME,LOCATION_ID)
values(depart_sequence.nextval,name,loc);
END add_depart;
end depart_pkg;
it showing errors
pls-00103
plz help me out
take care bye
|
|
|
|
Re: showing errors while creating stored procedure (pls-00103) [message #184495 is a reply to message #184485] |
Wed, 26 July 2006 16:24 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Actually, code you provided should be a PACKAGE BODY, not its specification. This code (for itself) is OK. Complete code, though, should look like this:CREATE OR REPLACE PACKAGE depart_pkg
IS
PROCEDURE add_depart (
deptno NUMBER,
NAME VARCHAR2 := 'shary',
loc NUMBER := 123
);
PROCEDURE add_depart (NAME VARCHAR2 := 'razi', loc NUMBER := 1234);
END depart_pkg;
CREATE OR REPLACE PACKAGE BODY depart_pkg
IS
PROCEDURE add_depart (
deptno NUMBER,
NAME VARCHAR2 := 'shary',
loc NUMBER := 123
)
IS
BEGIN
INSERT INTO depart
(department_id, department_name, location_id
)
VALUES (deptno, NAME, loc
);
END add_depart;
PROCEDURE add_depart (NAME VARCHAR2 := 'razi', loc NUMBER := 1234)
IS
BEGIN
INSERT INTO depart
(department_id, department_name, location_id
)
VALUES (depart_sequence.NEXTVAL, NAME, loc
);
END add_depart;
END depart_pkg;
|
|
|
|
|