problem with global value while inserting from calling form [message #333996] |
Tue, 15 July 2008 02:45 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
|
hello all,
im using global variable to get the username in global.abc .
but when im try to use that global.abc from another form it does nt work.
can u advise me how to overcome this problem ??
login form
when button pressed trigger
DECLARE
v_count NUMBER;
a NUMBER;
BEGIN
SELECT COUNT (*)
INTO v_count
FROM login
WHERE username = :login.username AND passwrd = :login.passwrd;
IF v_count = 1
THEN
:GLOBAL.abc := :login.username;
CALL_FORM ('enrollment');
ELSE
a := SHOW_ALERT ('ALERT_INVALID');
END IF;
EXCEPTION
WHEN OTHERS
THEN
a := SHOW_ALERT ('ALERT_LOGIN_ERROR');
END;
enrollment form
when button pressed trigger
DECLARE
v_status char(1) := 'N';
v_courseid number;
a number;
BEGIN
IF :exam_date IS NULL
THEN
MESSAGE ('enter the Exam date');
ELSIF :course IS NULL
THEN
MESSAGE ('select the coursename');
ELSIF :exam_paper IS NULL
THEN
MESSAGE ('select the exam paper');
END IF;
SELECT course_id
INTO v_courseid
FROM online_course
WHERE course = :block3.course
AND exam_paper = :block3.exam_paper;
if :exam_date > sysdate then
INSERT INTO onlin_enroll(exam_id, user_name, course_id, exam_date,enrollment_date, status)
VALUES(exa_id_seq.nextval, :global.abc, v_courseid, :exam_date,sysdate, v_status);
message(:global.abc);
COMMIT;
else
a:= show_alert('alert_exam');
end if;
exception
when others then
a:=show_alert('alert_error');
END;
thanks in advance
|
|
|
|
|
|
|
|
|