Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Other Topics > Computer Technical Help
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #11  
Old 03-07-2007, 11:00 AM
ohgeetee ohgeetee is offline
Senior Member
 
Join Date: Jun 2004
Location: ATL
Posts: 840
Default Re: Oracle database help?

Is this his interpretation or what he was given? many things seem out of place. a class having many teachers seems odd, unless they arent differentiating between multiple english 101's i guess. If this is the case, then the class enrollment table seems out of place, because I assume there would be no reason for a student to have 2 english 101 classes.
Reply With Quote
  #12  
Old 03-07-2007, 12:23 PM
dcasper70 dcasper70 is offline
Senior Member
 
Join Date: Mar 2005
Location: Life Has Come From My Balls
Posts: 3,526
Default Re: Oracle database help?

wporter pm'd me this:
[ QUOTE ]
here are my tables and their primary and foriegn keys.

the first item is the table name - then the PK, then the FKs

students - student_id ce_id, dm_id
class_enrollment - ce_id class_id
class - class_id call_number
course_catalog - call_number
faculty - fac_id
faculty_class - fc_id fac_id, class_id
major - major_id
declared_major - dm_id major_id
department - dept_id major_id


[/ QUOTE ]

I made the diagram directly from the above info.
Reply With Quote
  #13  
Old 03-09-2007, 04:00 PM
wporter wporter is offline
Senior Member
 
Join Date: Jun 2004
Location: Auburn
Posts: 159
Default Audit Log table necessary?

i need a trigger to fire when the user changes the students grade, and i need it to record the old grade, and the sysdate. do i need to make an audit log table? and then have the records save there? thanks
Reply With Quote
  #14  
Old 03-14-2007, 06:16 PM
IndyGuy IndyGuy is offline
Senior Member
 
Join Date: Apr 2005
Location: Indianapolis
Posts: 406
Default Re: Audit Log table necessary?

[ QUOTE ]
i need a trigger to fire when the user changes the students grade, and i need it to record the old grade, and the sysdate. do i need to make an audit log table? and then have the records save there? thanks

[/ QUOTE ]

Yes. Assuming you still need help with this, even though it's a few days old...

From what's posted above, you'll create a trigger for update of the (for example) course_roster table (or wherever you're storing the grades, as it's not clear from above). In the trigger, you'll simply have a in insert statement into a log table.
The following statement does that, although it obviously depends on the structure of your tables. Note the use of the :OLD and :NEW variables to refer to the changing values.

create or replace trigger TRIG_GRADES_LOG
after update on COURSE_ROSTER
for each row
declare
begin
insert into COURSE_ROSTER_LOG(course_no, student_id, old_grade, new_grade, change_date) values (:OLD.course_no, :OLD.student_id, :OLD.grade, :NEW.grade, sysdate);
end;


Normally, I'd not do someone's homework for them, but I felt like an Oracle refresher would be a nice change of pace for me.
Reply With Quote
  #15  
Old 03-14-2007, 10:39 PM
wporter wporter is offline
Senior Member
 
Join Date: Jun 2004
Location: Auburn
Posts: 159
Default Re: Audit Log table necessary?

thanks alot, that really helps. i think i see where this trigger is going now.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:59 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.