A text_io error: FRM-40735 causes ORA-302000 error
611286Dec 11 2007 — edited Dec 12 2007Hi,all:
I'm trying to get data into forms with the text_io package,
but I get the message: Unhandled Exception ORA-302000:
Can anyone help me to solve this problem, Thanks.
Here's my code:
1.WHEN-BUTTON-PRESSED
-------------------------------------------------------------------------------
DECLARE
out_file text_io.file_type;
line_bufer varchar2(80);
lv_strtmp varchar2(100);
lv_content varchar2(100);
errnum NUMBER := ERROR_CODE;
errtxt VARCHAR2(80) := ERROR_TEXT;
errtyp VARCHAR2(3) := ERROR_TYPE;
BEGIN
message('111',acknowledge);
out_file := text_io.fopen('/home/cn01278/abc.txt', 'w');
message('222',acknowledge);
text_io.put('123');
text_io.new_line;
text_io.put_line(out_file, 'abcd...');
text_io.fclose(out_file);
END;
2.ON-ERROR Trigger
-----------------------------------------------------------------------------------
DECLARE
errnum NUMBER := ERROR_CODE;
errtxt VARCHAR2(80) := ERROR_TEXT;
errtyp VARCHAR2(3) := ERROR_TYPE;
BEGIN
message('error:',acknowledge);
Message(errtyp||'-'||TO_CHAR(errnum)||': '||errtxt,acknowledge);
--:blk_text.txt_err := errtyp||'-'||TO_CHAR(errnum)||': '||errtxt;
text_io.fclose(out_file);
RAISE Form_Trigger_Failure;
END;
-----------------------------------------------------------------------------------
But when i press the button(use text_io package to write),
it raise an exception, and the error message as below:
FRM-40735: WHEN-BUTTON-PRESSED trigger raised unhandled exception ORA-302000.