Re: HELP! ! - Restricted Queries with FORMS 4.5
Date: 1995/12/03
Message-ID: <1995Dec3.074144.22964_at_lafn.org>#1/1
In a previous article, jnz_at_qnet.com (John Zeigler) says:
>I have a form with a canvas-view consisting of 2 blocks in a
>master-detail relationship. To do a query, I have a LOV button on an
>item in the master block. It returns the selected LOV into the field.
>I then want to do a restricted query using the value in this item. Forms
>gives me an "unable to perform this function" error when I try to do an
>execute query. I then inserted a clear_block(no_validate) right after
>going to this master block (before doing a LOV). I still get the same
>error. How can I do a restricted query using a LOV to populate the item
>in the master block I want to query on? Thanks
After you get the value returned by the LOV, build a WHERE clause which incorporates that value, and execute a SET_BLOCK_PROPERTY command to change the DEFAULT_WHERE to the new constraint clause. It would look something like this...
[...]
GO_BLOCK('MY_BLOCK'); -- If not already there
-- Clear block -- Get value from LOV -- Use value to write a 'WHERE' clause to the variable 'new_where_clause'SET_BLOCK_PROPERTY('MY_BLOCK', DEFAULT_WHERE, new_where_clause); EXECUTE_QUERY;
[...]
Also, be sure that the item is query-enabled on the property sheet.
If you have the master-detail relationship properly set up, and haven't messed with the triggers which Oracle creates to service the relationship, you should have a populated master block and, if applicable, a populated detail block as well after you execute the query.
Karla Johnson
-- +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= Karla Johnson | Internet: karjohn_at_kincyb.com S/W Engr., Informax Data Systems | or ab803_at_lafn.org Los Angeles, California | Standard disclaimers, ad nauseamReceived on Sun Dec 03 1995 - 00:00:00 CET