Exception NO_DATA_FOUND [message #625374] |
Tue, 07 October 2014 01:10 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](//www.gravatar.com/avatar/9807c59f4b66faa80f4f759abc7bac59?s=64&d=mm&r=g) |
Mayur Shinde
Messages: 60 Registered: August 2014 Location: Pune, Maharashtra
|
Member |
|
|
I am using below code to find string. If entered string not matched then cursor is pointing at last record. But i have to display message "No data found".
DECLARE
BEGIN
IF :BLOCK_TOOL.S_GRADE_DESC IS NULL THEN
ERR_MESSAGE('Please enter Grade Code OR Grade Description...');
SET_ITEM_PROPERTY('BLOCK_TOOL.S_GRADE_DESC',ENABLED,PROPERTY_TRUE);
GO_ITEM('BLOCK_TOOL.S_GRADE_DESC');
ELSE
BEGIN
GO_BLOCK('TRANSACTIONS_MST');
FIRST_RECORD;
LOOP
IF :TRANSACTIONS_MST.GRADE_DESC like '%'||:BLOCK_TOOL.S_GRADE_DESC||'%'
OR :TRANSACTIONS_MST.GRADE_CD LIKE '%'||:BLOCK_TOOL.S_GRADE_DESC||'%' THEN
EXIT;
END IF;
NEXT_RECORD;
EXIT WHEN :SYSTEM.LAST_RECORD='TRUE';
END LOOP;
END;
END IF;
END;
|
|
|
|
|
|
|
|
|
|
|
Re: Exception NO_DATA_FOUND [message #625554 is a reply to message #625553] |
Fri, 10 October 2014 01:22 ![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/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
WHEN-BUTTON-PRESSED trigger should know where you are (i.e. row #1) - to do that, create a parameter (or a global variable) which will hold that information.
When you push the button for the second time, code would
go_record(:parameter.previous_row);
next_record;
loop
Check whether item in current row contains information you are looking for.
If it does, stop (i.e. exit the loop) and save the position.
If not, go to the next record.
end loop
[Updated on: Fri, 10 October 2014 01:22] Report message to a moderator
|
|
|
|
|
|