go_item dynamic [message #622265] |
Sat, 23 August 2014 23:38 |
|
hahaie
Messages: 194 Registered: May 2014
|
Senior Member |
|
|
hello,
my procedure is:
PROCEDURE GO_NEXT_ITEM_PRC (NUM NUMBER)IS
BEGIN
GO_ITEM('CONTROL_SEARCH_STKS.ITEM_CH_'||NUM+1);
END;
and call procedure:
DESCRIPTION:
name of items on CONTROL_SEARCH_STKS(BLOCK)is:ITEM_CH_1,ITEM_CH_2,ITEM_CH_3,ITEM_CH_4,...
but procedure have a error,why?What is the solution?
|
|
|
|
Re: go_item dynamic [message #622355 is a reply to message #622266] |
Mon, 25 August 2014 11:58 |
|
CraigB
Messages: 386 Registered: August 2014 Location: Utah, USA
|
Senior Member |
|
|
I'm really not sure I understand why you would need to write your own navigation procedure. The NEXT_ITEM(); built-in should be sufficient. In fact, based on the hierachical nature of Oracle Forms - the only time I've needed to over-ride the NEXT_ITEM functionality is when I have items in a canvas that are from different datablocks. When this occurs, you can simply code a Key-Next-Item to force navigation to the item you want.
With respects to your question, what is the compilation error? Without the error number/message - all we can do is guess why your procedure won't compile. Here is my best guess...the error is because the GO_ITEM() built-in can't process the concatenation of the next_item name. I suggest you store the full name of the Item in a variable and then use the variable in your GO_ITEM call rather than use a concatenation of the item name in the call. EG:
PROCEDURE GO_NEXT_ITEM_PRC (NUM NUMBER)IS
v_next_item VARCHAR2(65);
BEGIN
v_next_item := 'CONTROL_SEARCH_STKS.ITEM_CH_'||NUM+1;
GO_ITEM(v_next_item);
END;
Again, this is just a WAG - we need the compile error number/message!
Quote:DESCRIPTION:
name of items on CONTROL_SEARCH_STKS(BLOCK)is:ITEM_CH_1,ITEM_CH_2,ITEM_CH_3,ITEM_CH_4,...
If your items are sequential and follow each other in the correct order in the Object Navigator, then just use the NEXT_ITEM() built-in.
Craig...
|
|
|