Getting error when I cancel file selection in file open dialogue [message #447897] |
Thu, 18 March 2010 06:36 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
prachij593
Messages: 266 Registered: May 2009
|
Senior Member |
|
|
I have created the below stored procedure and calling the procedure in when-button-pressed trigger.
Problem here is that when I cancel the file selection in file open dialogue box its raising exception.
How can avoid this?
PROCEDURE TEST
IS
buffer_lines client_text_io.file_type;
v_outputstr VARCHAR2 (32767);
p_delimiter VARCHAR2 (10) := '","';
v_transaction_no VARCHAR2 (10);
BEGIN
fname := CLIENT_GET_FILE_NAME('C:\', NULL,'Text File (*.*)|*.*|','Open:',OPEN_FILE,true);
buffer_lines := client_text_io.fopen ( fname, 'r');
LOOP
BEGIN
client_text_io.get_line (buffer_lines, v_outputstr);
v_outputstr := REPLACE (v_outputstr, '"');
v_transaction_no := SUBSTR (v_outputstr, 1, INSTR (v_outputstr, ',', 1) - 1);
UPDATE order
SET status_date = SYSDATE
WHERE tran_nbr = TRIM (TO_CHAR (v_transaction_no)) ;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
client_text_io.fclose (buffer_lines);
EXIT;
END;
END LOOP;
COMMIT;
EXCEPTION
WHEN OTHERS
THEN
message_popup ('Error ' || SQLERRM, 'E', TRUE);
RAISE form_trigger_failure;
END;
|
|
|
|
|
|