Dynamic Block program unit?

From: Adam Hapworth <hap_at_mikomi.org>
Date: 21 Jan 2003 11:44:18 -0800
Message-ID: <a6cb04db.0301211144.4f929ecd_at_posting.google.com>



[Quoted] Hello All,

    I have a form that goes against our database and looks at 4 tables of the exact same strcutre. Each table has its own block in the form.  I have some procedures in the program units that do something for each of these blocks because I cannot seem to figure out a dynamic way around it. Each Program unit is tied to a specific block and the items inside are called with bind varaibles(:block1.item1). I was wondering if there was a way to pass the block name in as a varchar2 and then tie that to the items. I have tried getting the block id using Find_block() builtin but when I go to read the items it fails saying it can't find the item.

what I have in a very limited scope

procedure a
is
begin
:block1.item1 := 'foo';

end;

procedure b
is
begin
:block2.item1 := 'foo';

end;

What I would like to do is

procedure c(block_name in varchar2)
is
begin
block_name.item1 := 'foo';
end;

How would I go about doing something of this sort.

I know this may sound like a silly design but it is all I have to work with :(

Thanks
Adam Received on Tue Jan 21 2003 - 20:44:18 CET

Original text of this message