Hi,
I'm using Oracle 9i. I am trying to create a procedure that automatically enters today's date into the attendance table when the student's name is passed to the procedure. Here are the 2 tables I am using:
Student table:
Student_id First_name Last_name Sex Title
Attendance Table:
Student_id Att_date
I have the following procedure which I have created that requires the attendance date to be passed as a parameter:
CREATE OR REPLACE PROCEDURE ATTEND(FNAME VARCHAR2, LNAME VARCHAR2, DATEATTEND DATE) AS
BEGIN
UPDATE ATTENDANCE
SET ATT_DATE = DATEATTEND
WHERE STUDENT_ID =
(SELECT A.STUDENT_ID
FROM STUDENT S, ATTENDANCE A
WHERE S.STUDENT_ID = A.STUDENT_ID AND S.FIRST_NAME = FNAME AND S.LAST_NAME = LNAME);
END;
I have looked at SQL functions such as SYSDATE but do not really understand how to use them and have performed a search on this forum but again didn't find anything to use.
I was thinking that maybe SET ATT_DATE = DATEATTEND might be changed so that DATEATTEND is replaced with a built-in function.
If anybody has a solution to my problem please post. Thanks.