Click to See Complete Forum and Search --> : Can Someone help me with the logic for this Procedure


epsonC84
03-24-2006, 01:46 AM
Ok, i know im suppose to create a procedure with 3 parms, i did that my problem is knowing what im suppose to do in my Anomyous block once this is created.

Here are the instructions

Procedure Rent_SP takes in 3 parms, id, member_id, and inv_id. It adds a new record to the rental table. It should also update the movie inv, which is movie_qty column of the movie table.

Procedure return_sp takes in 2 parms, movie and member. Based on the indicated values it identifies rental record from the rental table and records date in the check_date column. It also needs to update movie inventory in the movie table.

Any help with logic will help, thanks.

LKBrwn_DBA
03-24-2006, 09:47 AM
Homework? :rolleyes:

Try coding something yourself and we may help you debug. :D

gandolf989
03-24-2006, 02:20 PM
Homework? :rolleyes:

Try coding something yourself and we may help you debug. :D


I believe that we have already helped you with this homework assignment. If you keep getting other people to do your work you will never learn. :rolleyes: Code this in pieces. Get the first requirement and write code that will do this, and then add a little more. You should also look at PL/SQL Best Practices by Stephen Feuerstein. This will give you more concrete examples on writing good code.

WilliamR
03-24-2006, 07:50 PM
Ok, i know im suppose to create a procedure with 3 parms, i did that my problem is knowing what im suppose to do in my Anomyous block once this is created.
Since you have already created the procedure, why are you listing the processing requirements for it, and why is the title of the thread "Can Someone help me with the logic for this Procedure?"

Do you want help in writing the procedure that you've already got, or in calling it from an anonymous block?

epsonC84
03-24-2006, 08:07 PM
Since you have already created the procedure, why are you listing the processing requirements for it, and why is the title of the thread "Can Someone help me with the logic for this Procedure?"

Do you want help in writing the procedure that you've already got, or in calling it from an anonymous block?


Your right, i need help writing the block. Those are the instructions, and i have no clue how to start it

epsonC84
03-24-2006, 08:14 PM
I believe that we have already helped you with this homework assignment. If you keep getting other people to do your work you will never learn. :rolleyes: Code this in pieces. Get the first requirement and write code that will do this, and then add a little more. You should also look at PL/SQL Best Practices by Stephen Feuerstein. This will give you more concrete examples on writing good code.


thanks for the book reference sir. I'll have to check it out.

WilliamR
03-25-2006, 06:32 AM
BEGIN
rent_sp(123, 456, 789);
return_sp(456, 123);
END;
You may need to set up some test data (a member with ID = 123, etc).