Home » Developer & Programmer » Forms » Question: Non database block item value passing to query up records
Question: Non database block item value passing to query up records [message #529104] Fri, 28 October 2011 13:10 Go to next message
newuser01
Messages: 4
Registered: October 2011
Location: east coast
Junior Member
Version information:
Forms [32 Bit] Version 10.1.2.3.0 (Production)
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

My question is pretty straight forward.
When an user enters a value in a field of a Screen, I want to query up the next screen records based on that user input value in the previous screen.
I am missing that link here.

The previouse screen is based on a control block i.e.
Q_EMP
items- Q_EMP.emp_id, Q_EMP.FY, Q_EMP.hire_flag.

Thanks for your help in advance.


Re: Question: Non database block item value passing to query up records [message #529106 is a reply to message #529104] Fri, 28 October 2011 13:18 Go to previous messageGo to next message
Littlefoot
Messages: 21817
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Looks like a master-detail form. If both blocks were database blocks, no problem - Wizard would do that for you. As the "master" block is a control block, you'll have to do that manually.

One option is to set detail block's item value in PRE-QUERY trigger (for example: :detail_block.emp_id := :master_block.emp_id) and execute query in a detail block.

Another option is to use SET_BLOCK_PROPERTY and create its DEFAULT_WHERE or ONETIME_WHERE clause and execute query again.

The third option would be to manually populate detail block (but that's quite tiresome).

There might be other options, but I'd stick to first two I suggested.
Re: Question: Non database block item value passing to query up records [message #529107 is a reply to message #529104] Fri, 28 October 2011 13:19 Go to previous messageGo to next message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
Not sure what you mean by "I am missing that link here."

What I do when I have a control block and want to use it as a base for querying a database block, I "build" a WHERE clause based on the columns and values, then make it the DEFAULT_WHERE of the block you want to query, go to the block and EXECUTE_QUERY.

I am sure there are other ways.
Re: Question: Non database block item value passing to query up records [message #529109 is a reply to message #529107] Fri, 28 October 2011 13:41 Go to previous message
newuser01
Messages: 4
Registered: October 2011
Location: east coast
Junior Member
Thanks for your input. I will go with the default where_clause.
Previous Topic: Oracle Forms 10g on Windows 7 problem
Next Topic: How to use group by command in forms 6i
Goto Forum:
  


Current Time: Sun Aug 11 07:42:46 CDT 2024