Using 2nd table in execute_query [message #476159] |
Tue, 21 September 2010 15:57 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
coolguy01
Messages: 64 Registered: August 2006
|
Member |
|
|
I have a form screen based on a table say Table A. This screen is populated from a value selected on the previous screen. I take the value in the previous screen and create a onetime where clause and use the execute_query on table A to populate the screen. But what i need is if the value provided is not found in Table A then i have to look up an other table say table B and populate the screen based on Table B. Now how can i do it since the screen is based on Table A and if that value is not found i have to get values from the second table.
Thanks
|
|
|
|
|
Re: Using 2nd table in execute_query [message #476222 is a reply to message #476171] |
Wed, 22 September 2010 03:04 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Three most obvious methods that spring to mind are:
1) Make the block a non-database block and populate from a cursor in when-new-form-instance. Normally I recommend against this but as long as you don't want to be able to modify the data it's probably the simplest way.
2) Create 2 datablocks. Have the items from one sit in the exact same place as the equivalent items from the other (or use two canvases if you prefer). Run a query in WNFI to see if there are matches in the first table. If there aren't make it's items invisible, go to the 2nd block and execute_query there.
3) Base block on procedure.
It might also be possible if you base the block on a parameterised view - seach asktom for examples of this (the views, you won't find anything specific on forms but once you've got a view returning data the way you want basing a block on it is easy).
I would suggest though that if the data from the 2 tables is that interchangable then they probably ought to be combined into 1 table.
|
|
|