Home » Developer & Programmer » Forms » To fetch a single record from multiple records based on a condition (oracle 10G)
To fetch a single record from multiple records based on a condition [message #541040] Fri, 27 January 2012 04:25 Go to next message
poojamunj
Messages: 64
Registered: May 2011
Location: MUMBAI
Member
Hello,

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.
Please suggest me some logic to find it out.
Else can i use :system.cursor_record. If yes, How to use it for this system.
Thanks.
Re: To fetch a single record from multiple records based on a condition [message #541041 is a reply to message #541040] Fri, 27 January 2012 04:33 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
What do you mean by this exactly?
poojamunj wrote on Fri, 27 January 2012 10:25
the travels which are cancelled should not be in enable mode.

Re: To fetch a single record from multiple records based on a condition [message #541042 is a reply to message #541041] Fri, 27 January 2012 04:35 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
If it means that items in a canceled travel should not be editable, then SET_ITEM_INSTANCE_PROPERTY might be a choice.
Re: To fetch a single record from multiple records based on a condition [message #541043 is a reply to message #541041] Fri, 27 January 2012 04:39 Go to previous messageGo to next message
poojamunj
Messages: 64
Registered: May 2011
Location: MUMBAI
Member
In my travel Booking Form, if i select any booking number, respective information under that booking number is been displayed i.e number of users who are travelling and there individual travels.
But the travels which are cancelled, those fields should not be enable so that it will restrict the user to modify the travel which is being cancelled.
Re: To fetch a single record from multiple records based on a condition [message #541044 is a reply to message #541043] Fri, 27 January 2012 04:45 Go to previous messageGo to next message
poojamunj
Messages: 64
Registered: May 2011
Location: MUMBAI
Member
i used the following code on on_populate_details trigger of 2nd block:

if :tra_trv_dtl.TTD_TCT_CAN_FLG = 'Y' then
set_item_property('tra_trv_dtl.TTD_TRV_MODE',enabled,property_false);
set_item_property('tra_trv_dtl.TTD_TRV_CLASS',enabled,property_false);
set_item_property('tra_trv_dtl.TTD_SRC',enabled,property_false);
set_item_property('tra_trv_dtl.TTD_DEST',enabled,property_false);
set_item_property('tra_trv_dtl.TTD_REF_NO',enabled,property_false);
set_item_property('tra_trv_dtl.TTD_PURPOSE',enabled,property_false);
set_item_property('tra_trv_dtl.TTD_CNT_NO',enabled,property_false);
set_item_property('tra_trv_dtl.TTD_BKED_BY',enabled,property_false);
set_item_property('tra_trv_dtl.BUTTON_DT1',enabled,property_false);
set_item_property('tra_trv_dtl.TTD_TRV_DT',enabled,property_false);
set_item_property('tra_trv_dtl.TTD_OTH_REQ_FLG',enabled,property_false);
-- set_item_property('tra_trv_dtl.TTD_OTHER',enabled,property_false);

else

set_item_property('tra_trv_dtl.TTD_TRV_MODE',enabled,property_true);
set_item_property('tra_trv_dtl.TTD_TRV_CLASS',enabled,property_true);
set_item_property('tra_trv_dtl.TTD_SRC',enabled,property_true);
set_item_property('tra_trv_dtl.TTD_DEST',enabled,property_true);
set_item_property('tra_trv_dtl.TTD_REF_NO',enabled,property_true);
set_item_property('tra_trv_dtl.TTD_PURPOSE',enabled,property_true);
set_item_property('tra_trv_dtl.TTD_CNT_NO',enabled,property_true);
set_item_property('tra_trv_dtl.TTD_BKED_BY',enabled,property_true);
set_item_property('tra_trv_dtl.BUTTON_DT1',enabled,property_true);
set_item_property('tra_trv_dtl.TTD_TRV_DT',enabled,property_true);
set_item_property('tra_trv_dtl.TTD_OTH_REQ_FLG',enabled,property_true);
-- set_item_property('tra_trv_dtl.TTD_OTHER',enabled,property_true);
end if;


this code is working on thistrigger but the only problem is it is not fetching single record for which the travel is cancelled. it is making the entire block as disabled which i dont want.
Re: To fetch a single record from multiple records based on a condition [message #541045 is a reply to message #541043] Fri, 27 January 2012 04:46 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Use set_item_instance_property to set update_allowed.
Re: To fetch a single record from multiple records based on a condition [message #541047 is a reply to message #541045] Fri, 27 January 2012 05:05 Go to previous messageGo to next message
poojamunj
Messages: 64
Registered: May 2011
Location: MUMBAI
Member
can you please suggest me how can i use it in this system sincei have never used it before
Re: To fetch a single record from multiple records based on a condition [message #541049 is a reply to message #541047] Fri, 27 January 2012 05:15 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Instead of SET_ITEM_PROPERTY use SET_ITEM_INSTANCE_PROPERTY.
Re: To fetch a single record from multiple records based on a condition [message #541051 is a reply to message #541049] Fri, 27 January 2012 05:26 Go to previous messageGo to next message
poojamunj
Messages: 64
Registered: May 2011
Location: MUMBAI
Member
Its throwing me error as: No such property for Set_Item_Instance_property
Re: To fetch a single record from multiple records based on a condition [message #541054 is a reply to message #541051] Fri, 27 January 2012 05:51 Go to previous message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
So open Forms Help and see what properties are valid for SET_ITEM_INSTANCE_PROPERTY.
Previous Topic: what are the parameters for app_window.set_window_position()
Next Topic: Refresh Tree After DML operation
Goto Forum:
  


Current Time: Mon Sep 16 06:05:47 CDT 2024