Unanswered: Want date entered automatically(newbie)
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_id First_name Last_name Sex Title
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
SET ATT_DATE = DATEATTEND
WHERE STUDENT_ID =
FROM STUDENT S, ATTENDANCE A
WHERE S.STUDENT_ID = A.STUDENT_ID AND S.FIRST_NAME = FNAME AND S.LAST_NAME = LNAME);
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.
try inserting the getDate function or whatever oracle uses as its date function into your stored procedure. Rather than pass the value from a server side page, you should be able to simply insert the current date (using the date function) for that value...