Default_where
Hi all
Here's my dilemma:
I have a form (form1.block1), which is a "select only' in table X. In the case of update, I call a different form (form2.block2), leaving form1.block1 open in the background, which will arrive at the same table X as form1.block1.
The problem is that when I update a record in form2.block2, the record is not updated in the previous, since form1 remains open and without change, (form1.block1) form when I close or save the record. I tried all possible ways to collect the default_where and run the first form without success.
Any help would be greatly appretiated.
JP
I'll ask the obvious question... Why you open a second form to perform an update when you could simply perform the update of the first form? It's not logical for me.
If you do it this way, then I suggest that you set a global variable to return to Form1 and Form2 (in a trigger when-window-activated) check the value of your overall and clear and re - interrogate Form1. Don't know why you'd need the Form2 DEFAULT_WHERE since you have already interviewed in Form1 - values should not be the same after the update was done in Form2? If they are not, makes me a little nervous.
Perhaps you could give us a little more background in the approach that you use, and why you need to do things in this way. Then, we can offer you the best suggestions.
Craig...
Tags: Oracle Development
Similar Questions
-
Hello
I developed a form with two blocks.
The first - block of non - database contains the criteria.
Database of the other - block-displays the records according to the inserted.
Also, there is a button that executes the query criteria.
The code of the BUTTON WHEN PRESSED is as follows:
declare
v_where varchar2 (3000);
Start
v_where: = null;
go_block ('EKKREMOTHTES_AIT_TSG');
clear_block (no_validate);
v_where: = get_block_property ('EKKREMOTHTES_AIT_TSG', default_where);
If: blk_criteria.site_id is not null then
v_where: = v_where |' and site_id = "'|: blk_criteria.site_id | ''';
end if;
If: blk_criteria.yphr_klimakio is not null then
v_where: = v_where |' and yphr_klimakio = "'|: blk_criteria.yphr_klimakio | ''';
end if;
If: blk_criteria.send_date_from is not null and: blk_criteria.send_date_to is not null then
v_where: = v_where |' and send_date between to_date('''|| to_char(:blk_criteria.send_date_from,'dd/mm/yyyy')||''',''dd/mm/yyyy'') and
to_date('''|| to_char(:blk_criteria.send_date_to,'dd/mm/yyyy') | " (', "dd/mm/yyyy)";
end if;
If: blk_criteria.eq_group1 is not null then
v_where: = v_where |' and eq_group1 = "' | : blk_criteria.eq_group1 | " ' ;
end if;
If: blk_criteria.eq_type1 is not null then
v_where: = v_where |' and eq_type1 = "' | : blk_criteria.eq_type1 | " ' ;
end if;
If: blk_criteria.eq_group2 is not null then
v_where: = v_where |' and eq_group2 = "' | : blk_criteria.eq_group2 | " ' ;
end if;
If: blk_criteria.eq_type2 is not null then
v_where: = v_where |' and eq_type2 = "' | : blk_criteria.eq_type2 | " ' ;
end if;
blk_def_where ('EKKREMOTHTES_AIT_TSG', v_where); / * a form routine that makes the set_block_property(<block>,default_where) * /.
do_key ('execute_query');
end;
The above code works when the user inserts the criteria for the first time. Later when the user deletes certain criteria - clear criteria in the block of criteria-
and he pushed the button of the query results are exactly the same...
After have debugged the problem, clause v_where is not nullied (do not get the value zero) in order to get the new criteria.
Can you identify the error?
Note: I use Oracle Forms 10 g Db 11 g v.2
Thank you very much
SIM
SIM,
The procedure "blk_def_where" sets the block where clause by using the DEFAULT_WHERE or the ONETIME_WHERE constanct? Gets it to the user that the same results as the DEFAULT_WHERE sets the property WHERE permanently so the second time through, the 'v_where' is NOT null. Check your BLK_DEF_WHERE procedure and if it does not use the ONETIME_WHERE constanct, change isn't. The alternative would be to put DEFAULT_WHERE = NULL after the call to the built-in EXECUTE_QUERY.
Craig...
-
Oracle Forms - "DEFAULT_WHERE" is lost when used an apostrophe
Hi all
I faced a problem with Oracle Forms for a long time and I have no idea of what is happening so far.
I have a block based on a stored table. I used the following statement to set the WHERE clause for this block:
set_block_property ('MTI', default_where, l_where);
Variable l_where has the following form:
l_where: = ' WHERE art_nr IN (')
|| "SELECT the md5 ma_nww_ww_dat art_nr."
|| 'WHERE trunc (sysdate) BETWEEN md5.gueltig_ab AND md5.gueltig_bis'
|| ' AND UPPER (md5.art_bez_altern) AS "' | : gi_intern.txt_match_name | '%''';
The problem arises when the user tries to search for an article, using the MATCH_NAME an apostrophe (for example, GRANT). In this case, the where conditions are lost and all records are returned as a result.
Could you help me understand what the problem is?
Thank you very much!
Raluca
I think you should put the link reference inside the clause, instead of its value.
I mean: If you set the where_clause ' like mycol. "' | : my_item |' % "'
you to hard-code the value of: my_item at the time of the set_block_property.
I could do this instead (simplifying):
l_where: = ' upper (md5.art_bez_altern) like: gi_intern.txt_match_name | » %'' ';
Thus, the: my_item value will be assessed at the moment execute_query, and I think that forms will address the apostrophe in the variable to better link if hardcode you just what you do in your example.
It is, forms will treat it in the same way it would if you were query mode enter and entering a filter: with variable binding.
In fact, I think that this kind of filter you can even enter at the time of the design (with single apostrophes)
In addition, liaison is supposed to be better for the performance of subsequent queries.
-
SET_BLOCK_PROPERTY DEFAULT_WHERE property
Hi all
I use the oralce forms builder 10g version.
I want to get the display records according to the criteria of research as
Assume that DESCRIPTION field "NATURE %" when I click the search the block button to display the record whose DESCRIPTION starts with "NATURE CATS," NATURE DOGS etc...
I used
SET_BLOCK_PROPERTY ('BLOCK_NAME ', DEFAULT_WHERE,' where as DESCRIPTION: QF_VALUE');
It gives me error DESCRIPTION is not a valid identifier.
Because BLOCK NAME DESCRIPTION article DATABASE NON-base.
I have description data in another table, where I can join the 2 tables.
Please let me how can know I get the required data.
Thank you.
Set the block based on the code description code
I guess, you have a description code in your BLOCK_NAME building that is based on your description table, then try as follows
SET_BLOCK_PROPERTY ('BLOCK_NAME', DEFAULT_WHERE, ' description_code IN (SELECT description_code ' |) ")
'OF description_table' |
"Description WHERE AS % | : QF_VALUE | » %');
-
problem with default_where
Hi all
I create a new form name is (inq_items)
This form contains a block of two canva and two window
block 1-> name (blkkey) no block database-> canva (search)--> window1
block 2-> block of database name (items)-> canva (items)-> window2
in canva (search), I create a txt element to query
and I create a button to push that button contains this query
trigger (when-pressed key)
I need to this query runs given to another block (items), how can I do?DECLARE WHERE_CLAUSE VARCHAR2 (3000) := ''; BEGIN WHERE_CLAUSE := '(CODE = :BLKKEY.CODE OR :BLKKEY.CODE IS NULL )AND ' ||'(BAR_CODE = :BLKKEY.BAR_CODE OR :BLKKEY.BAR_CODE IS NULL ) AND ' ||'(CAT_NO = :BLKKEY.CAT_NO OR :BLKKEY.CAT_NO IS NULL ) AND ' ||'(SUB_CAT_NO = :BLKKEY.SUB_CAT_NO OR :BLKKEY.SUB_CAT_NO IS NULL ) AND ' ||'(SUPPLIER_NO = :BLKKEY.SUPPLIER_NO OR :BLKKEY.SUPPLIER_NO IS NULL ) AND '; SET_BLOCK_PROPERTY ('TBL_WHS_ITEMS', default_where, WHERE_CLAUSE); EXECUTE_QUERY; END;
Sorry for my English
Thank you toAndreas is correct - your where clause has a problem at the end.
We will build cleaner where clause:
DECLARE
WH_CL VARCHAR2(3000);
AND_TXT VARCHAR2(5);
--
PROCEDURE CHECK_PART(COL_NAME VARCHAR2) IS
BEGIN
IF NAME-IN('BLKKEY.'||COL_NAME) IS NOT NULL THEN
WH_CL := WH_CL || AND_TXT
|| COL_NAME ||'= :BLKKEY.' || COL_NAME;
AND_TXT := ' AND ';
END IF;
END CHECK_PART;
--
BEGIN
CHECK_PART('CODE');
CHECK_PART('BAR_CODE');
CHECK_PART('CAT_NO');
CHECK_PART('SUB_CAT_NO');
CHECK_PART('SUPPLIER_NO');
SET_BLOCK_PROPERTY ('TBL_WHS_ITEMS', default_where, WH_CL);
EXECUTE_QUERY;
END;If you ask how to make sure at least one of your BLKKEY items is not null, you can add this before the SET_BLOCK_PROPERTY:
IF WH_CL IS NULL THEN
MESSAGE(' PLEASE ENTER AT LEAST ONE FIELD');
RAISE FORM_TRIGGER_FAILURE;
END IF;.. .and why people use tabs like this in their code?
-
problem with sql default_where statement
Hello gurus
I use forms 6i, shaped with blocks of data AREA and the area euro1, their sources of data are derived from a table of unique 'space '.
right side of the form displays the list of all the domain names (one attribute in a table) inserted before the trigger of when_new_form instance (i.e. Grenier1 block).
by clicking on: AREA1.NAME I want to execute the details of corner table block area...
to do this, I specified trigger on_mouse_click
and I call it a procedure on prior requestgo_block('area'); execute_query;
Matching(:Area1.Name);
Code of procedure of correspondence is
It works only 2 or 3 times, but now it gives me the error FRM-40505 unable to execute the queryPROCEDURE matching(c_name in varchar2) IS sql_state varchar2(100); BEGIN ----- if not null then if c_name is not null then sql_state := 'UPPER(name) like ''%'''||UPPER(c_name)||'''%'''; set_block_property('area',default_where,sql_state); else message('feild is empty'); end if; exception when others then display_error; END;
There is no any element non-base of data on two blocks of
What can be the problem, please
Thank youlike ''%' ||UPPER(c_name)|| '%''';
-
Problem in the use of Default_where 'between '.
I want to find the appmnt_date between the from_date and to_date
also good appmnt_status_code I selected in the list.
I wrote the below query and it throws an error like "unable to execute the query."
Set_block_property ('BL_APPMNT ', default_where,' BETWEEN the APPMNT_DATE (: BL_CONTROL_BLOCK.)) FROM_DATE AND: BL_CONTROL_BLOCK. To_date) AND APPMNT_STATUS_CODE in (select APPMNT_STATUS_CODE from the REF_APPMNT_STATUS where APPMNT_STATUS_CODE =: BL_CONTROL_BLOCK.) (APPMNT_STATUS_CODE)');
Need help.
Thank youHi Guy,
Change to:SET_BLOCK_PROPERTY ('BL_APPMNT', DEFAULT_WHERE, 'APPMNT_DATE BETWEEN :BL_CONTROL_BLOCK.FROM_DATE AND :BL_CONTROL_BLOCK.TO_DATE AND APPMNT_STATUS_CODE IN (SELECT APPMNT_STATUS_CODE FROM REF_APPMNT_STATUS WHERE APPMNT_STATUS_CODE = :BL_CONTROL_BLOCK.APPMNT_STATUS_CODE)');
In short, the problem is BETWEEN (: BL_CONTROL_BLOCK.) FROM_DATE AND: BL_CONTROL_BLOCK. To_date), after, BETWEEN, there is no need of pair of hooks for the beach.
I hope this helps.
Best regards
Arif Khadas
-
How to use SET_BLOCK_PROPERTY with DEFAULT_WHERE
Hello
Guide to please the following
I have a block of retail, containing various columns like dyear, dmonth, itemcategoryid etc., locationid. I want to filter the records that correspond to four parameters only. I wrote like this (mentioned below), but it gives a correct result.
GO_BLOCK ('dep_vw');
set_block_property ('dep_vw', default_where, 'locationid =' |) "'|: cb1.locid | '''|| ' and
Trim (dmonth) =' | "'|: cb1.monthh | '''|| 'and dyear =' | "'|: cb1.yearr | '''|| 'and itemcategoryid =' | "'|: cb1.catgry_id | ''') ;
Control block (cb1) has variable parameters.
Any solution please.
Kind regards.set_block_property('dep_vw',default_where,'locationid ='''||:cb1.locid||''' and trim(dmonth)='''||:cb1.monthh||''' and dyear='''||:cb1.yearr||''' and itemcategoryid='''||:cb1.catgry_id||'''');
-Clément
-
Problems updating default_where with date values
Hello
I want to update the attribute default_where with date values. the form is initialized, the attribute default_where = Lieferdatum > =: AB2.von AND Lieferdatum < =: AB2. BIS
Then, I select the query.
by fireing the trigger when-click of the mouse, I want to select only the witch value content items: Lieferdatum
declare
v_bestellnr varchar (200);
test varchar (200);
Start
v_bestellnr: =: k_falschgeladen_vw. Lieferdatum;
test: = 'LIEFERDATUM =' | v_bestellnr;
Set_Block_Property ('K_FALSCHGELADEN_VW' test, DEFAULT_WHERE),
EXECUTE_QUERY;
end;
I get the message FRM-40505 query could not be reached
Paper copy of the formdeveloper http://www.neusob.de/~RobertKoch/dok1-Dateien/image002.jpg
so, how can I get good value in the default_where attributeI hope that the: k_falschgeladen_vw. Lieferdatum is date data type. If so, try the following:
Set_Block_Property('K_FALSCHGELADEN_VW', DEFAULT_WHERE, 'LIEFERDATUM=TO_DATE(''' || TO_CHAR(:k_falschgeladen_vw.Lieferdatum, 'DD.MM.YYYY') || ''', ''DD.MM.YYYY'')'); EXECUTE_QUERY;
-
Hello
I have a requirement where if the user types in a part of the string, it must question him recordings using as and %.
Name of base table employees.
If the user types in "Jo" as name, records for which the string Jo must be returned.
I have my QUERY before trigger like this.
When I look at the query running using TOAD,r_String := NAME_IN ('employees.firstname') if r_String is not null then THEN sub_where := ||'(firstname LIKE ''' ||'%' || r_string ||'%'||''')'; END IF;
I do not understand where and why (firstname =: 1) comes. The query returns all rows.select emp_id,first_name,last_name from employees where (firstname LIKE '%Jo%') and (firstname = :1);
Thank youHello
I guess firstname is your DB field and then when you enter enter_query mode and type something in this area and where clause, then it takes as an argument for this field (firstname) Db and puts it in where clause.
Ideal thing to do would be to create an element of database field not and ask the user to enter the name in this field and then question.
something like that
declare r_string varchar2 (100);
Start
r_String: = NAME_IN('DHIRAJ.) ITEM11'); item11 here is an article from the database for dhiraj datablock
If r_String is not null
THEN
Set_Block_Property ('YES', default_WHERE, ('name AS' | ")) ' ||' %' || r_string | » %'||''''||''));
END IF;
end;Published by: Dhiraj Madan on May 13, 2009 10:08
-
Block based on the stored procedure cannot modify Default_where clause
Hi all
I tried to create a block based on the stored procedure that it works very well with the result set for the refcursor. But if I need to add filters on the block using where clause in the palette of goods or
using the property block set in where clause, it does not error but does not review filters .
tried everything to you please let me know. This is a restriction whereby we can set filters on the block when we create the block based on the stored procedure.
Thank you
Check in Form Builder Help:
Creating a block of data from a procedure that uses a ref cursor
... You can't pass a WHERE or ORDER BY clause clause in a stored procedure.
But you can send your WHERE condition using the query Source Arguments.
If the procedure is on the side of the database (not in the forms module), ensure that the procedure is not vulnerable to injection of SQL code.
Kind regards
Zlatko
-
I want to execute a specific request, but I have no idea about this please someone help me how to a specific query, run?
Try this.
Yes you can write this in next item key of you text element.
Go_Block ('Your_Block_Name');
Set_Block_Property ('Your_Block_Name', DEFAULT_WHERE, 'STUDENT_ID =' |: STUDENT_ID);
Execute_Query (No_Validate);
-
Fit, I have the edit button and its function is that when I press the button change go IDs (text_item) and run the query
but my problem is that when I enter text_item in any id it displays just first record
for example
When I enter id... 1 data display
but I enter the id 2, 3, 4... its just id 1 information display
Use of pre_query trigger.
For example
You write the code below in your button.
Go_Block ('Your_Block_Name');
Execute_Query (No_Validate);
After that, you write the query pre relaxing on your query block.
Set_Block_Property ('Your_Block_Name ', Default_Where,' Id =' |: MYSEARCHBLOCK.) Item_Id);
-
Hi everyone how can filter query on the form
I a request form based on a database of datablock table and I use some items based on the datablock control to run the query, the user can use a portion of this Articles to filter the query, what is the best way to implement this form I have tried using the set_block_property default _where but is not working If the user is using all of the elements to filter the query, which is better use of the cursor or the default_where and how.
Hello
You can try to use the LIKE operator instead of =.
Str_Condition: = '
AS "' |: . . '%'' AND LIKE ''' || : . || '%'''; etc. And use it as the DEFAULT_WHERE clause.
Manu.
-
The block, by removing the block, by asking questions of compensation block
Hello
The current design of the shape is as below (without changes to the formatting and design)
(1) has a P - database no block parent heading
(2) has a child block C - block of data with a single table T
In essence, the data is stored in a single table
How to achieve the following
(1) clear the block (both P and C) If you erase the block P
(2) by deleting the records to both P and C, if the deletion of the record in P
(3) by deleting records in C
(4) ask Parent P (F11 and F11 control) reviews and pulling on the files in C (Ctrl + F11)
Concerning
S
Hello
Pls use for their feature the following...
1. you can use WHEN - BUTTON - PRESSED to erase the two Trigger block using Clear_form;
2 & 3 - oracle database to create relationship master-detail between tables using foreign keys and cascading deletes using the FOREIGN KEY constraint with the ON DELETE CASCADE clause. Oracle/PLSQL: delete foreign keys with cascade
However, Oracle Forms manage thing delete cascade internally when you define the relationship properties. I recommend the creation of another table master P with the relationship specified in table C.
U GOLD create a relationship out of shape between the two blocs.
If not, try to use-DELETE or KEY of VALIDATION Trigger at the level of the form, FOR INSTANCE:
Note: do not to consider deleting the master, since non-base of data block DELETE is used ONLY in db transaction deleting.
So you can set their NULL values as
:P_block.dept_id :=NULL;
or you can use CLEAR_ITEM;
CLEAR_ITEM('
P_block.dept_id');Syntax
REMOVE the TABLE Table_Name
WHERE search_condition;
Example of
IF: P_block.dept_id is NOT NULL, THEN
DELETE T
WHERE t.dept_id =: p_block.dept_id;
4-to resolve this point
PLS, set the property default_where of the data block C for example
dept_id =: p_block.dept_id;
Therefore, to create a TIME-NEWS-BLOCK-INSTANCE Trigger on C block diagram
Write the following text
GO_BLOCK('C');
EXECUTE_QUERY;
Amatu Allah.
Maybe you are looking for
-
macOS Sierra 10.12 and 10 Mail: smart mailbox does not
Hi people, After macOS 10,12 intelligent ball of the mail 10.0 update Sierra is no longer in effect. Case: Create a smart mailbox, which displays all messages (Inbox, sent, archives, etc.). The smart mailbox selections below: In OS X 10.11 El Capitan
-
a reason for adding the station wifi?
I have a mac additional wifi station and I got it in my living room where, on the net, I get a lot. the time capsule that broadcasts my wifi is in the office down the Hall. adding the station wifi in my living room will help with a question that mail
-
HP dv5 does not start with monitor plugged
Hello I have a HP Pavilion dv5 1130ea. I have an external monitor that I use as a second screen. However, this week yet he refuses to start when I plug in the monitor, it keeps cycling of the boot sequence prior (I don't get the option to press ESC t
-
HelloI recently bought a second hand L10-300 and did a clean install of WINXP MCE.All right, or so I thought. I have no sound!Device Manager shows that the sound card is properly installed. In the control panel under sounds, it shows the AMC Conextan
-
How can I fix my automatic, log on different programs
At the same time, I don't have to put in my password or some time my ID. For some reason any that has stopped working. I have now signed up for either one until I can open some of the prograns. Can someone help me please. I am runing Wind