Home » SQL & PL/SQL » SQL & PL/SQL » creating a procedure problems.
creating a procedure problems. [message #4425] Sat, 07 December 2002 15:36 Go to next message
billy
Messages: 9
Registered: March 2002
Junior Member
I am trying to create a procedure named UPDATE_ENROLLMENT that recieve a sudent ID and course section Id and input parameters name CURRENT_S_ID AND CURRENT_C_SEC_ID. This procedure inputs the S_ID and C_SEC_ID values into the ENROLLMENT table. I can't figure out how to start this out. This is what I have so far, but I know it isn't correct, please help.

CREATE OR REPLACE PROCEDURE UPDATE_ENROLLMENT
(CURRENT_S_ID IN ENROLLMENT_S_ID%TYPE) IS

BEGIN

UPDATE ENROLLMENT
SET C_SEC_ID = CURRENT_C_SEC_ID
WHERE S_ID = CURRENT_S_ID
COMMIT;
END;
/
Re: creating a procedure problems. [message #4426 is a reply to message #4425] Sun, 08 December 2002 04:34 Go to previous message
Lisa
Messages: 31
Registered: September 2000
Member
I think u r on the right track.As long as u simply want to modify the values in the Enrollment table.
I've modified the syntax.Hope this is what u meant.

CREATE OR REPLACE PROCEDURE UPDATE_ENROLLMENT
(CURRENT_S_ID IN
ENROLLMENT.S_ID%TYPE,
CURRENT_C_SEC_ID IN ENROLLMENT.C_SEC_ID%TYPE) IS

BEGIN

UPDATE ENROLLMENT
SET C_SEC_ID = CURRENT_C_SEC_ID
WHERE S_ID = CURRENT_S_ID;
COMMIT;
END;
Previous Topic: regarding tablespace size
Next Topic: linefeed in a column
Goto Forum:
  


Current Time: Thu May 16 15:30:33 CDT 2024