| Añadido el dia 29/07/2012
- NmqKWONJTjwEkV dice:
I have this PL/SQL procedure and I got it wonikrg. When I try to execute the stored program with values, it doesn't work. How do I know it won't work? Well, I have a dbms_output.put_line() in the program and it should output something back but it doesn't. In TOAD, it says the procedure completed successfully (PL/SQL procedure successfully completed.). But when I run it with the software that comes with Oracle XE (Not SQL Plus, the web application sql editor), it displays this error message (ORA-00900: invalid SQL statement)I am using this line to execute the procedure program.execute ex3b_new_membership(2, Check', 100, 104);Here is the procedure definition line:ex3b_new_membership(duration_in in number, payment_type_in in varchar2, club_id_in in number, customer_id_in in number)Here is the code for the membership procedure:create or replace procedure ex3b_new_membership(duration_in in number, payment_type_in in varchar2, club_id_in in number,customer_id_in in number) IScursor membership_cursor isselect membership_id, membership_date, feefrom club_membership, mountain_clubswhere club_membership.club_id = club_id_inand customer_id = customer_id_inand mountain_clubs.club_id = club_membership.club_id;membership_row membership_cursor%rowtype;BEGINfor membership_row in membership_cursorloopINSERT INTO club_membership VALUES (membership_sequence.nextval, SYSDATE, duration_in, ex3b_membership_amount(duration_in, membership_row.fee), payment_type_in, club_id_in, customer_id_in); dbms_output.put_line(membership_row.membership_id||' ||membership_row.membership_date||' || ex3b_membership_amount(duration_in, membership_row.fee));end loop;endHere is the function that is called in the program to return the amount that the membership will cost. The duration is how many months a membership is for, hence, 2 = 2 month membership Check is the payment method. The club_id identifies the club that you want membership to, and the customer_id identifies the customer that wants a membership at a club.