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_prop erty(block _name,DEFA ULT_WHERE) ;
open_forms(query_forms,blo ck_name);/ /invoke the query forms return :global.where_clause
where_clause:=:global.wher e_clause;
Where_clause:=add_where_co ndition(wh ere_clause );//invoke my own function
Set_block_property(block_n ame,defaul t_where,wh ere_clause );
Execute_query;
If :system.cursor_record=0 then
Message(“no record found”)
End if;
End;
pls give me a answer
best regard!
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_prop
open_forms(query_forms,blo
where_clause:=:global.wher
Where_clause:=add_where_co
Set_block_property(block_n
Execute_query;
If :system.cursor_record=0 then
Message(“no record found”)
End if;
End;
pls give me a answer
best regard!
ASKER
hi,
sorry!
my question is how can i get the field name, field type,field display name from the pass paramenter(data block).
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('BLOCKN AME', First_Item) to get the name of the first item in the block.
Then
Get_Item_Property('BLOCKNA ME.ITEMNAM E', NextItem)
will return the name of the next item in the block, etc.
Get_Item_Property('BLOCKNA ME.ITEMNAM E', Item_Type) returns the type, etc.
Open the online help to look for more properties delivered by Get_Item_Property() built-in function
Get_Block_Property('BLOCKN
Then
Get_Item_Property('BLOCKNA
will return the name of the next item in the block, etc.
Get_Item_Property('BLOCKNA
Open the online help to look for more properties delivered by Get_Item_Property() built-in function
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?
Is this what you are trying to do: design a flexible Oracle Form that can dynamically adjust to select from any table?
ASKER
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!
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Since there aren't any answers (to yout post) yet, I think nobody else is getting what you want.