Home » Developer & Programmer » Forms » retrieving dynamic values forms
retrieving dynamic values forms [message #513999] Thu, 30 June 2011 11:26 Go to next message
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 #514035 is a reply to message #513999] Thu, 30 June 2011 15:54 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Base your block on a stored procedure, perhaps?
Re: retrieving dynamic values forms [message #514112 is a reply to message #513999] Fri, 01 July 2011 09:34 Go to previous messageGo to next message
kalpataru
Messages: 72
Registered: January 2010
Location: INDIA
Member
hi Littlefoot,

i want write that procedure in forms and using that procedure i want to populate the grid(containing text items).


please reply...
Re: retrieving dynamic values forms [message #514140 is a reply to message #514112] Fri, 01 July 2011 14:29 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
A stored procedure, not a procedure that belongs to a form.
Re: retrieving dynamic values forms [message #514286 is a reply to message #514140] Sun, 03 July 2011 11:25 Go to previous messageGo to next message
kalpataru
Messages: 72
Registered: January 2010
Location: INDIA
Member
Hi Littlefoot,
yes a procedure that belongs to a form.

please reply..
Re: retrieving dynamic values forms [message #514299 is a reply to message #514286] Sun, 03 July 2011 13:47 Go to previous messageGo to next message
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 #514601 is a reply to message #514299] Tue, 05 July 2011 09:03 Go to previous messageGo to next message
kalpataru
Messages: 72
Registered: January 2010
Location: INDIA
Member
hi Littlefoot and cookiemonster,
ok tell me how can i populate the
data in forms using the database procedure.




please reply..
Re: retrieving dynamic values forms [message #514666 is a reply to message #514601] Tue, 05 July 2011 14:36 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It is quite well described in Forms' Help System so - take a look. You might also want to check this discussion (might give you some ideas).
Re: retrieving dynamic values forms [message #514798 is a reply to message #514666] Wed, 06 July 2011 09:18 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 #514815 is a reply to message #514799] Wed, 06 July 2011 11:40 Go to previous messageGo to next message
kalpataru
Messages: 72
Registered: January 2010
Location: INDIA
Member
how can i extract column names and values
from :oput_cur;

please reply..
Re: retrieving dynamic values forms [message #514832 is a reply to message #514815] Wed, 06 July 2011 13:30 Go to previous message
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?
Previous Topic: Access file from server via static ip at outside lan
Next Topic: help me errors about form
Goto Forum:
  


Current Time: Tue Sep 17 18:47:06 CDT 2024