Stored Procedure - PLS-00307: too many declaration [message #3639] |
Wed, 09 October 2002 11:52  |
Alexander
Messages: 109 Registered: May 2000
|
Senior Member |
|
|
Hi... I was able to run this package on Oracle 9i but I now need for it to work on Oracle 8.1.7.... When I try to compile the package body I get the error:
PLS-00307: too many declaration of 'TO_CHAR' match this call
********************** here is the complete code ****
set serveroutput on
drop sequence student_sequence;
create sequence student_sequence
start with 1
increment by 1;
drop table students;
create table students (
StudentSequenceNumber int NOT NULL,
student_id int null,
department varchar2(50) null,
courses varchar2(50) null,
description varchar2(4000) null,
PRIMARY KEY (StudentSequenceNumber));
drop package StudentClassPackage;
create or replace package StudentClassPackage as
/* ********************************************************************** */
/* ********************************************************************** */
Procedure AddStudent (p_StudentId in students.student_id%type,
p_Department in students.department%type,
p_course in students.courses%type,
p_description in students.description%type,
p_FinalId OUT varchar2,
p_Message OUT varchar2);
/* ********************************************************************** */
/* ********************************************************************** */
Procedure RemoveStudent (p_StudentId in students.student_id%type,
p_FinalId OUT varchar2,
p_Message OUT varchar2);
eND StudentClassPackage;
/
create or replace package body StudentClassPackage as
Procedure AddStudent (p_StudentId in students.student_id%type,
p_Department in students.department%type,
p_course in students.courses%type,
p_description in students.description%type,
p_FinalId OUT varchar2,
p_Message OUT varchar2) IS
BEGIN
Insert into students
(StudentSequenceNumber, student_id, department, courses, description)
values
(student_sequence.NEXTVAL, p_Studentid, p_department, p_course, p_description)
returning StudentSequenceNumber into p_FinalId;
p_Message := 'Inserted value: ' || to_char(p_FinalId);
COMMIT;
EXCEPTION
WHEN OTHERS THEN
p_Message := 'Could not insert value: ' || to_char(p_FinalId);
/* Rollback our changes */
ROLLBACK;
END AddStudent;
/* ********************************************************************** */
/* ********************************************************************** */
Procedure RemoveStudent (p_StudentId in students.student_id%type,
p_FinalId OUT varchar2,
p_Message OUT varchar2) IS
BEGIN
delete from students where student_id = p_StudentId;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
p_FinalId := to_char(p_StudentId);
p_Message := 'Could not insert value: ' || to_char(p_StudentId);
/* Rollback our changes */
ROLLBACK;
END RemoveStudent;
END StudentClassPackage;
/
|
|
|
|
|