Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Oracle Forms 6i Button Trigger

Status
Not open for further replies.

Hortong

Technical User
Feb 24, 2002
2
GB
Hi guys, ive just joined the forum and havent used one before - so please forgive me if i do anything wrong.

Im currently developing an Oracle form to do some basic datamining and have the following questions:

I have a button on one of my canvas's and when pressed i need it to:
1) Execute a SQL statement (possibly stored in a procedure) to populate a cursor.
2) Populate a designated block with the contents of this newly filled cursor.

Any feedback would be greatly appreciated. I have basic knowledge of forms and a reasonable understanding of oracle and pl/sql, so please be gentle with the level of techiness in your reply!!

Cheers, Greg
 
I think that you don't need to open a cursor and then populate a block with the content of it.
Simply use EXECUTE_QUERY built-in for populating your block. You can also modify where condition of the block by using Set_Block_Property() built-in - property DEFAULT_WHERE.
So in your When-Button-Pressed trigger there can be something like this:

DECLARE
vc_new_where VARCHAR2(500);
vc_old_where VARCHAR2(500):=Get_Block_Property('your_block',DEFAULT_WHERE);
BEGIN

<<testing some conditions>>

vc_new_where:='...some conditions...';
Set_Block_Property('your_block',DEFAULT_WHERE,vc_new_where);
EXECUTE_QUERY;
Set_Block_Property('your_block',DEFAULT_WHERE,vc_old_where);
END;

I hope this will be a little help for you.

Helena
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top