Link to home
Start Free TrialLog in
Avatar of zhangrui
zhangrui

asked on

how to develop an available query froms

hi,all
I want to develop an Available query forms,it support many tables with parameters, and Only need to post one parameter(datablock) .
I design it like this (but it's pity the window diagram model can't put here) the canvas includes two droplist,one for field the other for compare, a text,a text list and three button(add,delete,ok)I want it perform the following task:
1. select the fields name from the droplist ‘field’. The field name comes from the datablock(pass by paramenter)
2. select compare sign from the droplist ‘compare’.
3. input the condition in the ‘result’
4. select “and” or “or” conn sign
WHEN u press the ‘add’ button one record input above will add to the text list. When u press ‘delete’ button a selected record will be deleted from the text tlist. When u press ‘ok’ button it will return a :global.where_clause expression..

The following is a procedure invoke the query forms :
Procedure invoke_query(block_name varchar2) is
Where_clause ,ls_old_sql varchar2(200);
Begin
Ls_old_sql:=get_block_property(block_name,DEFAULT_WHERE);
open_forms(query_forms,block_name);//invoke the query forms return :global.where_clause
where_clause:=:global.where_clause;
Where_clause:=add_where_condition(where_clause);//invoke my own function
Set_block_property(block_name,default_where,where_clause);
Execute_query;
If :system.cursor_record=0 then
Message(“no record found”)
End if;
End;

pls give me a answer
best regard!
Avatar of venkotch
venkotch

Personally, I do not understand what are you asking for.
Since there aren't any answers (to yout post) yet, I think nobody else is getting what you want.
Avatar of zhangrui

ASKER

hi,
   sorry!
     my question is how can i get the field name, field type,field display name from the pass paramenter(data block).
If you have datablock name as parameter, you can use
Get_Block_Property('BLOCKNAME', First_Item) to get the name of the first item in the block.
Then
Get_Item_Property('BLOCKNAME.ITEMNAME', NextItem)
will return the name of the next item in the block, etc.
Get_Item_Property('BLOCKNAME.ITEMNAME', Item_Type) returns the type, etc.
Open the online help to look for more properties delivered by Get_Item_Property() built-in function
Avatar of Mark Geerlings
If I understand your question correctly, you would like to design an Oracle Form with just one block that can dynamically select from any table, and dynamically select just the columns the user wants at the time.  That may be possible in Oracle Forms, but it certainly is not the way that most people use Oracle Forms.  It also may not be easy, and may cause performance problems, since almost every query will then be different.  This will prevent the Oracle server from being able to re-use SQL statements.

Is this what you are trying to do: design a flexible Oracle Form that can dynamically adjust to select from any table?
Hi,markqueer:
   That's it.U understand my mean very well.But I don't perform it well.It's only  a design schema(frame) of mine. Give me a hand pls!
ASKER CERTIFIED SOLUTION
Avatar of Mark Geerlings
Mark Geerlings
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial