Q: forms blocks, bind vars, multiple records

From: Malcolm Dew-Jones <yf110_at_vtn1.victoria.tc.ca>
Date: 16 Feb 2006 10:32:44 -0800
Message-ID: <43f4c54c$1_at_news.victoria.tc.ca>



Hello

[Quoted] This is the forms that comes with 10G

In the where clause of a data block I can refer to the items in other blocks as bind variables

	e.g. 
		data block CRITERIA
		item	   from_val
		item	   to_val

		data block MAIN_TABLE 
		where clause 
			col1 >= :criteria.from_val and
			col2 <= :criteria.to_val

Then I can go_block('MAIN_TABLE') and execute_query; to get the desired rows based on some user entered criteria.

What I want is to be able to have multiple rows in the critera block, (number of records displayed > 1) and have a query that utilizes all the "rows" of the criteria in the where clause.

Is there any smart way to do this, similar in simplicity to the above example, but accessing multiple sets of criteria? Ideally the maximum number of rows in the criteria would not be a fixed value.

I can define multiple rows for the criteria - the bind variables refer to the values in the row containing the text input cursor, which makes sense but doesn't obviously help here.

I guess I could save the criteria as a second table and then use something like "exists", or a join, but then the criteria has to save rows to the data base, and I need to define a new table instead of just some logic in a form.

Anyway, suggestions, or links to relevent documentation or examples would be appreciated. Received on Thu Feb 16 2006 - 19:32:44 CET

Original text of this message