0
Unterprogramm od Cursor 'ADD_student' ist in einer Paketspezifikation deklariert und muss im Paketkörper definiert werden. Ich habe es überprüft und ich weiß nicht, was vor sich geht.Unterprogramm od Cursor 'ADD_student' ist in einer Paketspezifikation deklariert und muss im Paketkörper definiert werden
Paketdeklaration:
create or replace PACKAGE students_package AS
PROCEDURE add_student(s_name STUDENTS.STUDENT_NAME%type,
s_surname STUDENTS.SURNAME%type,
s_pesel STUDENTS.pesel%type,
s_date STUDENTS.DATE_OF_BIRTH%type,
s_place STUDENTS.PLACE_OF_BIRTH%type,
s_behaviour STUDENTS.BEHAVIOR%type,
s_disease STUDENTS.TYPE_OF_DISEASE%type);
procedure delete_student(s_id students.student_id%type);
procedure edit_student(s_id STUDENTS.STUDENT_ID%type,
s_name STUDENTS.STUDENT_NAME%type,
s_surname STUDENTS.SURNAME%type,
s_pesel STUDENTS.pesel%type,
s_date STUDENTS.DATE_OF_BIRTH%type,
s_place STUDENTS.PLACE_OF_BIRTH%type,
s_behavior STUDENTS.BEHAVIOR%type,
s_disease STUDENTS.TYPE_OF_DISEASE%type);
END students_PACKAGE;
Körper:
create or replace PACKAGE BODY students_package AS
PROCEDURE add_student(s_name STUDENTS.STUDENT_NAME%type,
s_surname STUDENTS.SURNAME%type,
s_pesel STUDENTS.pesel%type,
s_date STUDENTS.DATE_OF_BIRTH%type,
s_place STUDENTS.PLACE_OF_BIRTH%type,
s_behavior STUDENTS.BEHAVIOR%type,
s_disease STUDENTS.TYPE_OF_DISEASE%type) IS
BEGIN INSERT INTO students(STUDENT_NAME,SURNAME,PESEL,DATE_OF_BIRTH,PLACE_OF_BIRTH,BEHAVIOR,TYPE_OF_DISEASE)
VALUES (s_name ,s_surname ,s_pesel ,s_date ,s_place ,s_behavior ,s_disease);
end add_student;
procedure edit_student(s_id STUDENTS.STUDENT_ID%type,
s_name STUDENTS.STUDENT_NAME%type,
s_surname STUDENTS.SURNAME%type,
s_pesel STUDENTS.PESEL%type,
s_date STUDENTS.DATE_OF_BIRTH%type,
s_place STUDENTS.PLACE_OF_BIRTH%type,
s_behavior STUDENTS.BEHAVIOR%type,
s_disease STUDENTS.TYPE_OF_DISEASE%type)is
BEGIN update students
set students.STUDENT_NAME=s_name,students.SURNAME=s_surname,students.PESEL=s_pesel,
students.DATE_OF_BIRTH=s_date,students.PLACE_OF_BIRTH=s_place,
students.BEHAVIOR=s_behavior,students.TYPE_OF_DISEASE=s_disease
where students.STUDENT_ID = s_id;
end edit_student;
procedure delete_student(s_id STUDENTS.STUDENT_ID%type) is
begin update students
set students.STUDENT_ID=null,students.SURNAME=null,students.PESEL=null, students.DATE_OF_BIRTH=null,
students.PLACE_OF_BIRTH=null, students.BEHAVIOR=null,students.TYPE_OF_DISEASE=null
where students.STUDENT_ID = s_id;
end delete_student;
END students_package;
Ich weiß nicht, was falsch ist.
Ich habe auch einen Trigger:
create or replace TRIGGER "STUDENTS_TRIGGER"
before insert on
STUDENTS
for each row begin :new.student_id := students_auto_incr.nextval;
end;
und sequention:
CREATE SEQUENCE "KONRAD"."STUDENTS_AUTO_INCR" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
immer noch das gleiche nach der Änderung:/ – snajperek130
LOOOOL es war ein Backspace! Mutter von **** – snajperek130