|
|
|
Re: FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-06502 [message #519970 is a reply to message #519966] |
Wed, 17 August 2011 23:48 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/165181.jpg) |
khouw
Messages: 2 Registered: July 2011 Location: Indonesia
|
Junior Member |
![stephanie_khouw](/forum/theme/orafaq/images/yahoo.png)
|
|
Here's my button's WHEN-BUTTON-PRESSED trigger
BEGIN
Go_Block('Student_Awd');
First_Record;
LOOP
Ins_Student_Award(:student_awd.awd_typ_desc, :head_blk.stu_id, :head_blk.semester, :head_blk.awd_id, :student_awd.stu_awd_point, :student_awd.stu_awd_date);
Down;
EXIT WHEN :student_awd.awd_typ_id IS NULL;
END LOOP;
Commit;
Clear_Message;
Clear_All;
END;
there are two blocks: head_blk for header where i get the student id, and student_awd where i can fill student's awards date and his achievement
Here's my Ins_Student_Award procedure
CREATE OR REPLACE PROCEDURE DBA.Ins_Student_Award(p_awd_id IN NUMBER, p_stu_id IN VARCHAR2, p_smt IN VARCHAR2, p_lan_id IN NUMBER, p_point IN NUMBER, p_date DATE) IS
v_Dummy CHAR(1);
v_Id NUMBER;
BEGIN
SELECT DISTINCT 'X' INTO v_Dummy
FROM stu_awd
WHERE stu_id = p_stu_id AND stu_awd_smt = p_smt AND awd_typ_id = p_awd_id AND stu_awd_id = p_lan_id;
UPDATE stu_awd
SET stu_awd_point = p_point, stu_awd_date = p_date
WHERE stu_id = p_stu_id AND stu_awd_smt = p_smt AND awd_typ_id = p_awd_id AND stu_awd_id = p_lan_id;
EXCEPTION
WHEN No_Data_Found THEN
SELECT NVL(MAX(stu_awd_id), 0) INTO v_Id
FROM stu_awd
WHERE stu_id = p_stu_id AND stu_awd_smt = p_smt AND awd_typ_id = p_awd_id;
v_Id := v_Id + 1;
INSERT INTO stu_awd(awd_typ_id, stu_id, stu_awd_smt, stu_awd_id, stu_awd_point, stu_awd_date)
VALUES(p_awd_id, p_stu_id, p_smt, v_id, p_point, p_date);
END Ins_Stu_Langgar;
/
-- edit
I already found the cause of that error. It's because the text properties of text item for stu_awd_id (:head_blk.awd_id) is set to Date. It must be set to Char. Careless me >.<
Nevermind about this thread. Moderator please delete this thread. I'm really sorry >.<
[Updated on: Thu, 18 August 2011 02:03] Report message to a moderator
|
|
|
|
Re: FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-06502 [message #570039 is a reply to message #570031] |
Mon, 05 November 2012 00:46 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
It is kind of difficult to guess what might be wrong. See if the following helps.
OracleORA-06502: PL/SQL: numeric or value errorstring
Cause: An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).
Action: Change the data, how it is manipulated, or how it is declared so that values do not violate constraints.
|
|
|