retrieving dynamic values forms [message #513999] |
Thu, 30 June 2011 11:26 |
kalpataru
Messages: 72 Registered: January 2010 Location: INDIA
|
Member |
|
|
hi all,
how can i use this below example in forms builder 10gr2
var oput_cur refcursor
var tabname varchar2(30)
exec :tab_name := 'dual';
begin
open :oput_cur for 'select * from ' || :tabname;
end;
/
print oput_cur
how can i get the values from oput_cur into forms grids(containing text items).
please reply...
|
|
|
|
|
|
|
Re: retrieving dynamic values forms [message #514299 is a reply to message #514286] |
Sun, 03 July 2011 13:47 |
cookiemonster
Messages: 13938 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Littlefoot is telling you that you need to base the datablock on a Database procedure. That'll allow you to do this.
Otherwise you're going to have to loop over the cursor and populate all the items manually.
|
|
|
|
|
Re: retrieving dynamic values forms [message #514798 is a reply to message #514666] |
Wed, 06 July 2011 09:18 |
kalpataru
Messages: 72 Registered: January 2010 Location: INDIA
|
Member |
|
|
Hi Littlefoot,
i know it is there but suppose my data in
:oput_cur after executing the below statement in forms 10g
begin
open :oput_cur for 'select * from ' || :tabname;
end;
i want to how to retrieving datas from :oput_cur
one by one into the text items of a data block.
please reply..
|
|
|
Re: retrieving dynamic values forms [message #514799 is a reply to message #514798] |
Wed, 06 July 2011 09:32 |
cookiemonster
Messages: 13938 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
You could loop over the cursor. For each row in the cursor fetch each column into the corresponding datablock item. Then go to the next record in the datablock. Of course you would need to know the names of the columns in :tabname.
What exactly are you hoping to achieve here?
|
|
|
|
Re: retrieving dynamic values forms [message #514832 is a reply to message #514815] |
Wed, 06 July 2011 13:30 |
|
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
I think that you need to know columns you select from a table, and create corresponding form items. It means that it requires quite a lot of manual labour. "SELECT * FROM some_table" is most times a bad idea. You should name all columns you are selecting; that way, it is easy to follow the code, especially in cases when tables are modified (new columns added and similar).
What problem are you solving here, anyway? Are you trying to create an "universal" form, that would be able to work with any table's data? Something like (already existing) GUI tools (such as Oracle SQL Developer, TOAD etc.) that do that job just fine in their data grid editors?
|
|
|