Forms :: Dynamic Where Condition Using Set_block_property?
Nov 7, 2011
I am working on Forms 6i. I have data block A on table EMP.
Datablock A: Empno, Ename, Hiredate
I have FIND Screen: EMPNO, HIREDATE_FM,HIREDATE_TO and FIND Button.
I will search the records through FIND Screen.
I want to set the where condition of block A in pre-query trigger.
set_block_property('BLOCKA',default_where,'HIRE_DATE BETWEEN FIND.HIREDATE_FM and FIND.HIREDATE_TO');
Note: FIND in above is FIND Screen block.
It's not fetching any records, i doubt that there is syntax error in above statement.
View 1 Replies
ADVERTISEMENT
Apr 6, 2005
I'm using forms 9i. Let's say I have a Block in the form B1. It has two items I1 and I2. I have a table called T1 that has a column say C1. The data in the only record in T1 is 'NAME_IN(''B1.I1'') = 1 OR NAME_IN(''B1.I2'') = 2'..In forms I need to execute the following at POST-QUERY trigger of the block:-
DECLARE
VAR1 VARCHAR2(1000);
BEGIN
SELECT C1
INTO VAR1
FROM T1;
[code]....
As you could see that the IF statement is wrong. But I get the condition (for IF condition) as a string value from some database table.
View 9 Replies
View Related
Feb 20, 2013
Have you ever had to add exists to this property? Is this possible?
IF (:VRAN.INSERT_DT IS NOT NULL) THEN
my_where := my_where || ' exists in ( select ''X'',';
my_where := my_where || ' from MON_APL a, mon_hist h ';
my_where := my_where || ' where 1=1 ';
my_where := my_where || ' and a.id = h.mon_id ';
my_where := my_where || ' and h.hist_id = (select max(hist_id) ';
[code].......
So far I haven't been able to get any combination of this working other than what was there:
my_where := my_where || ' INSERT_DT between ';
my_where := my_where || 'TO_DATE (''';
my_where := my_where || :VRAN.INSERT_DT;
my_where := my_where || ''', ''MM/DD/YYYY'')';
my_where := my_where || ' and TO_DATE (''' || :VRAN.INSERT_DT || ''', ''MM/DD/YYYY'') + 1';
View 6 Replies
View Related
Jan 19, 2013
i want to know that how can i use like operator with if condition. i m using oracle10g form builder and it's for search purpose .
for example ...
if search string=string2 then
message('Record found');
end if ;
i want to use like '%search string%'.
View 1 Replies
View Related
Nov 2, 2011
I am working on forms 6i. I have set where condition in pre-query of a trigger, my requirement is, in post-query, i want to delete the where condition.
pre-query:
set_block_property('HEADER_S',default_where,'STATUS IN (select meaning from XXSMCQSS_LOOKUP_VALUES where lookup_type=''CONCESSION STATUS CODES'' and primary_flag=''N'' )');
post_query: I want to delete this where condition, i just want make execute query normal by removing the where condition.
View 8 Replies
View Related
Jan 9, 2013
After committing form i want to clear few item and retain few item and make the form ready for next record to be inserted along with retained item.
View 4 Replies
View Related
Jul 4, 2011
I am working on 6i reports.I have below scenario to achieve.
I have FIND window and MAIN Window.
FIND Window: contains EMPNO, ENAME,and FIND button.
MAIN WINDOW: EMPNO, ENAME, SAL, JOB
If i enter something in FIND window, by clicking FIND button, it will populate data in MAIN window.I have below query in WHEN BUTTON PRESSED TRIGGER.
declare
cursor c1 is select empno, ename, job, sal from emp
where empno=nvl(:FIND.empno,empno)
and ename=nvl(:FIND.ename,ename)
begin
--here i am populating data into MAIN window block
end;
It's working fine.
REQUIREMENT: i want to pass where statement dynamically. Let us say if i pass only empno in FIND window, i want to pass 'WHERE empno=:FIND.empno' to existing select statement [I will keep select statement same without where condition]
If i pass empno and ename both, i want to pass 'WHERE empno=:FIND.empno and ename=:FIND.ename.
How to pass where condition to existing select statement based on parameters we pass in FIND window.
View 8 Replies
View Related
Feb 7, 2010
I have master detail datablocks. Master block is course and detail block is trainee. students can schedule their courses in a location at particular time.
lets assume student1 has scheduled course A1 in location LA1 from 9am to 12 pm. Now second student shouldn't be able to schedule same course at same time in same location. He can schedule at different time duration. or else same time duration but different location. Or same time, same location but different course.
so, what i did is, i wrote code in when-validate-record of trainee block to display a message saying " cannot schedule course.choose another time." if he try to insert same time duration or same location .
when i am trying to insert a record with time which is already scheduled and in same location, it displays the message but it is also saving the record. i don't want to save the record.
how should i do this? i tried to give ROLLBACK in this trigger but it doesn't accept. i tried pre-insert trigger also but it is also displaying message but saving the record
my code in when-validate-record is:
declare
cursor c1 is
select start_time,end_time,loc
from trainee
where cname=:course.cname;
[code].......
View 5 Replies
View Related
Jan 23, 2013
I have a view t1 having the records:
1 A
1 A+
2 B
3 C
4 D
I want to display that in an LOV but without the first record (1 A) I used the code :
SELECT DISTINCT num,
DECODE(num,1,(SELECT DISTINCT desc FROM t1 a
WHERE a.desc='A+'AND a.num=1),desc) desc
FROM t1
this worked fine but how to apply this in a post_change trigger where a user inters the num and the desc appears in atext-item in my form
View 1 Replies
View Related
Jun 27, 2013
how can i execute query using a where condition?
View 9 Replies
View Related
Jul 8, 2012
In form i call a record from database table through execute_query. i have lov on ITEM_NO
i want to display on that form, no. of records of ITEM_NO which i select from the list. like if i have 10 records with item_no which i select from list is must show 1/10.
if i press the down arrow it should show next record of the same item_no.
View 5 Replies
View Related
Jun 22, 2011
,i have a table called travel detail from which i have retrieved few rows based on 1 condition by using LOV and on next few rows modification is allowed. The rows are getting modified but it is also allowing me to enter in next blank row and insert any data in that row.how can i retrieve only that data which is based on the given condition. Further blank rows should not b displayed.
View 2 Replies
View Related
Apr 16, 2008
I'm trying to create a relation from child block to the master block that I've created . Foreighn key is there from child to parent table.The error I get is below:
FRM-15004: Error while parsing join condition
The join condition is correct, but I'm still clueless as to what it could be.Is it a form bug?
View 7 Replies
View Related
Jun 13, 2012
i want to update record that is fetched based on join condition on form
1. made a block manually :::: EMPSAL
2. Query DATA SOURCE NAME :::: EMP a, Sal b
3. Where Clause :::: a.empid = b.empid
4. DML DATA Target Type :::: Table
5. DML DATA Target Name :::: EMP a, Sal b
6. All Columns are marked a.empid, a.empname, b.sal, b.date etc
It does not allow me to update record.
View 1 Replies
View Related
Aug 16, 2010
I receive a "FRM-15004 Error while parsing join condition" when attempting to create a relation between block1 (parent table) and block2 (child table). If I do a simple straight join the statement is accepted but if I use a Decode then it results in an error. How to successfully use a decode or a nvl in a join statement of a relation?
Results in Error:
block1.case_id = block2.case_id and
decode(block1.employee_id, null, block1.entity_id, block1.employee_id) =
decode(block2.employee_id, null, block2.entity_id, block2.employee_id)
This join is accepted but I would like to use a decode since a record can have either a employee_id or entity_id, not both
block1.case_id = block2.case_id and
block1.employee_id = block2.employee_id and
block1.entity_id = block2.entity_id
View 1 Replies
View Related
Mar 17, 2012
i want to display records from a table in tabular form with one condition.
i made a tabular form.and in WHEN-NEW-FORM-INSTANCE i write
DECLARE
CURSOR hascr IS
SELECT
BILL_ID,
BILL_DATE,
MAT_CODE,
PLACE_FROM,
[code]....
when i run the form its not showing any errors but displaying only one record.that is the first record whose bill_type is send to other store.
am i using the right trigger or my select statement has problem?
View 9 Replies
View Related
Aug 7, 2012
Is it possible to use a compound condition on a form listing say 15 records utilizing the F11 key?(ie. order column <10 and >5)
View 2 Replies
View Related
Jan 27, 2012
I have made a travel booking system which comprises of 3 forms
1)Travel Booking form
2)Reservation Form
3)Cancellation Form
Under one booking number i can add multiple users in which they can have there multiple travels.
Users can cancel there individual travels under a prescribe booking number which on doing the Cancel flag turns to 'Y'.
What i want is, If a user is cancelling his/her travel under any booking number then while retriving the records in Travel Booking form, the travels which are cancelled should not be in enable mode.
For one user there can be 4 travels out of which 2 are cancelled, how can i track only those records whoes cancel flag is set to Y. some logic to find it out. Else can i use :system.cursor_record. If yes, How to use it for this system.
View 9 Replies
View Related
Oct 11, 2013
navigate from interactive report to different forms..
View 10 Replies
View Related
Aug 6, 2008
I am using Oracle Form 6i. I have created pdf file from oracle report. On view button, I have written:
host('C:Program FilesAdobeReader 8.0ReaderAcroRd32.exe C:dailypending.pdf');
I don't want to set this path on every machine. I want to set its dynamic path so that on which even I machine, I run the applicaiton, it will directly find AcroRd32.exe from any drive either C: or D: or anything else...
It might be Acrobat Reader 9.0 or 8.0 whatever version will be installed on client machine...I want to set path according to that..So that whatever version it would be, it doesnt affect the application..
View 4 Replies
View Related
Aug 28, 2007
I want to create dynamic Lov. How can I create it? For practice I create a LOV at design time
RECORD_GROUP_QUERY value:
SELECT * FROM
EMP.
THEN I write some code in WHEN-BUTTON-PRESSED Trigger to replace RECORD_GROUP_QUERY at run time. Code is:
........
v_rg_id:=CREATE_GROUP_FROM_QUERY('TEST','SELECT * FROM DEPT');
........
After this I found a error at run time which is FRM-41826: Cannot replace group; columns don't match LOV.
View 6 Replies
View Related
Feb 22, 2011
I want to create a Dynamic record group and associate it to a LOV.for example: I want that for a set of people A, i want to fire the query in lov:
select * from emp where (condition 1)
and for another set of people B, I want to fire
select * from emp where (condition 2)...
How could I achieve it?
View 4 Replies
View Related
Jul 20, 2010
I have one requirement.I am populating LOV dynamically for the subinventory field in the order form through custom.pll.
If Dropship flag= 'Y' then populate suninv LOV with D1,d2..values.If it is 'N' then populate suninv LOV with w01,w02,....values.This is done and working fine in the form.But If i save dropship flag='Y' and Subinv value is D1 then it saves the record.Now I am changing Drop ship flag as 'N' then 'D1' value appearing in the SUBINV field.and it allow the save changes.
So How can i refresh Lov at the time of making drop ship flag as 'Y'/'N'?
View 6 Replies
View Related
Sep 7, 2011
how to create dynamic list item ????
View 5 Replies
View Related
Feb 12, 2010
i want to get user (dba roles in combo box runt time).i have write down this code in when new form instance.
declare
rg_id recordgroup := find_group('RG') ;
ln_error number ;
begin
if not id_null(rg_id) then
ln_error := populate_group(rg_id) ;
if ln_error = 0 then
populate_list('BLOCK3.T' , rg_id) ;
else
message('Error in Populating Group') ;
end if ;
end if ;
end ;
attached file.when i run it gives the follwoing error. frm-41334-invalid record group.
record group query is: SELECT GRANTED_ROLE FROM DBA_ROLE_PRIVS WHERE GRANTEE='MTSYS'
View 6 Replies
View Related
Oct 24, 2012
I'm still trying to import some video in my form.
So far I made one OLE container and add Oracle Video Control, then I made one button and wrote this trigger:
WHEN-BUTTON-PRESSED
declare
video_obj ole2.obj_type;
begin
video_obj := forms_ole.get_interface_pointer
(`MY_VIDEO');ole2.invoke(video_obj,`ImportFileAs');
end;
This works fine. All I want to do now and I don't know why (because I am quite new in Oracle development) is, to make one trigger that will choose automaticly wich video to play and if it is possible to make when I start the form automaticaly to start that video, if not, it's enough just to choose video automaticaly when I press the button.
View 1 Replies
View Related
Aug 25, 2012
i have a question regarding dynamic record group creation.I have a text item(department) attached with LOV ,and a list item is also there.i want whatever the department name i will select from ma LOV according to that corresponding manager name should be display in the list item.
my table structure is :-
table- QRY
column- DEPT_ID,DEPT_NAME,MANAGER_NAME
View 2 Replies
View Related
Apr 21, 2011
I want to create two list items. one is for deptno and another is for empno in a single form.
Based on the selected deptno value from first list item i want to populate corresponding empno from second list item. I tried with the fallowing code, it's work fine but the second list is not clears with the existing empno's.
Code for Deptno List item
declare
cursor c is select deptno from dept;
cnt number := 1;
begin
clear_list('LI_DEPTNO');
[Code]...
Code for Empno list item in when_list_changed trigger for deptno list item
declare
cursor c is select empno from emp where deptno = :LI_DEPTNO;
cnt number := 1;
begin
it_id := Find_Item('LI_EMPNO');
clear_list(it_id);
for i in c loop
add_list_element('LI_EMPNO',cnt,i.empno,i.empno);
cnt := cnt + 1;
end loop;
end;
View 3 Replies
View Related
Jul 18, 2006
Here is good code and tips to run Dynamic Report from Oracle Forms 6i This utility uses tables and Views to design dynamic report. Just download zip file and unzip all files in a filder. Create database procedure attached, comile the form and use this.
View 3 Replies
View Related
Oct 10, 2011
How could the lov restrict its list as the user types in values:
List:
Amanda
Leila
Leon
User types 'L'
List
Leila
Leon
User type
L+e
List
Leila
At the moment it works but the user has to click the button each time.
View 1 Replies
View Related