I am so new this help is great. Please be patient with me, but, where should I put it? I am writing a package within oracle portal and should it go in the spec or the body and where within this? Here is the code for my procedure that saves the discussion forum message:
PROCEDURE save_message (
i_parent_msg IN messages.msg_parent%TYPE,
i_subject IN messages.msg_subject%TYPE,
i_msg_body IN messages.msg_body%TYPE,
)
IS
author member.username%TYPE
:= forum_users.get_current_us
BEGIN
IF forum_users.get_current_us
THEN
forum_users.login_form (
NULL,
'You must login to post a message'
);
ELSE
INSERT INTO messages (
msg_id,
msg_parent,
msg_author,
msg_subject,
msg_body
)
VALUES (
message_seq.nextval,
i_parent_msg,
author,
i_subject,
i_msg_body
);
COMMIT;
IF i_parent_msg = 0
THEN
current_forum_list;
ELSE
view_message (i_parent_msg);
END IF;
END IF;
EXCEPTION
WHEN OTHERS
THEN
htp.print ('<body bgcolor=white>');
htp.print ('<b>An error has occurred<p>');
END;
I know this probably easy for you, but very difficult for me at the time, THANK YOU!
Main Topics
Browse All Topics





by: ploubierPosted on 2005-11-02 at 07:00:10ID: 15208266
You have to create your own sequence first :
CREATE SEQUENCE message_seq
MINVALUE 1
MAXVALUE 9999999
START WITH 1
INCREMENT BY 1;
Then you'll be able to execute the insert statement above, or select the next value using dual :
SELECT message_seq.nextval FROM dual;