Block properties [message #178603] |
Wed, 21 June 2006 14:55 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
nunoandrecorreia
Messages: 11 Registered: March 2006 Location: Portugal
|
Junior Member |
|
|
Hi.
I want to retrieve all the item'n names from a block dinamicaly, e.g., make a prodecure that has a IN parameter that is the name of the data block and just with that gets all the itens names from the block! I have searched in the documentation and I did not found anything to do that! Even the Get_Block_Property has nothing similar. Just a method to get the first and last item name's...
Is this possible to do??
Thanks
Nuno André
|
|
|
Re: Block properties [message #178631 is a reply to message #178603] |
Thu, 22 June 2006 00:42 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
jowahl
Messages: 82 Registered: May 2006
|
Member |
|
|
i'm using a procedure like this:
DECLARE
p_block_name CONSTANT VARCHAR2(32) := 'TEST_BLOCK';
v_block_id BLOCK;
v_item_id ITEM;
v_item_name VARCHAR2(32);
v_block_item_name VARCHAR2(65);
v_item_list VARCHAR2(2000);
BEGIN
v_block_id := FIND_BLOCK(p_block_name);
IF ID_NULL(v_block_id) THEN
RAISE NO_DATA_FOUND;
END IF;
--
v_item_name := GET_BLOCK_PROPERTY(v_block_id, FIRST_ITEM);
v_block_item_name := p_block_name||'.'||v_item_name;
--
LOOP
v_item_id := FIND_ITEM(v_block_item_name);
IF ID_NULL(v_item_id) THEN
EXIT;
END IF;
--
IF v_item_list IS NULL THEN
v_item_list := v_item_list || ',';
END IF;
--
v_item_list := v_item_list || v_item_name;
--
v_item_name := GET_ITEM_PROPERTY(v_item_id, NEXTITEM);
v_block_item_name := p_block_name||'.'||v_item_name;
END LOOP;
--
MESSAGE(v_item_list);PAUSE;
--
END;
|
|
|