Home » Developer & Programmer » Forms » search for item contain this value (form 6i)
icon9.gif  search for item contain this value [message #674188] Wed, 09 January 2019 12:25 Go to next message
malik_gambour
Messages: 2
Registered: January 2019
Junior Member




function search_for_item (i number, blockname varchar2 , itemname varchar2) return VARCHAR2 IS
/* This function to search for item which has the value i*/
cur_blk VARCHAR2(40);
cur_itm VARCHAR2(80);
orig_itm VARCHAR2(80);
first_itm VARCHAR2(80);
wrapped BOOLEAN := FALSE;
found BOOLEAN := FALSE;
Exit_Procedure EXCEPTION;
bl block;
it item;
/*
** Local function returning the name of the item after the
** one passed in. Using NVL we make the item after the
** last one in the block equal the first item again.
*/

BEGIN
cur_blk :=blockname;
bl:=find_block(cur_blk);
it:=find_item(itemname);
first_itm := Get_Block_Property(cur_blk, FIRST_ITEM );
orig_itm :=itemname;
cur_itm := The_Item_After(cur_blk,orig_itm);
/*
** Loop until we come back to the item name where we started
*/
WHILE (orig_itm <> cur_itm) LOOP
/*
** If required item, set the found flag and exit procedure
*/
message(i);
message(i);
IF name_in(cur_itm) =i THEN
message('the item is'||cur_itm);
message('the item is'||cur_itm);
found := TRUE;
return cur_itm;
RAISE Exit_Procedure;
END IF;
/*
** Setup for next iteration

*/
cur_itm := The_Item_After(cur_blk,cur_itm);
END LOOP;
/*197
** If we get here we wrapped all the way around the
** block's item names
*/
wrapped := TRUE;
RAISE Exit_Procedure;
EXCEPTION
WHEN Exit_Procedure THEN
/*
** If we found a required item and we didn't come back
** to the item we started in, then navigate there
*/
IF found AND NOT wrapped THEN
Go_Item(cur_blk||'.'||cur_itm);
return 'Not found';
END IF;

END;
if have this function I want to send the value it gives me the item that contain it every time I call it gives me those errors:







FRM-40105: Unable to resolve reference to item %s.
FRM-41056: Cannot find Block: invalid ID.
Re: search for item contain this value [message #674189 is a reply to message #674188] Wed, 09 January 2019 12:34 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Indent the code, use code tags and align the columns in result.
If you don't know how to format the code, learn it using SQL Formatter.

[Updated on: Wed, 09 January 2019 12:59]

Report message to a moderator

Re: search for item contain this value [message #674204 is a reply to message #674189] Thu, 10 January 2019 03:39 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
You need to do some basic debugging to work out which line is throwing the error.
Either run the form in debug mode or add extra message calls.
If you're not seeing any of the messages you already have then the error is happening before the first current message call - so put in extra messages before that.

Once you know which line is throwing the error use messages to determine the values of any variables/parameters being used on that line.
At that point you'll likely find the problem is fairly obvious.
Re: search for item contain this value [message #674250 is a reply to message #674204] Mon, 14 January 2019 02:02 Go to previous messageGo to next message
malik_gambour
Messages: 2
Registered: January 2019
Junior Member
Thank you for reply yes I put some message and when I put it in trigger it work without error
Re: search for item contain this value [message #674251 is a reply to message #674250] Mon, 14 January 2019 03:29 Go to previous messageGo to next message
cookiemonster
Messages: 13917
Registered: September 2008
Location: Rainy Manchester
Senior Member
And if you now remove the messages does it carry on working?
Re: search for item contain this value [message #674254 is a reply to message #674250] Mon, 14 January 2019 10:57 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
malik_gambour wrote on Mon, 14 January 2019 03:02
Thank you for reply yes I put some message and when I put it in trigger it work without error
Making a minuscule change and then removing it has the effect for a proper recompile. Sometimes, that's all it takes to fix the odd explainable error.
It's possible a simple compile_all would have corrected the issue too.
Was this forma maybe converted from a previous version?

I have a feeling though that there is something more going on here than just putting in messages fixed the issue.
Previous Topic: How to Find Oracle Reports Server name in Oracle reports 12c
Next Topic: are express edition of Oracle Forms & Oracle Weblogic Server Available.
Goto Forum:
  


Current Time: Thu Mar 28 16:13:33 CDT 2024